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