1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
28 #include <com/sun/star/embed/EmbedVerbs.hpp>
29 #include <o3tl/typed_flags_set.hxx>
30 #include <svx/swframetypes.hxx>
31 #include <vcl/weld.hxx>
35 #include <viewopt.hxx>
37 namespace vcl
{ class Window
; }
39 class SwFlyFrameAttrMgr
;
44 class SwInputFieldList
;
48 class SwFormatINetFormat
;
50 class NaviContentBookmark
;
51 struct SwCallMouseEvent
;
52 class SfxStringListItem
;
53 enum class SvMacroItemId
: sal_uInt16
;
56 enum class SwLineBreakClear
;
57 class SwContentControl
;
58 enum class SwContentControlType
;
61 struct SearchOptions2
;
64 enum class SelectionType
: sal_Int32
67 Text
= CNT_TXT
, // text, never frames too 0x0001
68 Graphic
= CNT_GRF
, // graphic 0x0002
69 Ole
= CNT_OLE
, // OLE 0x0010
70 Frame
= 0x000020, // frame, no content type
71 NumberList
= 0x000040, // NumList
72 Table
= 0x000080, // cursor is in table
73 TableCell
= 0x000100, // table cells are selected
74 DrawObject
= 0x000200, // drawing objects (rectangle, circle...)
75 DrawObjectEditMode
= 0x000400, // draw-textobjects in edit mode
76 Ornament
= 0x000800, // edit ornament objects
77 DbForm
= 0x001000, // drawing objects: DB-Forms
78 FormControl
= 0x002000, // a form control is focused. Neither set nor evaluated by the SwWrtShell itself, only by its clients.
79 Media
= 0x004000, // Media object
80 ExtrudedCustomShape
= 0x008000, // extruded custom shape
81 FontWork
= 0x010000, // fontwork
82 PostIt
= 0x020000, // annotation
83 TableRow
= 0x040000, // table rows are selected
84 TableCol
= 0x080000, // table columns are selected
88 template<> struct typed_flags
<SelectionType
> : is_typed_flags
<SelectionType
, 0x0ffff3> {};
91 /** Used by the UI to modify the document model.
93 Eg. the Insert() method will take the current cursor position, insert the
94 string, and take care of undo etc.
96 class SW_DLLPUBLIC SwWrtShell final
: public SwFEShell
99 using SwCursorShell::Left
;
100 using SwCursorShell::Right
;
101 using SwCursorShell::Up
;
102 using SwCursorShell::Down
;
103 using SwCursorShell::LeftMargin
;
104 using SwCursorShell::RightMargin
;
105 using SwCursorShell::SelectTextAttr
;
106 using SwCursorShell::GotoPage
;
107 using SwFEShell::InsertObject
;
108 using SwEditShell::AutoCorrect
;
109 using SwCursorShell::GotoMark
;
111 typedef tools::Long (SwWrtShell::*SELECTFUNC
)(const Point
*, bool bProp
);
112 typedef void (SwWrtShell::*SELECTFUNC2
)(const Point
*, bool bProp
);
114 SELECTFUNC2 m_fnDrag
= &SwWrtShell::BeginDrag
;
115 SELECTFUNC m_fnSetCursor
= &SwWrtShell::SetCursor
;
116 SELECTFUNC2 m_fnEndDrag
= &SwWrtShell::DefaultEndDrag
;
117 SELECTFUNC m_fnKillSel
= &SwWrtShell::Ignore
;
120 using SwCursorShell::GotoFootnoteAnchor
;
121 using SwEditShell::Insert
;
123 tools::Long
CallSetCursor(const Point
* pPt
, bool bProp
) { return (this->*m_fnSetCursor
)(pPt
, bProp
); }
124 void Drag (const Point
* pPt
, bool bProp
) { (this->*m_fnDrag
)(pPt
, bProp
); }
125 void EndDrag (const Point
* pPt
, bool bProp
) { (this->*m_fnEndDrag
)(pPt
, bProp
); }
126 tools::Long
KillSelection(const Point
* pPt
, bool bProp
) { return (this->*m_fnKillSel
)(pPt
, bProp
); }
128 bool IsSplitVerticalByDefault() const;
129 void SetSplitVerticalByDefault(bool value
);
131 // reset all selections
132 tools::Long
ResetSelect( const Point
*, bool );
134 // resets the cursorstack after movement with PageUp/-Down if a stack is built up
135 inline void ResetCursorStack();
136 SelectionType
GetSelectionType() const;
138 bool IsModePushed() const { return nullptr != m_pModeStack
; }
144 bool IsInSelect() const { return m_bInSelect
; }
145 void SetInSelect() { m_bInSelect
= true; }
146 // is there a text- or frameselection?
147 bool HasSelection() const { return SwCursorShell::HasSelection() ||
148 IsMultiSelection() || IsSelFrameMode() || IsObjSelected(); }
149 bool Pop(SwCursorShell::PopMode
, ::std::optional
<SwCallLink
>& roLink
);
150 bool Pop(SwCursorShell::PopMode
= SwCursorShell::PopMode::DeleteStack
);
153 bool IsStdMode() const { return !m_bExtMode
&& !m_bAddMode
&& !m_bBlockMode
; }
157 void ToggleExtMode();
158 bool IsExtMode() const { return m_bExtMode
; }
162 void ToggleAddMode();
163 bool IsAddMode() const { return m_bAddMode
; }
165 void EnterBlockMode();
166 void LeaveBlockMode();
167 void ToggleBlockMode();
168 bool IsBlockMode() const { return m_bBlockMode
; }
170 void SetInsMode( bool bOn
= true );
171 void ToggleInsMode() { SetInsMode( !m_bIns
); }
172 bool IsInsMode() const { return m_bIns
; }
173 void SetRedlineFlagsAndCheckInsMode( RedlineFlags eMode
);
175 void EnterSelFrameMode(const Point
*pStartDrag
= nullptr);
176 void LeaveSelFrameMode();
177 bool IsSelFrameMode() const { return m_bLayoutMode
; }
178 // reset selection of frames
179 void UnSelectFrame();
183 // select table cells for editing of formulas in the ribbonbar
184 inline void SelTableCells( const Link
<SwWrtShell
&,void> &rLink
);
185 inline void EndSelTableCells();
187 // leave per word or per line selection mode. Is usually called in MB-Up.
188 bool IsExtSel() const { return m_bSelWrd
|| m_bSelLn
; }
190 // query whether the active m_fnDrag pointer is set to BeginDrag
191 // is needed for MouseMove to work around bugs 55592/55931
192 inline bool Is_FnDragEQBeginDrag() const;
196 bool IsSttOfPara() const { return IsSttPara(); }
197 bool IsEndOfPara() const { return IsEndPara(); }
199 // select word / sentence
200 bool SelNearestWrd();
201 bool SelWrd (const Point
* = nullptr );
202 // #i32329# Enhanced selection
203 void SelSentence (const Point
*);
204 void SelPara (const Point
*);
207 // basecursortravelling
208 typedef bool (SwWrtShell::*FNSimpleMove
)();
209 bool SimpleMove( FNSimpleMove
, bool bSelect
);
211 bool Left ( SwCursorSkipMode nMode
, bool bSelect
,
212 sal_uInt16 nCount
, bool bBasicCall
, bool bVisual
= false );
213 bool Right ( SwCursorSkipMode nMode
, bool bSelect
,
214 sal_uInt16 nCount
, bool bBasicCall
, bool bVisual
= false );
215 bool Up ( bool bSelect
, sal_uInt16 nCount
= 1, bool bBasicCall
= false );
216 bool Down ( bool bSelect
, sal_uInt16 nCount
= 1, bool bBasicCall
= false );
217 void NxtWrd ( bool bSelect
= false ) { SimpleMove( &SwWrtShell::NxtWrd_
, bSelect
); }
218 bool PrvWrd ( bool bSelect
= false ) { return SimpleMove( &SwWrtShell::PrvWrd_
, bSelect
); }
220 bool LeftMargin ( bool bSelect
, bool bBasicCall
);
221 bool RightMargin( bool bSelect
, bool bBasicCall
);
223 bool StartOfSection( bool bSelect
= false );
224 bool EndOfSection ( bool bSelect
= false );
226 bool SttNxtPg ( bool bSelect
= false );
227 void SttPrvPg ( bool bSelect
= false );
228 void EndNxtPg ( bool bSelect
= false );
229 bool EndPrvPg ( bool bSelect
= false );
230 bool SttPg ( bool bSelect
= false );
231 bool EndPg ( bool bSelect
= false );
232 bool SttPara ( bool bSelect
= false );
233 void EndPara ( bool bSelect
= false );
235 { return SimpleMove( &SwWrtShell::FwdPara_
, false/*bSelect*/ ); }
237 { SimpleMove( &SwWrtShell::BwdPara_
, false/*bSelect*/ ); }
238 void FwdSentence( bool bSelect
= false )
239 { SimpleMove( &SwWrtShell::FwdSentence_
, bSelect
); }
240 void BwdSentence( bool bSelect
= false )
241 { SimpleMove( &SwWrtShell::BwdSentence_
, bSelect
); }
243 // #i20126# Enhanced table selection
244 bool SelectTableRowCol( const Point
& rPt
, const Point
* pEnd
= nullptr, bool bRowDrag
= false );
245 void SelectTableRow();
246 void SelectTableCol();
247 void SelectTableCell();
249 bool SelectTextAttr( sal_uInt16 nWhich
, const SwTextAttr
* pAttr
= nullptr );
252 void StartOfColumn ();
254 void StartOfNextColumn ();
255 void EndOfNextColumn ();
256 void StartOfPrevColumn ();
257 void EndOfPrevColumn ();
259 // set the cursor to page "nPage" at the beginning
260 // additionally to an identically named implementation in crsrsh.hxx
261 // here all existing selections are being reset before setting the
263 bool GotoPage( sal_uInt16 nPage
, bool bRecord
);
265 // setting the cursor; remember the old position for turning back
266 DECL_DLLPRIVATE_LINK( ExecFlyMac
, const SwFlyFrameFormat
*, void );
268 bool PageCursor(SwTwips lOffset
, bool bSelect
);
271 void UpdateInputFields( SwInputFieldList
* pLst
= nullptr );
273 void NoEdit(bool bHideCursor
= true);
276 bool IsRetainSelection() const { return m_bRetainSelection
; }
277 void SetRetainSelection( bool bRet
) { m_bRetainSelection
= bRet
; }
279 // change current data base and notify
280 void ChgDBData(const SwDBData
& SwDBData
);
283 void DelToEndOfLine();
284 void DelToStartOfLine();
288 // also deletes the frame or sets the cursor in the frame when bDelFrame == false
289 bool DelRight(bool isReplaceHeuristic
= false);
290 void DelToEndOfPara();
291 void DelToStartOfPara();
292 bool DelToEndOfSentence();
293 void DelToStartOfSentence();
297 // checks whether a word selection exists.
298 // According to the rules for intelligent Cut / Paste
299 // surrounding spaces are cut out.
300 // returns type of word selection (see enum)
303 WORD_SPACE_BEFORE
= 1,
304 WORD_SPACE_AFTER
= 2,
307 int IntelligentCut(SelectionType nSelectionType
, bool bCut
= true);
310 bool InsertField2(SwField
const &, SwPaM
* pAnnotationRange
= nullptr);
311 void Insert(const OUString
&);
313 void InsertGraphic( const OUString
&rPath
, const OUString
&rFilter
,
314 const Graphic
&, SwFlyFrameAttrMgr
* = nullptr,
315 RndStdIds nAnchorType
= RndStdIds::FLY_AT_PARA
);
317 void InsertByWord( const OUString
& );
318 void InsertPageBreak(const OUString
*pPageDesc
= nullptr, const ::std::optional
<sal_uInt16
>& rPgNum
= std::nullopt
);
319 void InsertLineBreak(std::optional
<SwLineBreakClear
> oClear
= std::nullopt
);
320 void InsertColumnBreak();
321 void InsertContentControl(SwContentControlType eType
);
322 void InsertFootnote(const OUString
&, bool bEndNote
= false, bool bEdit
= true );
323 void SplitNode( bool bAutoFormat
= false );
327 void InsertTableOf(const SwTOXBase
& rTOX
, const SfxItemSet
* pSet
= nullptr);
328 void UpdateTableOf(const SwTOXBase
& rTOX
, const SfxItemSet
* pSet
= nullptr);
330 // numbering and bullets
332 Turns on numbering or bullets.
334 @param bNum true: turn on numbering
335 false: turn on bullets
337 void NumOrBulletOn(bool bNum
); // #i29560#
338 void NumOrBulletOff(); // #i29560#
343 void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 for clipboard
344 const svt::EmbeddedObjectRef
&,
345 SvGlobalName
const *pName
, // != 0 create object accordingly
346 sal_uInt16 nSlotId
= 0); // SlotId for dialog
348 bool InsertOleObject( const svt::EmbeddedObjectRef
& xObj
, SwFlyFrameFormat
**pFlyFrameFormat
= nullptr );
349 void LaunchOLEObj(sal_Int32 nVerb
= css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY
); // start server
350 virtual void MoveObjectIfActive( svt::EmbeddedObjectRef
& xObj
, const Point
& rOffset
) override
;
351 virtual void CalcAndSetScale( svt::EmbeddedObjectRef
& xObj
,
352 const SwRect
*pFlyPrtRect
= nullptr,
353 const SwRect
*pFlyFrameRect
= nullptr,
354 const bool bNoTextFramePrtAreaChanged
= false ) override
;
355 virtual void ConnectObj( svt::EmbeddedObjectRef
& xIPObj
, const SwRect
&rPrt
,
356 const SwRect
&rFrame
) override
;
358 // styles and formats
360 // enum tells when should happen when the style was not found
361 enum GetStyle
{ GETSTYLE_NOCREATE
, // create none
362 GETSTYLE_CREATESOME
, // if on PoolId create mapt
363 GETSTYLE_CREATEANY
}; // return standard if applicable
365 SwTextFormatColl
* GetParaStyle(const OUString
&rCollName
,
366 GetStyle eCreate
= GETSTYLE_NOCREATE
);
367 SwCharFormat
* GetCharStyle(const OUString
&rFormatName
,
368 GetStyle eCreate
= GETSTYLE_NOCREATE
);
369 SwFrameFormat
* GetTableStyle(std::u16string_view rFormatName
);
371 void SetPageStyle(const OUString
&rCollName
);
373 OUString
const & GetCurPageStyle() const;
375 // change current style using the attributes in effect
376 void QuickUpdateStyle();
378 enum DoType
{ UNDO
, REDO
, REPEAT
};
380 enum class FieldDialogPressedButton
{ NONE
, Previous
, Next
};
382 void Do(DoType eDoType
, sal_uInt16 nCnt
= 1, sal_uInt16 nOffset
= 0);
383 OUString
GetDoString( DoType eDoType
) const;
384 OUString
GetRepeatString() const;
385 void GetDoStrings( DoType eDoType
, SfxStringListItem
& rStrLstItem
) const;
387 // search and replace
388 sal_Int32
SearchPattern(const i18nutil::SearchOptions2
& rSearchOpt
,
390 SwDocPositions eStart
, SwDocPositions eEnd
,
391 FindRanges eFlags
= FindRanges::InBody
,
392 bool bReplace
= false );
394 sal_Int32
SearchTempl (const OUString
&rTempl
,
395 SwDocPositions eStart
, SwDocPositions eEnd
,
396 FindRanges eFlags
= FindRanges::InBody
,
397 const OUString
* pReplTempl
= nullptr );
399 sal_Int32
SearchAttr (const SfxItemSet
& rFindSet
,
401 SwDocPositions eStart
, SwDocPositions eEnd
,
402 FindRanges eFlags
= FindRanges::InBody
,
403 const i18nutil::SearchOptions2
* pSearchOpt
= nullptr,
404 const SfxItemSet
* pReplaceSet
= nullptr);
406 void AutoCorrect( SvxAutoCorrect
& rACorr
, sal_Unicode cChar
);
408 // action ahead of cursor movement
409 // resets selection if applicable, triggers timer and GCAttr()
410 void MoveCursor( bool bWithSelect
= false );
412 // update input fields
413 bool StartInputFieldDlg(SwField
*, bool bPrevButton
, bool bNextButton
, weld::Widget
* pParentWin
, FieldDialogPressedButton
* pPressedButton
= nullptr);
414 // update DropDown fields
415 bool StartDropDownFieldDlg(SwField
*, bool bPrevButton
, bool bNextButton
, weld::Widget
* pParentWin
, FieldDialogPressedButton
* pPressedButton
= nullptr);
417 //"Handler" for changes at DrawView - for controls.
418 virtual void DrawSelChanged( ) override
;
420 // jump to bookmark and set the "selections-flags" correctly again
421 void GotoMark( const ::sw::mark::IMark
* const pMark
);
422 bool GotoMark( const ::sw::mark::IMark
* const pMark
, bool bSelect
);
423 void GotoMark( const OUString
& rName
);
424 bool GoNextBookmark(); // true when there still was one
425 bool GoPrevBookmark();
427 bool GotoFieldmark(::sw::mark::IFieldmark
const * const pMark
);
429 bool GotoField( const SwFormatField
& rField
);
431 /** @param bOnlyRefresh:
432 * false: run default actions (e.g. toggle checkbox, remove placeholder content)
433 * true: do not alter the content control, just refresh the doc model
435 bool GotoContentControl(const SwFormatContentControl
& rContentControl
,
436 bool bOnlyRefresh
= false);
438 // jump to the next / previous hyperlink - inside text and also
440 void SelectNextPrevHyperlink( bool bNext
);
442 // determine corresponding SwView
443 const SwView
& GetView() const { return m_rView
; }
444 SwView
& GetView() { return m_rView
; }
446 // Because nobody else is doing it, here is an ExecMacro()
447 void ExecMacro( const SvxMacro
& rMacro
, OUString
* pRet
= nullptr, SbxArray
* pArgs
= nullptr );
448 // call into the dark Basic/JavaScript
449 sal_uInt16
CallEvent( SvMacroItemId nEvent
, const SwCallMouseEvent
& rCallEvent
,
450 bool bCheckPtr
= false );
452 // a click at the given field. the cursor is on it.
453 // execute the predefined actions.
454 void ClickToField( const SwField
& rField
, bool bExecHyperlinks
);
455 void ClickToINetAttr( const SwFormatINetFormat
& rItem
, LoadUrlFlags nFilter
= LoadUrlFlags::NONE
);
456 bool ClickToINetGrf( const Point
& rDocPt
, LoadUrlFlags nFilter
);
457 inline bool IsInClickToEdit() const ;
459 // if a URL-Button is selected, return its URL; otherwise an empty string
460 bool GetURLFromButton( OUString
& rURL
, OUString
& rDescr
) const;
462 void NavigatorPaste( const NaviContentBookmark
& rBkmk
,
463 const sal_uInt16 nAction
);
465 virtual void ApplyViewOptions( const SwViewOption
&rOpt
) override
;
466 virtual void SetReadonlyOption( bool bSet
) override
;
468 // automatic update of styles
469 void AutoUpdateFrame(SwFrameFormat
* pFormat
, const SfxItemSet
& rStyleSet
);
470 void AutoUpdatePara(SwTextFormatColl
* pColl
, const SfxItemSet
& rStyleSet
, SwPaM
* pPaM
= nullptr );
472 // starts dialog for inserting ranges via Drag&Drop/Clipboard
473 void StartInsertRegionDialog(const SwSectionData
&);
475 // ctor, the first one is a kind of a controlled copy ctor for more views of a document
476 SwWrtShell( SwWrtShell
&, vcl::Window
*pWin
, SwView
&rShell
);
477 SwWrtShell( SwDoc
& rDoc
, vcl::Window
*pWin
, SwView
&rShell
,
478 const SwViewOption
*pViewOpt
);
479 virtual ~SwWrtShell() override
;
481 bool TryRemoveIndent(); // #i23725#
483 OUString
GetSelDescr() const;
485 SwNavigationMgr
& GetNavigationMgr() { return m_aNavigationMgr
; }
487 void addCurrentPosition();
488 bool GotoFly( const OUString
& rName
, FlyCntType eType
= FLYCNTTYPE_ALL
,
489 bool bSelFrame
= true );
490 bool GotoINetAttr( const SwTextINetFormat
& rAttr
);
491 void GotoOutline( SwOutlineNodes::size_type nIdx
);
492 bool GotoOutline( const OUString
& rName
);
493 bool GotoRegion( std::u16string_view rName
);
494 bool GotoRefMark( const OUString
& rRefMark
, sal_uInt16 nSubType
= 0,
495 sal_uInt16 nSeqNo
= 0 );
496 bool GotoNextTOXBase( const OUString
* pName
= nullptr);
497 bool GotoTable( const OUString
& rName
);
498 void GotoFormatField( const SwFormatField
& rField
);
499 const SwRangeRedline
* GotoRedline( SwRedlineTable::size_type nArrPos
, bool bSelect
);
500 bool GotoDrawingObject(std::u16string_view rName
);
501 void GotoFootnoteAnchor(const SwTextFootnote
& rTextFootnote
);
502 void ChangeHeaderOrFooter(std::u16string_view rStyleName
, bool bHeader
, bool bOn
, bool bShowWarning
);
503 virtual void SetShowHeaderFooterSeparator( FrameControlType eControl
, bool bShow
) override
;
505 /// Inserts a new annotation/comment at the current cursor position / selection.
506 void InsertPostIt(SwFieldMgr
& rFieldMgr
, const SfxRequest
& rReq
);
508 bool IsOutlineContentVisible(const size_t nPos
);
509 void MakeOutlineContentVisible(const size_t nPos
, bool bMakeVisible
= true, bool bSetAttrOutlineVisibility
= true);
510 void MakeAllFoldedOutlineContentVisible(bool bMakeVisible
= true);
511 void InvalidateOutlineContentVisibility();
512 bool GetAttrOutlineContentVisible(const size_t nPos
) const;
514 void MakeOutlineLevelsVisible(const int nLevel
);
516 bool HasFoldedOutlineContentSelected() const;
517 virtual void InfoReadOnlyDialog(bool bAsync
) const override
;
518 virtual bool WarnHiddenSectionDialog() const override
;
519 virtual bool WarnSwitchToDesignModeDialog() const override
;
521 std::optional
<OString
> getLOKPayload(int nType
, int nViewId
) const;
525 SAL_DLLPRIVATE
void OpenMark();
526 SAL_DLLPRIVATE
void CloseMark( bool bOkFlag
);
535 ModeStack(ModeStack
*pNextMode
, bool _bIns
, bool _bExt
, bool _bAdd
, bool _bBlock
):
542 } *m_pModeStack
= nullptr;
544 // carry cursor along when PageUp / -Down
550 } m_ePageMove
= MV_NO
;
555 std::unique_ptr
<CursorStack
> pNext
;
556 bool bValidCurPos
: 1;
557 bool bIsFrameSel
: 1;
560 CursorStack( bool bValid
, bool bFrameSel
, const Point
&rDocPos
,
561 SwTwips lOff
, std::unique_ptr
<CursorStack
> pN
)
563 pNext(std::move(pN
)),
564 bValidCurPos( bValid
),
565 bIsFrameSel( bFrameSel
),
571 std::unique_ptr
<CursorStack
> m_pCursorStack
;
574 SwNavigationMgr m_aNavigationMgr
;
577 bool m_bDestOnStack
= false;
578 bool HasCursorStack() const { return nullptr != m_pCursorStack
; }
579 SAL_DLLPRIVATE
bool PushCursor(SwTwips lOffset
, bool bSelect
);
580 SAL_DLLPRIVATE
bool PopCursor(bool bUpdate
, bool bSelect
= false);
582 // take END cursor along when PageUp / -Down
583 SAL_DLLPRIVATE
void SttWrd();
584 SAL_DLLPRIVATE
void EndWrd();
585 SAL_DLLPRIVATE
bool NxtWrd_();
586 SAL_DLLPRIVATE
bool PrvWrd_();
588 SAL_DLLPRIVATE
bool NxtWrdForDelete();
589 SAL_DLLPRIVATE
bool PrvWrdForDelete();
590 SAL_DLLPRIVATE
bool FwdSentence_();
591 SAL_DLLPRIVATE
bool BwdSentence_();
593 SAL_DLLPRIVATE
bool BwdPara_();
600 bool m_bBlockMode
:1;
601 bool m_bLayoutMode
:1;
604 bool m_bIsInClickToEdit
:1;
605 bool m_bClearMark
:1; // don't delete selection for ChartAutoPilot
606 bool m_bRetainSelection
:1; // Do not remove selections
609 Link
<SwWrtShell
&,void> m_aSelTableLink
;
611 // resets the cursor stack after movement by PageUp/-Down
612 SAL_DLLPRIVATE
void ResetCursorStack_();
614 using SwCursorShell::SetCursor
;
615 SAL_DLLPRIVATE
tools::Long
SetCursor(const Point
*, bool bProp
=false );
617 SAL_DLLPRIVATE
tools::Long
SetCursorKillSel(const Point
*, bool bProp
);
619 SAL_DLLPRIVATE
void BeginDrag(const Point
*, bool bProp
);
620 SAL_DLLPRIVATE
void DefaultDrag(const Point
*, bool bProp
);
621 SAL_DLLPRIVATE
void DefaultEndDrag(const Point
*, bool bProp
);
623 SAL_DLLPRIVATE
void ExtSelWrd(const Point
*, bool bProp
);
624 SAL_DLLPRIVATE
void ExtSelLn(const Point
*, bool bProp
);
626 SAL_DLLPRIVATE
void BeginFrameDrag(const Point
*, bool bProp
);
628 // after SSize/Move of a frame update; Point is destination.
629 SAL_DLLPRIVATE
void UpdateLayoutFrame(const Point
*, bool bProp
);
631 SAL_DLLPRIVATE
void SttLeaveSelect();
632 SAL_DLLPRIVATE
void AddLeaveSelect();
633 SAL_DLLPRIVATE
tools::Long
Ignore(const Point
*, bool bProp
);
635 SAL_DLLPRIVATE
void LeaveExtSel() { m_bSelWrd
= m_bSelLn
= false;}
637 SAL_DLLPRIVATE
bool GoStart(bool KeepArea
, bool *,
638 bool bSelect
, bool bDontMoveRegion
= false);
639 SAL_DLLPRIVATE
bool GoEnd(bool KeepArea
= false, const bool * = nullptr);
648 SAL_DLLPRIVATE
bool MoveBookMark(BookMarkMove eFuncId
, const ::sw::mark::IMark
* const pMark
=nullptr);
651 inline void SwWrtShell::ResetCursorStack()
653 if ( HasCursorStack() )
657 inline void SwWrtShell::SelTableCells(const Link
<SwWrtShell
&,void> &rLink
)
659 SetSelTableCells( true );
661 m_aSelTableLink
= rLink
;
663 inline void SwWrtShell::EndSelTableCells()
665 SetSelTableCells( false );
669 inline bool SwWrtShell::IsInClickToEdit() const { return m_bIsInClickToEdit
; }
671 inline bool SwWrtShell::Is_FnDragEQBeginDrag() const
674 SELECTFUNC2 fnTmp
= &SwWrtShell::BeginDrag
;
675 return m_fnDrag
== fnTmp
;
677 return m_fnDrag
== &SwWrtShell::BeginDrag
;
681 class MakeAllOutlineContentTemporarilyVisible
684 SwWrtShell
* m_pWrtSh
= nullptr;
685 bool m_bDone
= false;
686 bool m_bScrollToCursor
= false;
688 static sal_uInt32 nLock
;
689 MakeAllOutlineContentTemporarilyVisible(SwDoc
* pDoc
, bool bScrollToCursor
= false)
694 if (SwDocShell
* pDocSh
= pDoc
->GetDocShell())
695 if ((m_pWrtSh
= pDocSh
->GetWrtShell()) && m_pWrtSh
->GetViewOptions() &&
696 m_pWrtSh
->GetViewOptions()->IsShowOutlineContentVisibilityButton())
698 m_pWrtSh
->LockView(true);
699 m_pWrtSh
->LockPaint(LockPaintReason::OutlineFolding
);
700 m_pWrtSh
->MakeAllFoldedOutlineContentVisible();
701 m_bScrollToCursor
= bScrollToCursor
;
706 ~MakeAllOutlineContentTemporarilyVisible() COVERITY_NOEXCEPT_FALSE
711 if (m_bDone
&& m_pWrtSh
)
713 m_pWrtSh
->MakeAllFoldedOutlineContentVisible(false);
714 m_pWrtSh
->UnlockPaint();
715 m_pWrtSh
->LockView(false);
716 if (m_bScrollToCursor
)
717 m_pWrtSh
->UpdateCursor(SwCursorShell::SCROLLWIN
);
722 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */