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