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