nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / inc / wrtsh.hxx
bloba8cc9a49d6cb5ab9f6d2615f007fd9424701a1b5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <swdllapi.h>
23 #include <fesh.hxx>
24 #include <swurl.hxx>
25 #include <IMark.hxx>
26 #include "navmgr.hxx"
27 #include <optional>
28 #include <o3tl/typed_flags_set.hxx>
29 #include <svx/swframetypes.hxx>
30 #include <vcl/weld.hxx>
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;
47 class NaviContentBookmark;
48 struct SwCallMouseEvent;
49 class SfxStringListItem;
50 enum class SvMacroItemId : sal_uInt16;
51 class SwFieldMgr;
52 class SfxRequest;
54 namespace i18nutil {
55 struct SearchOptions2;
58 enum class SelectionType : sal_Int32
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,
81 namespace o3tl {
82 template<> struct typed_flags<SelectionType> : is_typed_flags<SelectionType, 0x0ffff3> {};
85 /** Used by the UI to modify the document model.
87 Eg. the Insert() method will take the current cursor position, insert the
88 string, and take care of undo etc.
90 class SW_DLLPUBLIC SwWrtShell: public SwFEShell
92 private:
93 using SwCursorShell::Left;
94 using SwCursorShell::Right;
95 using SwCursorShell::Up;
96 using SwCursorShell::Down;
97 using SwCursorShell::LeftMargin;
98 using SwCursorShell::RightMargin;
99 using SwCursorShell::SelectTextAttr;
100 using SwCursorShell::GotoPage;
101 using SwFEShell::InsertObject;
102 using SwEditShell::AutoCorrect;
103 using SwCursorShell::GotoMark;
105 typedef tools::Long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp );
106 typedef void (SwWrtShell::*SELECTFUNC2)(const Point *, bool bProp );
108 SELECTFUNC2 m_fnDrag = &SwWrtShell::BeginDrag;
109 SELECTFUNC m_fnSetCursor = &SwWrtShell::SetCursor;
110 SELECTFUNC2 m_fnEndDrag = &SwWrtShell::DefaultEndDrag;
111 SELECTFUNC m_fnKillSel = &SwWrtShell::Ignore;
113 public:
115 using SwEditShell::Insert;
117 tools::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 tools::Long KillSelection(const Point* pPt, bool bProp) { return (this->*m_fnKillSel)(pPt, bProp); }
122 bool IsSplitVerticalByDefault() const;
123 void SetSplitVerticalByDefault(bool value);
125 // reset all selections
126 tools::Long ResetSelect( const Point *, bool );
128 // resets the cursorstack after movement with PageUp/-Down if a stack is built up
129 inline void ResetCursorStack();
130 SelectionType GetSelectionType() const;
132 bool IsModePushed() const { return nullptr != m_pModeStack; }
133 void PushMode();
134 void PopMode();
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(); }
143 bool Pop(SwCursorShell::PopMode = SwCursorShell::PopMode::DeleteStack);
145 void EnterStdMode();
146 bool IsStdMode() const { return !m_bExtMode && !m_bAddMode && !m_bBlockMode; }
148 void EnterExtMode();
149 void LeaveExtMode();
150 bool ToggleExtMode();
151 bool IsExtMode() const { return m_bExtMode; }
153 void EnterAddMode();
154 void LeaveAddMode();
155 void ToggleAddMode();
156 bool IsAddMode() const { return m_bAddMode; }
158 void EnterBlockMode();
159 void LeaveBlockMode();
160 bool ToggleBlockMode();
161 bool IsBlockMode() const { return m_bBlockMode; }
163 void SetInsMode( bool bOn = true );
164 void ToggleInsMode() { SetInsMode( !m_bIns ); }
165 bool IsInsMode() const { return m_bIns; }
166 void SetRedlineFlagsAndCheckInsMode( RedlineFlags eMode );
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();
174 void Invalidate();
176 // select table cells for editing of formulas in the ribbonbar
177 inline void SelTableCells( const Link<SwWrtShell&,void> &rLink );
178 inline void EndSelTableCells();
180 // leave per word or per line selection mode. Is usually called in MB-Up.
181 bool IsExtSel() const { return m_bSelWrd || m_bSelLn; }
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;
187 // base requests
188 bool IsEndWrd();
189 bool IsSttOfPara() const { return IsSttPara(); }
190 bool IsEndOfPara() const { return IsEndPara(); }
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();
200 // basecursortravelling
201 typedef bool (SwWrtShell::*FNSimpleMove)();
202 bool SimpleMove( FNSimpleMove, bool bSelect );
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 ); }
213 bool LeftMargin ( bool bSelect, bool bBasicCall );
214 bool RightMargin( bool bSelect, bool bBasicCall );
216 bool StartOfSection( bool bSelect = false );
217 bool EndOfSection ( bool bSelect = false );
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 ); }
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();
242 bool SelectTextAttr( sal_uInt16 nWhich, const SwTextAttr* pAttr = nullptr );
244 // per column jumps
245 void StartOfColumn ();
246 void EndOfColumn ();
247 void StartOfNextColumn ();
248 void EndOfNextColumn ();
249 void StartOfPrevColumn ();
250 void EndOfPrevColumn ();
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 );
258 // setting the cursor; remember the old position for turning back
259 DECL_LINK( ExecFlyMac, const SwFlyFrameFormat*, void );
261 bool PageCursor(SwTwips lOffset, bool bSelect);
263 // update fields
264 void UpdateInputFields( SwInputFieldList* pLst = nullptr );
266 void NoEdit(bool bHideCursor = true);
267 void Edit();
269 bool IsRetainSelection() const { return m_bRetainSelection; }
270 void SetRetainSelection( bool bRet ) { m_bRetainSelection = bRet; }
272 // change current data base and notify
273 void ChgDBData(const SwDBData& SwDBData);
275 // delete
276 void DelToEndOfLine();
277 void DelToStartOfLine();
278 void DelLine();
279 bool DelLeft();
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();
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
300 int IntelligentCut(SelectionType nSelectionType, bool bCut = true);
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);
310 void InsertByWord( const OUString & );
311 void InsertPageBreak(const OUString *pPageDesc = nullptr, const ::std::optional<sal_uInt16>& rPgNum = std::nullopt);
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();
318 // indexes
319 void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = nullptr);
320 void UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = nullptr);
322 // numbering and bullets
324 Turns on numbering or bullets.
326 @param bNum true: turn on numbering
327 false: turn on bullets
329 void NumOrBulletOn(bool bNum); // #i29560#
330 void NumOrBulletOff(); // #i29560#
331 void NumOn();
332 void BulletOn();
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
340 bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrameFormat **pFlyFrameFormat = nullptr );
341 void LaunchOLEObj( tools::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;
350 // styles and formats
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
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);
363 void SetPageStyle(const OUString &rCollName);
365 OUString const & GetCurPageStyle() const;
367 // change current style using the attributes in effect
368 void QuickUpdateStyle();
370 enum DoType { UNDO, REDO, REPEAT };
372 enum class FieldDialogPressedButton { NONE, Previous, Next };
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;
379 // search and replace
380 sal_uLong SearchPattern(const i18nutil::SearchOptions2& rSearchOpt,
381 bool bSearchInNotes,
382 SwDocPositions eStart, SwDocPositions eEnd,
383 FindRanges eFlags = FindRanges::InBody,
384 bool bReplace = false );
386 sal_uLong SearchTempl (const OUString &rTempl,
387 SwDocPositions eStart, SwDocPositions eEnd,
388 FindRanges eFlags = FindRanges::InBody,
389 const OUString* pReplTempl = nullptr );
391 sal_uLong SearchAttr (const SfxItemSet& rFindSet,
392 bool bNoColls,
393 SwDocPositions eStart, SwDocPositions eEnd,
394 FindRanges eFlags = FindRanges::InBody,
395 const i18nutil::SearchOptions2* pSearchOpt = nullptr,
396 const SfxItemSet* pReplaceSet = nullptr);
398 void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar );
400 // action ahead of cursor movement
401 // resets selection if applicable, triggers timer and GCAttr()
402 void MoveCursor( bool bWithSelect = false );
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);
409 //"Handler" for changes at DrawView - for controls.
410 virtual void DrawSelChanged( ) override;
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();
419 bool GotoFieldmark(::sw::mark::IFieldmark const * const pMark);
421 bool GotoField( const SwFormatField& rField );
423 // jump to the next / previous hyperlink - inside text and also
424 // on graphics
425 void SelectNextPrevHyperlink( bool bNext );
427 // determine corresponding SwView
428 const SwView& GetView() const { return m_rView; }
429 SwView& GetView() { return m_rView; }
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 );
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 ;
444 // if a URL-Button is selected, return its URL; otherwise an empty string
445 bool GetURLFromButton( OUString& rURL, OUString& rDescr ) const;
447 void NavigatorPaste( const NaviContentBookmark& rBkmk,
448 const sal_uInt16 nAction );
450 virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
451 virtual void SetReadonlyOption( bool bSet ) override;
453 // automatic update of styles
454 void AutoUpdateFrame(SwFrameFormat* pFormat, const SfxItemSet& rStyleSet);
455 void AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM = nullptr );
457 // starts dialog for inserting ranges via Drag&Drop/Clipboard
458 void StartInsertRegionDialog(const SwSectionData&);
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;
466 bool TryRemoveIndent(); // #i23725#
468 OUString GetSelDescr() const;
470 SwNavigationMgr& GetNavigationMgr() { return m_aNavigationMgr; }
472 void addCurrentPosition();
473 bool GotoFly( const OUString& rName, FlyCntType eType = FLYCNTTYPE_ALL,
474 bool bSelFrame = true );
475 bool GotoINetAttr( const SwTextINetFormat& rAttr );
476 void GotoOutline( SwOutlineNodes::size_type nIdx );
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);
486 void ChangeHeaderOrFooter(const OUString& rStyleName, bool bHeader, bool bOn, bool bShowWarning);
487 virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) override;
489 /// Inserts a new annotation/comment at the current cursor position / selection.
490 void InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq);
492 bool IsOutlineContentFolded(const size_t nPos);
493 void ToggleOutlineContentVisibility(SwNode* pNd, bool bForceFold = false);
494 void ToggleOutlineContentVisibility(const size_t nPos, bool bForceFold = false);
496 private:
498 SAL_DLLPRIVATE void OpenMark();
499 SAL_DLLPRIVATE void CloseMark( bool bOkFlag );
501 struct ModeStack
503 ModeStack *pNext;
504 bool bAdd,
505 bBlock,
506 bExt,
507 bIns;
508 ModeStack(ModeStack *pNextMode, bool _bIns, bool _bExt, bool _bAdd, bool _bBlock):
509 pNext(pNextMode),
510 bAdd(_bAdd),
511 bBlock(_bBlock),
512 bExt(_bExt),
513 bIns(_bIns)
515 } *m_pModeStack = nullptr;
517 // carry cursor along when PageUp / -Down
518 enum PageMove
520 MV_NO,
521 MV_PAGE_UP,
522 MV_PAGE_DOWN
523 } m_ePageMove = MV_NO;
525 struct CursorStack
527 Point aDocPos;
528 std::unique_ptr<CursorStack> pNext;
529 bool bValidCurPos : 1;
530 bool bIsFrameSel : 1;
531 SwTwips lOffset;
533 CursorStack( bool bValid, bool bFrameSel, const Point &rDocPos,
534 SwTwips lOff, std::unique_ptr<CursorStack> pN )
535 : aDocPos(rDocPos),
536 pNext(std::move(pN)),
537 bValidCurPos( bValid ),
538 bIsFrameSel( bFrameSel ),
539 lOffset(lOff)
544 std::unique_ptr<CursorStack> m_pCursorStack;
546 SwView &m_rView;
547 SwNavigationMgr m_aNavigationMgr;
549 Point m_aDest;
550 bool m_bDestOnStack = false;
551 bool HasCursorStack() const { return nullptr != m_pCursorStack; }
552 SAL_DLLPRIVATE bool PushCursor(SwTwips lOffset, bool bSelect);
553 SAL_DLLPRIVATE bool PopCursor(bool bUpdate, bool bSelect = false);
555 // take END cursor along when PageUp / -Down
556 SAL_DLLPRIVATE void SttWrd();
557 SAL_DLLPRIVATE void EndWrd();
558 SAL_DLLPRIVATE bool NxtWrd_();
559 SAL_DLLPRIVATE bool PrvWrd_();
560 // #i92468#
561 SAL_DLLPRIVATE bool NxtWrdForDelete();
562 SAL_DLLPRIVATE bool PrvWrdForDelete();
563 SAL_DLLPRIVATE bool FwdSentence_();
564 SAL_DLLPRIVATE bool BwdSentence_();
565 bool FwdPara_();
566 SAL_DLLPRIVATE bool BwdPara_();
568 // selections
569 bool m_bIns :1;
570 bool m_bInSelect :1;
571 bool m_bExtMode :1;
572 bool m_bAddMode :1;
573 bool m_bBlockMode :1;
574 bool m_bLayoutMode :1;
575 bool m_bSelWrd :1;
576 bool m_bSelLn :1;
577 bool m_bIsInClickToEdit:1;
578 bool m_bClearMark :1; // don't delete selection for ChartAutoPilot
579 bool m_bRetainSelection :1; // Do not remove selections
581 Point m_aStart;
582 Link<SwWrtShell&,void> m_aSelTableLink;
584 // resets the cursor stack after movement by PageUp/-Down
585 SAL_DLLPRIVATE void ResetCursorStack_();
587 using SwCursorShell::SetCursor;
588 SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false );
590 SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp );
592 SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp );
593 SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp );
594 SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp );
596 SAL_DLLPRIVATE void ExtSelWrd(const Point *, bool bProp );
597 SAL_DLLPRIVATE void ExtSelLn(const Point *, bool bProp );
599 SAL_DLLPRIVATE void BeginFrameDrag(const Point *, bool bProp );
601 // after SSize/Move of a frame update; Point is destination.
602 SAL_DLLPRIVATE void UpdateLayoutFrame(const Point *, bool bProp );
604 SAL_DLLPRIVATE void SttLeaveSelect();
605 SAL_DLLPRIVATE void AddLeaveSelect();
606 SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp );
608 SAL_DLLPRIVATE void LeaveExtSel() { m_bSelWrd = m_bSelLn = false;}
610 SAL_DLLPRIVATE bool GoStart(bool KeepArea, bool *,
611 bool bSelect, bool bDontMoveRegion = false);
612 SAL_DLLPRIVATE bool GoEnd(bool KeepArea = false, const bool * = nullptr);
614 enum BookMarkMove
616 BOOKMARK_INDEX,
617 BOOKMARK_NEXT,
618 BOOKMARK_PREV
621 SAL_DLLPRIVATE bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=nullptr);
624 inline void SwWrtShell::ResetCursorStack()
626 if ( HasCursorStack() )
627 ResetCursorStack_();
630 inline void SwWrtShell::SelTableCells(const Link<SwWrtShell&,void> &rLink )
632 SetSelTableCells( true );
633 m_bClearMark = true;
634 m_aSelTableLink = rLink;
636 inline void SwWrtShell::EndSelTableCells()
638 SetSelTableCells( false );
639 m_bClearMark = true;
642 inline bool SwWrtShell::IsInClickToEdit() const { return m_bIsInClickToEdit; }
644 inline bool SwWrtShell::Is_FnDragEQBeginDrag() const
646 #ifdef __GNUC__
647 SELECTFUNC2 fnTmp = &SwWrtShell::BeginDrag;
648 return m_fnDrag == fnTmp;
649 #else
650 return m_fnDrag == &SwWrtShell::BeginDrag;
651 #endif
654 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */