LibreOffice Module sw (master)  1
wrtsh.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #pragma once
21 
22 #include <swdllapi.h>
23 #include <fesh.hxx>
24 #include <swurl.hxx>
25 #include <IMark.hxx>
26 #include "navmgr.hxx"
27 #include <optional>
28 #include <com/sun/star/embed/EmbedVerbs.hpp>
29 #include <o3tl/typed_flags_set.hxx>
30 #include <svx/swframetypes.hxx>
31 #include <vcl/weld.hxx>
32 
33 namespace vcl { class Window; }
34 class SbxArray;
35 class SwDoc;
36 class SwViewOption;
37 class SwFlyFrameAttrMgr;
38 class SwField;
39 class SwTOXBase;
40 class SwView;
41 class SvGlobalName;
42 class SwInputFieldList;
43 class SwSectionData;
44 class Timer;
45 class SvxMacro;
46 class SwFormatINetFormat;
47 class SvxAutoCorrect;
49 struct SwCallMouseEvent;
50 class SfxStringListItem;
51 enum class SvMacroItemId : sal_uInt16;
52 class SwFieldMgr;
53 class SfxRequest;
54 
55 namespace i18nutil {
56  struct SearchOptions2;
57 }
58 
59 enum class SelectionType : sal_Int32
60 {
61  NONE = 0x000000,
62  Text = CNT_TXT, // text, never frames too 0x0001
63  Graphic = CNT_GRF, // graphic 0x0002
64  Ole = CNT_OLE, // OLE 0x0010
65  Frame = 0x000020, // frame, no content type
66  NumberList = 0x000040, // NumList
67  Table = 0x000080, // cursor is in table
68  TableCell = 0x000100, // table cells are selected
69  DrawObject = 0x000200, // drawing objects (rectangle, circle...)
70  DrawObjectEditMode = 0x000400, // draw-textobjects in edit mode
71  Ornament = 0x000800, // edit ornament objects
72  DbForm = 0x001000, // drawing objects: DB-Forms
73  FormControl = 0x002000, // a form control is focused. Neither set nor evaluated by the SwWrtShell itself, only by its clients.
74  Media = 0x004000, // Media object
75  ExtrudedCustomShape = 0x008000, // extruded custom shape
76  FontWork = 0x010000, // fontwork
77  PostIt = 0x020000, // annotation
78  TableRow = 0x040000, // table rows are selected
79  TableCol = 0x080000, // table columns are selected
80  All = 0x0ffff3,
81 };
82 namespace o3tl {
83  template<> struct typed_flags<SelectionType> : is_typed_flags<SelectionType, 0x0ffff3> {};
84 }
85 
92 {
93 private:
94  using SwCursorShell::Left;
96  using SwCursorShell::Up;
97  using SwCursorShell::Down;
105 
106  typedef tools::Long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp );
107  typedef void (SwWrtShell::*SELECTFUNC2)(const Point *, bool bProp );
108 
109  SELECTFUNC2 m_fnDrag = &SwWrtShell::BeginDrag;
110  SELECTFUNC m_fnSetCursor = &SwWrtShell::SetCursor;
111  SELECTFUNC2 m_fnEndDrag = &SwWrtShell::DefaultEndDrag;
112  SELECTFUNC m_fnKillSel = &SwWrtShell::Ignore;
113 
114 public:
115 
116  using SwEditShell::Insert;
117 
118  tools::Long CallSetCursor(const Point* pPt, bool bProp) { return (this->*m_fnSetCursor)(pPt, bProp); }
119  void Drag (const Point* pPt, bool bProp) { (this->*m_fnDrag)(pPt, bProp); }
120  void EndDrag (const Point* pPt, bool bProp) { (this->*m_fnEndDrag)(pPt, bProp); }
121  tools::Long KillSelection(const Point* pPt, bool bProp) { return (this->*m_fnKillSel)(pPt, bProp); }
122 
123  bool IsSplitVerticalByDefault() const;
124  void SetSplitVerticalByDefault(bool value);
125 
126  // reset all selections
127  tools::Long ResetSelect( const Point *, bool );
128 
129  // resets the cursorstack after movement with PageUp/-Down if a stack is built up
130  inline void ResetCursorStack();
131  SelectionType GetSelectionType() const;
132 
133  bool IsModePushed() const { return nullptr != m_pModeStack; }
134  void PushMode();
135  void PopMode();
136 
137  void SttSelect();
138  void EndSelect();
139  bool IsInSelect() const { return m_bInSelect; }
140  void SetInSelect() { m_bInSelect = true; }
141  // is there a text- or frameselection?
142  bool HasSelection() const { return SwCursorShell::HasSelection() ||
143  IsMultiSelection() || IsSelFrameMode() || IsObjSelected(); }
145 
146  void EnterStdMode();
147  bool IsStdMode() const { return !m_bExtMode && !m_bAddMode && !m_bBlockMode; }
148 
149  void EnterExtMode();
150  void LeaveExtMode();
151  bool ToggleExtMode();
152  bool IsExtMode() const { return m_bExtMode; }
153 
154  void EnterAddMode();
155  void LeaveAddMode();
156  void ToggleAddMode();
157  bool IsAddMode() const { return m_bAddMode; }
158 
159  void EnterBlockMode();
160  void LeaveBlockMode();
161  bool ToggleBlockMode();
162  bool IsBlockMode() const { return m_bBlockMode; }
163 
164  void SetInsMode( bool bOn = true );
165  void ToggleInsMode() { SetInsMode( !m_bIns ); }
166  bool IsInsMode() const { return m_bIns; }
167  void SetRedlineFlagsAndCheckInsMode( RedlineFlags eMode );
168 
169  void EnterSelFrameMode(const Point *pStartDrag = nullptr);
170  void LeaveSelFrameMode();
171  bool IsSelFrameMode() const { return m_bLayoutMode; }
172  // reset selection of frames
173  void UnSelectFrame();
174 
175  void Invalidate();
176 
177  // select table cells for editing of formulas in the ribbonbar
178  inline void SelTableCells( const Link<SwWrtShell&,void> &rLink );
179  inline void EndSelTableCells();
180 
181  // leave per word or per line selection mode. Is usually called in MB-Up.
182  bool IsExtSel() const { return m_bSelWrd || m_bSelLn; }
183 
184  // query whether the active m_fnDrag pointer is set to BeginDrag
185  // is needed for MouseMove to work around bugs 55592/55931
186  inline bool Is_FnDragEQBeginDrag() const;
187 
188  // base requests
189  bool IsEndWrd();
190  bool IsSttOfPara() const { return IsSttPara(); }
191  bool IsEndOfPara() const { return IsEndPara(); }
192 
193  // select word / sentence
194  bool SelNearestWrd();
195  bool SelWrd (const Point * = nullptr );
196  // #i32329# Enhanced selection
197  void SelSentence (const Point *);
198  void SelPara (const Point *);
199  void SelAll();
200 
201  // basecursortravelling
202 typedef bool (SwWrtShell::*FNSimpleMove)();
203  bool SimpleMove( FNSimpleMove, bool bSelect );
204 
205  bool Left ( sal_uInt16 nMode, bool bSelect,
206  sal_uInt16 nCount, bool bBasicCall, bool bVisual = false );
207  bool Right ( sal_uInt16 nMode, bool bSelect,
208  sal_uInt16 nCount, bool bBasicCall, bool bVisual = false );
209  bool Up ( bool bSelect, sal_uInt16 nCount = 1, bool bBasicCall = false );
210  bool Down ( bool bSelect, sal_uInt16 nCount = 1, bool bBasicCall = false );
211  void NxtWrd ( bool bSelect = false ) { SimpleMove( &SwWrtShell::NxtWrd_, bSelect ); }
212  bool PrvWrd ( bool bSelect = false ) { return SimpleMove( &SwWrtShell::PrvWrd_, bSelect ); }
213 
214  bool LeftMargin ( bool bSelect, bool bBasicCall );
215  bool RightMargin( bool bSelect, bool bBasicCall );
216 
217  bool StartOfSection( bool bSelect = false );
218  bool EndOfSection ( bool bSelect = false );
219 
220  bool SttNxtPg ( bool bSelect = false );
221  void SttPrvPg ( bool bSelect = false );
222  void EndNxtPg ( bool bSelect = false );
223  bool EndPrvPg ( bool bSelect = false );
224  bool SttPg ( bool bSelect = false );
225  bool EndPg ( bool bSelect = false );
226  bool SttPara ( bool bSelect = false );
227  void EndPara ( bool bSelect = false );
228  bool FwdPara ()
229  { return SimpleMove( &SwWrtShell::FwdPara_, false/*bSelect*/ ); }
230  void BwdPara ()
231  { SimpleMove( &SwWrtShell::BwdPara_, false/*bSelect*/ ); }
232  void FwdSentence( bool bSelect = false )
233  { SimpleMove( &SwWrtShell::FwdSentence_, bSelect ); }
234  void BwdSentence( bool bSelect = false )
235  { SimpleMove( &SwWrtShell::BwdSentence_, bSelect ); }
236 
237  // #i20126# Enhanced table selection
238  bool SelectTableRowCol( const Point& rPt, const Point* pEnd = nullptr, bool bRowDrag = false );
239  void SelectTableRow();
240  void SelectTableCol();
241  void SelectTableCell();
242 
243  bool SelectTextAttr( sal_uInt16 nWhich, const SwTextAttr* pAttr = nullptr );
244 
245  // per column jumps
246  void StartOfColumn ();
247  void EndOfColumn ();
248  void StartOfNextColumn ();
249  void EndOfNextColumn ();
250  void StartOfPrevColumn ();
251  void EndOfPrevColumn ();
252 
253  // set the cursor to page "nPage" at the beginning
254  // additionally to an identically named implementation in crsrsh.hxx
255  // here all existing selections are being reset before setting the
256  // cursor
257  bool GotoPage( sal_uInt16 nPage, bool bRecord );
258 
259  // setting the cursor; remember the old position for turning back
260  DECL_LINK( ExecFlyMac, const SwFlyFrameFormat*, void );
261 
262  bool PageCursor(SwTwips lOffset, bool bSelect);
263 
264  // update fields
265  void UpdateInputFields( SwInputFieldList* pLst = nullptr );
266 
267  void NoEdit(bool bHideCursor = true);
268  void Edit();
269 
270  bool IsRetainSelection() const { return m_bRetainSelection; }
271  void SetRetainSelection( bool bRet ) { m_bRetainSelection = bRet; }
272 
273  // change current data base and notify
274  void ChgDBData(const SwDBData& SwDBData);
275 
276  // delete
277  void DelToEndOfLine();
278  void DelToStartOfLine();
279  void DelLine();
280  bool DelLeft();
281 
282  // also deletes the frame or sets the cursor in the frame when bDelFrame == false
283  bool DelRight();
284  void DelToEndOfPara();
285  void DelToStartOfPara();
286  bool DelToEndOfSentence();
287  void DelToStartOfSentence();
288  void DelNxtWord();
289  void DelPrvWord();
290 
291  // checks whether a word selection exists.
292  // According to the rules for intelligent Cut / Paste
293  // surrounding spaces are cut out.
294  // returns type of word selection (see enum)
295  enum word {
296  NO_WORD = 0,
297  WORD_SPACE_BEFORE = 1,
298  WORD_SPACE_AFTER = 2,
299  WORD_NO_SPACE = 3
300  };
301  int IntelligentCut(SelectionType nSelectionType, bool bCut = true);
302 
303  // edit
304  void Insert(SwField const &, SwPaM* pAnnotationRange = nullptr);
305  void Insert(const OUString &);
306  // graphic
307  void Insert( const OUString &rPath, const OUString &rFilter,
308  const Graphic &, SwFlyFrameAttrMgr * = nullptr,
309  RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA);
310 
311  void InsertByWord( const OUString & );
312  void InsertPageBreak(const OUString *pPageDesc = nullptr, const ::std::optional<sal_uInt16>& rPgNum = std::nullopt);
313  void InsertLineBreak();
314  void InsertColumnBreak();
315  void InsertFootnote(const OUString &, bool bEndNote = false, bool bEdit = true );
316  void SplitNode( bool bAutoFormat = false );
317  bool CanInsert();
318 
319  // indexes
320  void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = nullptr);
321  void UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = nullptr);
322 
323  // numbering and bullets
330  void NumOrBulletOn(bool bNum); // #i29560#
331  void NumOrBulletOff(); // #i29560#
332  void NumOn();
333  void BulletOn();
334 
335  //OLE
336  void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 for clipboard
337  const svt::EmbeddedObjectRef&,
338  SvGlobalName const *pName, // != 0 create object accordingly
339  sal_uInt16 nSlotId = 0); // SlotId for dialog
340 
341  bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrameFormat **pFlyFrameFormat = nullptr );
342  void LaunchOLEObj(sal_Int32 nVerb = css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY); // start server
343  virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ) override;
344  virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
345  const SwRect *pFlyPrtRect = nullptr,
346  const SwRect *pFlyFrameRect = nullptr,
347  const bool bNoTextFramePrtAreaChanged = false ) override;
348  virtual void ConnectObj( svt::EmbeddedObjectRef& xIPObj, const SwRect &rPrt,
349  const SwRect &rFrame ) override;
350 
351  // styles and formats
352 
353  // enum tells when should happen when the style was not found
354  enum GetStyle { GETSTYLE_NOCREATE, // create none
355  GETSTYLE_CREATESOME, // if on PoolId create mapt
356  GETSTYLE_CREATEANY }; // return standard if applicable
357 
358  SwTextFormatColl* GetParaStyle(const OUString &rCollName,
359  GetStyle eCreate = GETSTYLE_NOCREATE);
360  SwCharFormat* GetCharStyle(const OUString &rFormatName,
361  GetStyle eCreate = GETSTYLE_NOCREATE);
362  SwFrameFormat* GetTableStyle(std::u16string_view rFormatName);
363 
364  void SetPageStyle(const OUString &rCollName);
365 
366  OUString const & GetCurPageStyle() const;
367 
368  // change current style using the attributes in effect
369  void QuickUpdateStyle();
370 
371  enum DoType { UNDO, REDO, REPEAT };
372 
374 
375  void Do( DoType eDoType, sal_uInt16 nCnt = 1 );
376  OUString GetDoString( DoType eDoType ) const;
377  OUString GetRepeatString() const;
378  void GetDoStrings( DoType eDoType, SfxStringListItem& rStrLstItem ) const;
379 
380  // search and replace
381  sal_uLong SearchPattern(const i18nutil::SearchOptions2& rSearchOpt,
382  bool bSearchInNotes,
383  SwDocPositions eStart, SwDocPositions eEnd,
385  bool bReplace = false );
386 
387  sal_uLong SearchTempl (const OUString &rTempl,
388  SwDocPositions eStart, SwDocPositions eEnd,
390  const OUString* pReplTempl = nullptr );
391 
392  sal_uLong SearchAttr (const SfxItemSet& rFindSet,
393  bool bNoColls,
394  SwDocPositions eStart, SwDocPositions eEnd,
396  const i18nutil::SearchOptions2* pSearchOpt = nullptr,
397  const SfxItemSet* pReplaceSet = nullptr);
398 
399  void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar );
400 
401  // action ahead of cursor movement
402  // resets selection if applicable, triggers timer and GCAttr()
403  void MoveCursor( bool bWithSelect = false );
404 
405  // update input fields
406  bool StartInputFieldDlg(SwField*, bool bPrevButton, bool bNextButton, weld::Widget* pParentWin, FieldDialogPressedButton* pPressedButton = nullptr);
407  // update DropDown fields
408  bool StartDropDownFieldDlg(SwField*, bool bPrevButton, bool bNextButton, weld::Widget* pParentWin, FieldDialogPressedButton* pPressedButton = nullptr);
409 
410  //"Handler" for changes at DrawView - for controls.
411  virtual void DrawSelChanged( ) override;
412 
413  // jump to bookmark and set the "selections-flags" correctly again
414  void GotoMark( const ::sw::mark::IMark* const pMark );
415  bool GotoMark( const ::sw::mark::IMark* const pMark, bool bSelect );
416  void GotoMark( const OUString& rName );
417  bool GoNextBookmark(); // true when there still was one
418  bool GoPrevBookmark();
419 
420  bool GotoFieldmark(::sw::mark::IFieldmark const * const pMark);
421 
422  bool GotoField( const SwFormatField& rField );
423 
424  // jump to the next / previous hyperlink - inside text and also
425  // on graphics
426  void SelectNextPrevHyperlink( bool bNext );
427 
428  // determine corresponding SwView
429  const SwView& GetView() const { return m_rView; }
430  SwView& GetView() { return m_rView; }
431 
432  // Because nobody else is doing it, here is an ExecMacro()
433  void ExecMacro( const SvxMacro& rMacro, OUString* pRet = nullptr, SbxArray* pArgs = nullptr );
434  // call into the dark Basic/JavaScript
435  sal_uInt16 CallEvent( SvMacroItemId nEvent, const SwCallMouseEvent& rCallEvent,
436  bool bCheckPtr = false );
437 
438  // a click at the given field. the cursor is on it.
439  // execute the predefined actions.
440  void ClickToField( const SwField& rField );
441  void ClickToINetAttr( const SwFormatINetFormat& rItem, LoadUrlFlags nFilter = LoadUrlFlags::NONE );
442  bool ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter );
443  inline bool IsInClickToEdit() const ;
444 
445  // if a URL-Button is selected, return its URL; otherwise an empty string
446  bool GetURLFromButton( OUString& rURL, OUString& rDescr ) const;
447 
448  void NavigatorPaste( const NaviContentBookmark& rBkmk,
449  const sal_uInt16 nAction );
450 
451  virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
452  virtual void SetReadonlyOption( bool bSet ) override;
453 
454  // automatic update of styles
455  void AutoUpdateFrame(SwFrameFormat* pFormat, const SfxItemSet& rStyleSet);
456  void AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM = nullptr );
457 
458  // starts dialog for inserting ranges via Drag&Drop/Clipboard
459  void StartInsertRegionDialog(const SwSectionData&);
460 
461  // ctor, the first one is a kind of a controlled copy ctor for more views of a document
462  SwWrtShell( SwWrtShell&, vcl::Window *pWin, SwView &rShell);
463  SwWrtShell( SwDoc& rDoc, vcl::Window *pWin, SwView &rShell,
464  const SwViewOption *pViewOpt);
465  virtual ~SwWrtShell() override;
466 
467  bool TryRemoveIndent(); // #i23725#
468 
469  OUString GetSelDescr() const;
470 
471  SwNavigationMgr& GetNavigationMgr() { return m_aNavigationMgr; }
472 
473  void addCurrentPosition();
474  bool GotoFly( const OUString& rName, FlyCntType eType = FLYCNTTYPE_ALL,
475  bool bSelFrame = true );
476  bool GotoINetAttr( const SwTextINetFormat& rAttr );
478  bool GotoOutline( const OUString& rName );
479  bool GotoRegion( std::u16string_view rName );
480  bool GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType = 0,
481  sal_uInt16 nSeqNo = 0 );
482  bool GotoNextTOXBase( const OUString* pName = nullptr);
483  bool GotoTable( const OUString& rName );
484  void GotoFormatField( const SwFormatField& rField );
485  const SwRangeRedline* GotoRedline( SwRedlineTable::size_type nArrPos, bool bSelect);
486  bool GotoDrawingObject(std::u16string_view rName);
487 
488  void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning);
489  virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) override;
490 
492  void InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq);
493 
494  bool IsOutlineContentVisible(const size_t nPos);
495  void ToggleOutlineContentVisibility(SwNode* pNd, const bool bForceNotVisible = false);
496  void ToggleOutlineContentVisibility(const size_t nPos, const bool bForceNotVisible = false);
497 
498 private:
499 
500  SAL_DLLPRIVATE void OpenMark();
501  SAL_DLLPRIVATE void CloseMark( bool bOkFlag );
502 
503  struct ModeStack
504  {
506  bool bAdd,
507  bBlock,
508  bExt,
509  bIns;
510  ModeStack(ModeStack *pNextMode, bool _bIns, bool _bExt, bool _bAdd, bool _bBlock):
511  pNext(pNextMode),
512  bAdd(_bAdd),
513  bBlock(_bBlock),
514  bExt(_bExt),
515  bIns(_bIns)
516  {}
517  } *m_pModeStack = nullptr;
518 
519  // carry cursor along when PageUp / -Down
520  enum PageMove
521  {
524  MV_PAGE_DOWN
525  } m_ePageMove = MV_NO;
526 
527  struct CursorStack
528  {
529  Point aDocPos;
530  std::unique_ptr<CursorStack> pNext;
531  bool bValidCurPos : 1;
532  bool bIsFrameSel : 1;
534 
535  CursorStack( bool bValid, bool bFrameSel, const Point &rDocPos,
536  SwTwips lOff, std::unique_ptr<CursorStack> pN )
537  : aDocPos(rDocPos),
538  pNext(std::move(pN)),
539  bValidCurPos( bValid ),
540  bIsFrameSel( bFrameSel ),
541  lOffset(lOff)
542  {
543  }
544 
545  };
546  std::unique_ptr<CursorStack> m_pCursorStack;
547 
550 
551  Point m_aDest;
552  bool m_bDestOnStack = false;
553  bool HasCursorStack() const { return nullptr != m_pCursorStack; }
554  SAL_DLLPRIVATE bool PushCursor(SwTwips lOffset, bool bSelect);
555  SAL_DLLPRIVATE bool PopCursor(bool bUpdate, bool bSelect = false);
556 
557  // take END cursor along when PageUp / -Down
558  SAL_DLLPRIVATE void SttWrd();
559  SAL_DLLPRIVATE void EndWrd();
560  SAL_DLLPRIVATE bool NxtWrd_();
561  SAL_DLLPRIVATE bool PrvWrd_();
562  // #i92468#
563  SAL_DLLPRIVATE bool NxtWrdForDelete();
564  SAL_DLLPRIVATE bool PrvWrdForDelete();
565  SAL_DLLPRIVATE bool FwdSentence_();
566  SAL_DLLPRIVATE bool BwdSentence_();
567  bool FwdPara_();
568  SAL_DLLPRIVATE bool BwdPara_();
569 
570  // selections
571  bool m_bIns :1;
572  bool m_bInSelect :1;
573  bool m_bExtMode :1;
574  bool m_bAddMode :1;
575  bool m_bBlockMode :1;
576  bool m_bLayoutMode :1;
577  bool m_bSelWrd :1;
578  bool m_bSelLn :1;
579  bool m_bIsInClickToEdit:1;
580  bool m_bClearMark :1; // don't delete selection for ChartAutoPilot
581  bool m_bRetainSelection :1; // Do not remove selections
582 
583  Point m_aStart;
585 
586  // resets the cursor stack after movement by PageUp/-Down
587  SAL_DLLPRIVATE void ResetCursorStack_();
588 
590  SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false );
591 
592  SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp );
593 
594  SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp );
595  SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp );
596  SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp );
597 
598  SAL_DLLPRIVATE void ExtSelWrd(const Point *, bool bProp );
599  SAL_DLLPRIVATE void ExtSelLn(const Point *, bool bProp );
600 
601  SAL_DLLPRIVATE void BeginFrameDrag(const Point *, bool bProp );
602 
603  // after SSize/Move of a frame update; Point is destination.
604  SAL_DLLPRIVATE void UpdateLayoutFrame(const Point *, bool bProp );
605 
606  SAL_DLLPRIVATE void SttLeaveSelect();
607  SAL_DLLPRIVATE void AddLeaveSelect();
608  SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp );
609 
610  SAL_DLLPRIVATE void LeaveExtSel() { m_bSelWrd = m_bSelLn = false;}
611 
612  SAL_DLLPRIVATE bool GoStart(bool KeepArea, bool *,
613  bool bSelect, bool bDontMoveRegion = false);
614  SAL_DLLPRIVATE bool GoEnd(bool KeepArea = false, const bool * = nullptr);
615 
617  {
620  BOOKMARK_PREV
621  };
622 
623  SAL_DLLPRIVATE bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=nullptr);
624 };
625 
627 {
628  if ( HasCursorStack() )
630 }
631 
633 {
634  SetSelTableCells( true );
635  m_bClearMark = true;
636  m_aSelTableLink = rLink;
637 }
639 {
640  SetSelTableCells( false );
641  m_bClearMark = true;
642 }
643 
644 inline bool SwWrtShell::IsInClickToEdit() const { return m_bIsInClickToEdit; }
645 
647 {
648 #ifdef __GNUC__
650  return m_fnDrag == fnTmp;
651 #else
652  return m_fnDrag == &SwWrtShell::BeginDrag;
653 #endif
654 }
655 
656 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwView & GetView()
Definition: wrtsh.hxx:430
bool GotoPage(sal_uInt16 nPage)
Definition: crsrsh.cxx:1191
SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp)
Definition: select.cxx:378
bool IsInClickToEdit() const
Definition: wrtsh.hxx:644
void NxtWrd(bool bSelect=false)
Definition: wrtsh.hxx:211
bool GotoTable(const OUString &rName)
Definition: trvltbl.cxx:794
void ChgDBData(const SwDBData &SwDBData)
Definition: edfld.cxx:299
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
void EndSelTableCells()
Definition: wrtsh.hxx:638
void ResetCursorStack()
Definition: wrtsh.hxx:626
bool IsInsMode() const
Definition: wrtsh.hxx:166
bool Right(sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:351
void ToggleInsMode()
Definition: wrtsh.hxx:165
FieldDialogPressedButton
Definition: wrtsh.hxx:373
LoadUrlFlags
Definition: swurl.hxx:27
SELECTFUNC2 m_fnDrag
Definition: wrtsh.hxx:109
void InsertTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
Insert content table. Renew if required.
Definition: edtox.cxx:121
virtual void MoveObjectIfActive(svt::EmbeddedObjectRef &xObj, const Point &rOffset)
The layout has been changed, so the active object has to be moved after that.
Definition: fews.cxx:1313
bool IsSttPara() const
Definition: crsrsh.cxx:1098
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
update tables of content
Definition: edtox.cxx:149
bool IsRetainSelection() const
Definition: wrtsh.hxx:270
sal_uIntPtr sal_uLong
long Long
#define CNT_GRF
Definition: editsh.hxx:130
Base class of all fields.
Definition: fldbas.hxx:289
const SwRangeRedline * GotoRedline(SwRedlineTable::size_type nArrPos, bool bSelect)
Definition: crstrvl.cxx:2312
Definition: doc.hxx:187
virtual void CalcAndSetScale(svt::EmbeddedObjectRef &xObj, const SwRect *pFlyPrtRect=nullptr, const SwRect *pFlyFrameRect=nullptr, const bool bNoTextFramePrtAreaChanged=false)=0
Client for OleObject has to be up-to-date regarding scaling.
void AutoCorrect(SvxAutoCorrect &rACorr, bool bInsertMode, sal_Unicode cChar)
Call AutoCorrect.
Definition: edws.cxx:255
Link< SwWrtShell &, void > m_aSelTableLink
Definition: wrtsh.hxx:584
SvMacroItemId
SAL_DLLPRIVATE bool BwdPara_()
Definition: wrtsh4.cxx:219
bool Left(sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:349
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
SAL_DLLPRIVATE bool FwdSentence_()
Definition: wrtsh4.cxx:174
bool GotoMark(const ::sw::mark::IMark *const pMark)
Definition: crbm.cxx:184
bool IsStdMode() const
Definition: wrtsh.hxx:147
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2368
bool HasSelection() const
Does the current cursor create a selection?
Definition: crsrsh.cxx:2519
SwDocPositions
Definition: cshtyp.hxx:103
SwNavigationMgr & GetNavigationMgr()
Definition: wrtsh.hxx:471
Used by the UI to modify the document model.
Definition: wrtsh.hxx:91
void BeginDrag(const Point *pPt, bool bProp)
Definition: feshview.cxx:712
sal_uInt16 sal_Unicode
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: editsh.cxx:1081
const SwView & GetView() const
Definition: wrtsh.hxx:429
NONE
bool m_bIsInClickToEdit
Definition: wrtsh.hxx:579
bool Down(sal_uInt16 nCnt=1)
Definition: crsrsh.hxx:354
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
Definition: txatbase.hxx:41
void BwdPara()
Definition: wrtsh.hxx:230
FindRanges
Definition: cshtyp.hxx:90
bool PrvWrd(bool bSelect=false)
Definition: wrtsh.hxx:212
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
Definition: crsrsh.cxx:764
bool IsBlockMode() const
Definition: wrtsh.hxx:162
bool GotoRegion(std::u16string_view rName)
Definition: trvlreg.cxx:270
bool GotoFly(const OUString &rName, FlyCntType eType, bool bSelFrame)
Jump to named Fly (graphic/OLE).
Definition: feshview.cxx:2507
SwNavigationMgr m_aNavigationMgr
Definition: wrtsh.hxx:549
virtual void ConnectObj(svt::EmbeddedObjectRef &, const SwRect &rPrt, const SwRect &rFrame)=0
Connect objects with ActivateWhenVisible at Paint.
void SetInSelect()
Definition: wrtsh.hxx:140
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool LeftMargin()
Definition: crsrsh.hxx:355
sal_uInt16 char * pName
Style of a layout element.
Definition: frmfmt.hxx:58
bool HasSelection() const
Definition: wrtsh.hxx:142
std::unique_ptr< CursorStack > m_pCursorStack
Definition: wrtsh.hxx:546
bool Up(sal_uInt16 nCnt=1)
Definition: crsrsh.hxx:353
virtual void DrawSelChanged()
Definition: viewsh.cxx:2089
void SetRetainSelection(bool bRet)
Definition: wrtsh.hxx:271
FlyCntType
Definition: flyenum.hxx:23
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow)
Definition: viewsh.cxx:95
void BwdSentence(bool bSelect=false)
Definition: wrtsh.hxx:234
SAL_DLLPRIVATE bool BwdSentence_()
Definition: wrtsh4.cxx:191
vector_type::size_type size_type
Definition: docary.hxx:228
bool GotoFieldmark(const ::sw::mark::IFieldmark *const pMark)
Definition: crbm.cxx:302
bool GotoINetAttr(const SwTextINetFormat &rAttr)
Definition: crstrvl.cxx:2002
bool RightMargin(bool bAPI=false)
Definition: crsrsh.hxx:356
bool GotoNextTOXBase(const OUString *=nullptr)
jump to the next index
Definition: crstrvl.cxx:264
bool GoNextBookmark()
Definition: crbm.cxx:200
#define CNT_OLE
Definition: editsh.hxx:131
bool IsSttOfPara() const
Definition: wrtsh.hxx:190
bool SelectTextAttr(sal_uInt16 nWhich, bool bExpand, const SwTextAttr *pAttr=nullptr)
Definition: crstrvl.cxx:1973
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
void Insert(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:821
bool IsInSelect() const
Definition: wrtsh.hxx:139
#define CNT_TXT
Definition: editsh.hxx:129
Point m_aStart
Definition: wrtsh.hxx:583
void FwdSentence(bool bSelect=false)
Definition: wrtsh.hxx:232
tools::Long SwTwips
Definition: swtypes.hxx:49
bool HasCursorStack() const
Definition: wrtsh.hxx:553
SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp)
Definition: select.cxx:809
void Drag(const Point *pPt, bool bProp)
Definition: wrtsh.hxx:119
tools::Long CallSetCursor(const Point *pPt, bool bProp)
Definition: wrtsh.hxx:118
SelectionType
Definition: wrtsh.hxx:59
SwTextFormatColl * GetParaStyle(SwDoc &rDoc, const OUString &rName)
Get a Paragraph Style which fits a given name.
void EndDrag(const Point *pPt, bool bProp)
Definition: wrtsh.hxx:120
SwFlyFrameFormat * InsertObject(const svt::EmbeddedObjectRef &, SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:904
CursorStack(bool bValid, bool bFrameSel, const Point &rDocPos, SwTwips lOff, std::unique_ptr< CursorStack > pN)
Definition: wrtsh.hxx:535
FrameControlType
Definition: swtypes.hxx:238
bool Is_FnDragEQBeginDrag() const
Definition: wrtsh.hxx:646
bool IsMultiSelection() const
Definition: crsrsh.hxx:884
SwView & m_rView
Definition: wrtsh.hxx:548
const short REDO
bool IsEndOfPara() const
Definition: wrtsh.hxx:191
bool IsModePushed() const
Definition: wrtsh.hxx:133
Point m_aDest
Definition: wrtsh.hxx:551
size_t IsObjSelected() const
Definition: feshview.cxx:1149
tools::Long KillSelection(const Point *pPt, bool bProp)
Definition: wrtsh.hxx:121
SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp)
Definition: select.cxx:779
bool IsExtMode() const
Definition: wrtsh.hxx:152
bool GoPrevBookmark()
Definition: crbm.cxx:233
Find "one" only in body text.
void GetCurPageStyle(SwPaM const &rPaM, OUString &rString)
void SetSelTableCells(bool bFlag)
Definition: crsrsh.hxx:799
void Insert(sal_Unicode, bool bOnlyCurrCursor=false)
Edit (all selected ranges).
Definition: editsh.cxx:63
SAL_DLLPRIVATE bool NxtWrd_()
Definition: wrtsh4.cxx:65
RndStdIds
bool IsExtSel() const
Definition: wrtsh.hxx:182
bool IsAddMode() const
Definition: wrtsh.hxx:157
bool FwdPara_()
Definition: wrtsh4.cxx:208
SAL_DLLPRIVATE bool PrvWrd_()
Definition: wrtsh4.cxx:96
bool IsEndPara() const
Definition: crsrsh.cxx:1117
void SplitNode(bool bAutoFormat=false, bool bCheckTableStart=true)
Definition: editsh.cxx:183
bool Pop(PopMode)
delete cursor
Definition: crsrsh.cxx:2263
std::vector< SwNode * >::size_type size_type
SwCharFormat * GetCharStyle(SwDoc &rDoc, const OUString &rName)
Get a Character Style which fits a given name.
bool GotoOutline(const OUString &rName)
Definition: crstrvl.cxx:984
bool FwdPara()
Definition: wrtsh.hxx:228
void(SwWrtShell::* SELECTFUNC2)(const Point *, bool bProp)
Definition: wrtsh.hxx:107
bool GotoFormatField(const SwFormatField &rField)
Definition: crstrvl.cxx:830
ModeStack(ModeStack *pNextMode, bool _bIns, bool _bExt, bool _bAdd, bool _bBlock)
Definition: wrtsh.hxx:510
std::unique_ptr< CursorStack > pNext
Definition: wrtsh.hxx:530
bool m_bClearMark
Definition: wrtsh.hxx:580
Definition: view.hxx:144
bool GotoRefMark(const OUString &rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo)
jump to reference marker
Definition: crstrvl.cxx:1221
bool IsSelFrameMode() const
Definition: wrtsh.hxx:171
const short REPEAT
SAL_DLLPRIVATE void LeaveExtSel()
Definition: wrtsh.hxx:610
SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false)
Definition: select.cxx:303
void SelTableCells(const Link< SwWrtShell &, void > &rLink)
Definition: wrtsh.hxx:632
ModeStack * pNext
Definition: wrtsh.hxx:505
SAL_DLLPRIVATE void ResetCursorStack_()
Definition: move.cxx:533
Base class of the Writer document model elements.
Definition: node.hxx:80
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo