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
20#pragma once
21
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 <com/sun/star/embed/EmbedVerbs.hpp>
30#include <svx/swframetypes.hxx>
31#include <vcl/weld.hxx>
32
33#include <doc.hxx>
34#include <docsh.hxx>
35#include <viewopt.hxx>
36
37namespace vcl { class Window; }
38class SbxArray;
40class SwField;
41class SwTOXBase;
42class SwView;
43class SvGlobalName;
45class SwSectionData;
46class Timer;
47class SvxMacro;
49class SvxAutoCorrect;
51struct SwCallMouseEvent;
53enum class SvMacroItemId : sal_uInt16;
54class SwFieldMgr;
55class SfxRequest;
56enum class SwLineBreakClear;
58enum class SwContentControlType;
59
60namespace i18nutil {
61 struct SearchOptions2;
62}
63
64enum class SelectionType : sal_Int32
65{
66 NONE = 0x000000,
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
85 All = 0x0ffff3,
86};
87namespace o3tl {
88 template<> struct typed_flags<SelectionType> : is_typed_flags<SelectionType, 0x0ffff3> {};
89}
90
96class SW_DLLPUBLIC SwWrtShell final : public SwFEShell
97{
98private:
101 using SwCursorShell::Up;
110
111 typedef tools::Long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp );
112 typedef void (SwWrtShell::*SELECTFUNC2)(const Point *, bool bProp );
113
114 SELECTFUNC2 m_fnDrag = &SwWrtShell::BeginDrag;
115 SELECTFUNC m_fnSetCursor = &SwWrtShell::SetCursor;
116 SELECTFUNC2 m_fnEndDrag = &SwWrtShell::DefaultEndDrag;
117 SELECTFUNC m_fnKillSel = &SwWrtShell::Ignore;
118
119public:
122
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); }
127
128 bool IsSplitVerticalByDefault() const;
129 void SetSplitVerticalByDefault(bool value);
130
131 // reset all selections
132 tools::Long ResetSelect( const Point *, bool );
133
134 // resets the cursorstack after movement with PageUp/-Down if a stack is built up
135 inline void ResetCursorStack();
136 SelectionType GetSelectionType() const;
137
138 bool IsModePushed() const { return nullptr != m_pModeStack; }
139 void PushMode();
140 void PopMode();
141
142 void SttSelect();
143 void EndSelect();
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);
151
152 void EnterStdMode();
153 bool IsStdMode() const { return !m_bExtMode && !m_bAddMode && !m_bBlockMode; }
154
155 void EnterExtMode();
156 void LeaveExtMode();
157 void ToggleExtMode();
158 bool IsExtMode() const { return m_bExtMode; }
159
160 void EnterAddMode();
161 void LeaveAddMode();
162 void ToggleAddMode();
163 bool IsAddMode() const { return m_bAddMode; }
164
165 void EnterBlockMode();
166 void LeaveBlockMode();
167 void ToggleBlockMode();
168 bool IsBlockMode() const { return m_bBlockMode; }
169
170 void SetInsMode( bool bOn = true );
171 void ToggleInsMode() { SetInsMode( !m_bIns ); }
172 bool IsInsMode() const { return m_bIns; }
173 void SetRedlineFlagsAndCheckInsMode( RedlineFlags eMode );
174
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();
180
181 void Invalidate();
182
183 // select table cells for editing of formulas in the ribbonbar
184 inline void SelTableCells( const Link<SwWrtShell&,void> &rLink );
185 inline void EndSelTableCells();
186
187 // leave per word or per line selection mode. Is usually called in MB-Up.
188 bool IsExtSel() const { return m_bSelWrd || m_bSelLn; }
189
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;
193
194 // base requests
195 bool IsEndWrd();
196 bool IsSttOfPara() const { return IsSttPara(); }
197 bool IsEndOfPara() const { return IsEndPara(); }
198
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 *);
205 void SelAll();
206
207 // basecursortravelling
208typedef bool (SwWrtShell::*FNSimpleMove)();
209 bool SimpleMove( FNSimpleMove, bool bSelect );
210
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 ); }
219
220 bool LeftMargin ( bool bSelect, bool bBasicCall );
221 bool RightMargin( bool bSelect, bool bBasicCall );
222
223 bool StartOfSection( bool bSelect = false );
224 bool EndOfSection ( bool bSelect = false );
225
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 );
234 bool FwdPara ()
235 { return SimpleMove( &SwWrtShell::FwdPara_, false/*bSelect*/ ); }
236 void BwdPara ()
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 ); }
242
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();
248
249 bool SelectTextAttr( sal_uInt16 nWhich, const SwTextAttr* pAttr = nullptr );
250
251 // per column jumps
252 void StartOfColumn ();
253 void EndOfColumn ();
254 void StartOfNextColumn ();
255 void EndOfNextColumn ();
256 void StartOfPrevColumn ();
257 void EndOfPrevColumn ();
258
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
262 // cursor
263 bool GotoPage( sal_uInt16 nPage, bool bRecord );
264
265 // setting the cursor; remember the old position for turning back
266 DECL_DLLPRIVATE_LINK( ExecFlyMac, const SwFlyFrameFormat*, void );
267
268 bool PageCursor(SwTwips lOffset, bool bSelect);
269
270 // update fields
271 void UpdateInputFields( SwInputFieldList* pLst = nullptr );
272
273 void NoEdit(bool bHideCursor = true);
274 void Edit();
275
276 bool IsRetainSelection() const { return m_bRetainSelection; }
277 void SetRetainSelection( bool bRet ) { m_bRetainSelection = bRet; }
278
279 // change current data base and notify
280 void ChgDBData(const SwDBData& SwDBData);
281
282 // delete
283 void DelToEndOfLine();
284 void DelToStartOfLine();
285 void DelLine();
286 bool DelLeft();
287
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();
294 void DelNxtWord();
295 void DelPrvWord();
296
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)
301 enum word {
302 NO_WORD = 0,
303 WORD_SPACE_BEFORE = 1,
304 WORD_SPACE_AFTER = 2,
305 WORD_NO_SPACE = 3
306 };
307 int IntelligentCut(SelectionType nSelectionType, bool bCut = true);
308
309 // edit
310 bool InsertField2(SwField const &, SwPaM* pAnnotationRange = nullptr);
311 void Insert(const OUString &);
312 // graphic
313 void InsertGraphic( const OUString &rPath, const OUString &rFilter,
314 const Graphic &, SwFlyFrameAttrMgr * = nullptr,
315 RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA);
316
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 );
324 bool CanInsert();
325
326 // indexes
327 void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = nullptr);
328 void UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = nullptr);
329
330 // numbering and bullets
337 void NumOrBulletOn(bool bNum); // #i29560#
338 void NumOrBulletOff(); // #i29560#
339 void NumOn();
340 void BulletOn();
341
342 //OLE
343 void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 for clipboard
345 SvGlobalName const *pName, // != 0 create object accordingly
346 sal_uInt16 nSlotId = 0); // SlotId for dialog
347
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;
357
358 // styles and formats
359
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
364
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);
370
371 void SetPageStyle(const OUString &rCollName);
372
373 OUString const & GetCurPageStyle() const;
374
375 // change current style using the attributes in effect
376 void QuickUpdateStyle();
377
378 enum DoType { UNDO, REDO, REPEAT };
379
381
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;
386
387 // search and replace
388 sal_Int32 SearchPattern(const i18nutil::SearchOptions2& rSearchOpt,
389 bool bSearchInNotes,
390 SwDocPositions eStart, SwDocPositions eEnd,
392 bool bReplace = false );
393
394 sal_Int32 SearchTempl (const OUString &rTempl,
395 SwDocPositions eStart, SwDocPositions eEnd,
397 const OUString* pReplTempl = nullptr );
398
399 sal_Int32 SearchAttr (const SfxItemSet& rFindSet,
400 bool bNoColls,
401 SwDocPositions eStart, SwDocPositions eEnd,
403 const i18nutil::SearchOptions2* pSearchOpt = nullptr,
404 const SfxItemSet* pReplaceSet = nullptr);
405
406 void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar );
407
408 // action ahead of cursor movement
409 // resets selection if applicable, triggers timer and GCAttr()
410 void MoveCursor( bool bWithSelect = false );
411
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);
416
417 //"Handler" for changes at DrawView - for controls.
418 virtual void DrawSelChanged( ) override;
419
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();
426
427 bool GotoFieldmark(::sw::mark::IFieldmark const * const pMark);
428
429 bool GotoField( const SwFormatField& rField );
430
431 bool GotoContentControl(const SwFormatContentControl& rContentControl);
432
433 // jump to the next / previous hyperlink - inside text and also
434 // on graphics
435 void SelectNextPrevHyperlink( bool bNext );
436
437 // determine corresponding SwView
438 const SwView& GetView() const { return m_rView; }
439 SwView& GetView() { return m_rView; }
440
441 // Because nobody else is doing it, here is an ExecMacro()
442 void ExecMacro( const SvxMacro& rMacro, OUString* pRet = nullptr, SbxArray* pArgs = nullptr );
443 // call into the dark Basic/JavaScript
444 sal_uInt16 CallEvent( SvMacroItemId nEvent, const SwCallMouseEvent& rCallEvent,
445 bool bCheckPtr = false );
446
447 // a click at the given field. the cursor is on it.
448 // execute the predefined actions.
449 void ClickToField( const SwField& rField, bool bExecHyperlinks );
450 void ClickToINetAttr( const SwFormatINetFormat& rItem, LoadUrlFlags nFilter = LoadUrlFlags::NONE );
451 bool ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter );
452 inline bool IsInClickToEdit() const ;
453
454 // if a URL-Button is selected, return its URL; otherwise an empty string
455 bool GetURLFromButton( OUString& rURL, OUString& rDescr ) const;
456
457 void NavigatorPaste( const NaviContentBookmark& rBkmk,
458 const sal_uInt16 nAction );
459
460 virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
461 virtual void SetReadonlyOption( bool bSet ) override;
462
463 // automatic update of styles
464 void AutoUpdateFrame(SwFrameFormat* pFormat, const SfxItemSet& rStyleSet);
465 void AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM = nullptr );
466
467 // starts dialog for inserting ranges via Drag&Drop/Clipboard
468 void StartInsertRegionDialog(const SwSectionData&);
469
470 // ctor, the first one is a kind of a controlled copy ctor for more views of a document
471 SwWrtShell( SwWrtShell&, vcl::Window *pWin, SwView &rShell);
472 SwWrtShell( SwDoc& rDoc, vcl::Window *pWin, SwView &rShell,
473 const SwViewOption *pViewOpt);
474 virtual ~SwWrtShell() override;
475
476 bool TryRemoveIndent(); // #i23725#
477
478 OUString GetSelDescr() const;
479
480 SwNavigationMgr& GetNavigationMgr() { return m_aNavigationMgr; }
481
482 void addCurrentPosition();
483 bool GotoFly( const OUString& rName, FlyCntType eType = FLYCNTTYPE_ALL,
484 bool bSelFrame = true );
485 bool GotoINetAttr( const SwTextINetFormat& rAttr );
487 bool GotoOutline( const OUString& rName );
488 bool GotoRegion( std::u16string_view rName );
489 bool GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType = 0,
490 sal_uInt16 nSeqNo = 0 );
491 bool GotoNextTOXBase( const OUString* pName = nullptr);
492 bool GotoTable( const OUString& rName );
493 void GotoFormatField( const SwFormatField& rField );
494 const SwRangeRedline* GotoRedline( SwRedlineTable::size_type nArrPos, bool bSelect);
495 bool GotoDrawingObject(std::u16string_view rName);
496 void GotoFootnoteAnchor(const SwTextFootnote& rTextFootnote);
497 void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning);
498 virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) override;
499
501 void InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq);
502
503 bool IsOutlineContentVisible(const size_t nPos);
504 void MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible = true);
505 void MakeAllFoldedOutlineContentVisible(bool bMakeVisible = true);
506 void InvalidateOutlineContentVisibility();
507 bool GetAttrOutlineContentVisible(const size_t nPos);
508
509 std::optional<OString> getLOKPayload(int nType, int nViewId) const;
510
511private:
512
513 SAL_DLLPRIVATE void OpenMark();
514 SAL_DLLPRIVATE void CloseMark( bool bOkFlag );
515
517 {
519 bool bAdd,
523 ModeStack(ModeStack *pNextMode, bool _bIns, bool _bExt, bool _bAdd, bool _bBlock):
524 pNext(pNextMode),
525 bAdd(_bAdd),
526 bBlock(_bBlock),
527 bExt(_bExt),
528 bIns(_bIns)
529 {}
530 } *m_pModeStack = nullptr;
531
532 // carry cursor along when PageUp / -Down
534 {
537 MV_PAGE_DOWN
538 } m_ePageMove = MV_NO;
539
541 {
543 std::unique_ptr<CursorStack> pNext;
544 bool bValidCurPos : 1;
545 bool bIsFrameSel : 1;
547
548 CursorStack( bool bValid, bool bFrameSel, const Point &rDocPos,
549 SwTwips lOff, std::unique_ptr<CursorStack> pN )
550 : aDocPos(rDocPos),
551 pNext(std::move(pN)),
552 bValidCurPos( bValid ),
553 bIsFrameSel( bFrameSel ),
554 lOffset(lOff)
555 {
556 }
557
558 };
559 std::unique_ptr<CursorStack> m_pCursorStack;
560
563
565 bool m_bDestOnStack = false;
566 bool HasCursorStack() const { return nullptr != m_pCursorStack; }
567 SAL_DLLPRIVATE bool PushCursor(SwTwips lOffset, bool bSelect);
568 SAL_DLLPRIVATE bool PopCursor(bool bUpdate, bool bSelect = false);
569
570 // take END cursor along when PageUp / -Down
571 SAL_DLLPRIVATE void SttWrd();
572 SAL_DLLPRIVATE void EndWrd();
573 SAL_DLLPRIVATE bool NxtWrd_();
574 SAL_DLLPRIVATE bool PrvWrd_();
575 // #i92468#
576 SAL_DLLPRIVATE bool NxtWrdForDelete();
577 SAL_DLLPRIVATE bool PrvWrdForDelete();
578 SAL_DLLPRIVATE bool FwdSentence_();
579 SAL_DLLPRIVATE bool BwdSentence_();
580 bool FwdPara_();
581 SAL_DLLPRIVATE bool BwdPara_();
582
583 // selections
584 bool m_bIns :1;
585 bool m_bInSelect :1;
586 bool m_bExtMode :1;
587 bool m_bAddMode :1;
590 bool m_bSelWrd :1;
591 bool m_bSelLn :1;
593 bool m_bClearMark :1; // don't delete selection for ChartAutoPilot
594 bool m_bRetainSelection :1; // Do not remove selections
595
598
599 // resets the cursor stack after movement by PageUp/-Down
600 SAL_DLLPRIVATE void ResetCursorStack_();
601
603 SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false );
604
605 SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp );
606
607 SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp );
608 SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp );
609 SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp );
610
611 SAL_DLLPRIVATE void ExtSelWrd(const Point *, bool bProp );
612 SAL_DLLPRIVATE void ExtSelLn(const Point *, bool bProp );
613
614 SAL_DLLPRIVATE void BeginFrameDrag(const Point *, bool bProp );
615
616 // after SSize/Move of a frame update; Point is destination.
617 SAL_DLLPRIVATE void UpdateLayoutFrame(const Point *, bool bProp );
618
619 SAL_DLLPRIVATE void SttLeaveSelect();
620 SAL_DLLPRIVATE void AddLeaveSelect();
621 SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp );
622
623 SAL_DLLPRIVATE void LeaveExtSel() { m_bSelWrd = m_bSelLn = false;}
624
625 SAL_DLLPRIVATE bool GoStart(bool KeepArea, bool *,
626 bool bSelect, bool bDontMoveRegion = false);
627 SAL_DLLPRIVATE bool GoEnd(bool KeepArea = false, const bool * = nullptr);
628
630 {
633 BOOKMARK_PREV
634 };
635
636 SAL_DLLPRIVATE bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=nullptr);
637};
638
640{
641 if ( HasCursorStack() )
643}
644
646{
647 SetSelTableCells( true );
648 m_bClearMark = true;
649 m_aSelTableLink = rLink;
650}
652{
653 SetSelTableCells( false );
654 m_bClearMark = true;
655}
656
657inline bool SwWrtShell::IsInClickToEdit() const { return m_bIsInClickToEdit; }
658
660{
661#ifdef __GNUC__
663 return m_fnDrag == fnTmp;
664#else
666#endif
667}
668
670{
671private:
673 bool m_bDone = false;
674public:
675 static sal_uInt32 nLock;
677 {
678 ++nLock;
679 if (nLock > 1)
680 return;
681 if (SwDocShell* pDocSh = pDoc->GetDocShell())
682 if ((m_pWrtSh = pDocSh->GetWrtShell()) && m_pWrtSh->GetViewOptions() &&
684 {
687 m_bDone = true;
688 }
689 }
690
692 {
693 --nLock;
694 if (nLock > 0)
695 return;
696 if (m_bDone && m_pWrtSh)
697 {
700 }
701 }
702};
703
704/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const short REDO
const short REPEAT
const short UNDO
MakeAllOutlineContentTemporarilyVisible(SwDoc *pDoc)
Definition: wrtsh.hxx:676
~MakeAllOutlineContentTemporarilyVisible() COVERITY_NOEXCEPT_FALSE
Definition: wrtsh.hxx:691
Represents the style of a text portion.
Definition: charfmt.hxx:27
Stores the properties of a content control.
bool Pop(PopMode, ::std::optional< SwCallLink > &roLink)
bool GotoRefMark(const OUString &rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo)
jump to reference marker
Definition: crstrvl.cxx:1273
bool LeftMargin()
Definition: crsrsh.hxx:367
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
Definition: crsrsh.cxx:760
bool HasSelection() const
Does the current cursor create a selection?
Definition: crsrsh.cxx:2530
bool IsMultiSelection() const
Definition: crsrsh.hxx:904
bool GotoFieldmark(const ::sw::mark::IFieldmark *const pMark)
Definition: crbm.cxx:305
bool GotoFootnoteAnchor()
jump from footnote to anchor
Definition: trvlfnfl.cxx:167
bool GotoTable(const OUString &rName)
Definition: trvltbl.cxx:791
bool IsEndPara() const
Definition: crsrsh.cxx:1113
bool RightMargin(bool bAPI=false)
Definition: crsrsh.hxx:368
bool GotoPage(sal_uInt16 nPage)
Definition: crsrsh.cxx:1187
bool GoPrevBookmark()
Definition: crbm.cxx:236
void SetSelTableCells(bool bFlag)
Definition: crsrsh.hxx:822
bool IsSttPara() const
Definition: crsrsh.cxx:1094
bool GotoMark(const ::sw::mark::IMark *const pMark)
Definition: crbm.cxx:187
bool SelectTextAttr(sal_uInt16 nWhich, bool bExpand, const SwTextAttr *pAttr=nullptr)
Definition: crstrvl.cxx:2100
bool GotoNextTOXBase(const OUString *=nullptr)
jump to the next index
Definition: crstrvl.cxx:263
bool Right(sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:363
const SwRangeRedline * GotoRedline(SwRedlineTable::size_type nArrPos, bool bSelect)
Definition: crstrvl.cxx:2443
bool Down(sal_uInt16 nCnt=1)
Definition: crsrsh.hxx:366
bool GotoOutline(const OUString &rName)
Definition: crstrvl.cxx:1042
bool Left(sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:361
bool GotoRegion(std::u16string_view rName)
Definition: trvlreg.cxx:270
bool GoNextBookmark()
Definition: crbm.cxx:203
bool GotoFormatField(const SwFormatField &rField)
Definition: crstrvl.cxx:870
bool GotoINetAttr(const SwTextINetFormat &rAttr)
Definition: crstrvl.cxx:2127
bool Up(sal_uInt16 nCnt=1)
Definition: crsrsh.hxx:365
Definition: doc.hxx:192
SwDocShell * GetDocShell()
Definition: doc.hxx:1355
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void SplitNode(bool bAutoFormat=false, bool bCheckTableStart=true)
Definition: editsh.cxx:183
void ChgDBData(const SwDBData &SwDBData)
Definition: edfld.cxx:296
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: editsh.cxx:1092
void Insert(sal_Unicode, bool bOnlyCurrCursor=false)
Edit (all selected ranges).
Definition: editsh.cxx:62
void InsertTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
Insert content table. Renew if required.
Definition: edtox.cxx:122
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
update tables of content
Definition: edtox.cxx:150
void AutoCorrect(SvxAutoCorrect &rACorr, bool bInsertMode, sal_Unicode cChar)
Call AutoCorrect.
Definition: edws.cxx:255
void EndAllAction()
Definition: edws.cxx:97
SwFlyFrameFormat * InsertObject(const svt::EmbeddedObjectRef &, SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:930
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:1314
virtual void ConnectObj(svt::EmbeddedObjectRef &, const SwRect &rPrt, const SwRect &rFrame)=0
Connect objects with ActivateWhenVisible at Paint.
bool GotoFly(const OUString &rName, FlyCntType eType, bool bSelFrame)
Jump to named Fly (graphic/OLE).
Definition: feshview.cxx:2613
void Insert(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:839
size_t IsObjSelected() const
Definition: feshview.cxx:1245
void BeginDrag(const Point *pPt, bool bProp)
Definition: feshview.cxx:719
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.
Base class of all fields.
Definition: fldbas.hxx:292
SfxPoolItem subclass that wraps an SwContentControl.
Style of a layout element.
Definition: frmfmt.hxx:62
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
vector_type::size_type size_type
Definition: docary.hxx:222
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:99
virtual void DrawSelChanged()
Definition: viewsh.cxx:2195
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:436
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2474
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow)
Definition: viewsh.cxx:99
Definition: view.hxx:146
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void SelTableCells(const Link< SwWrtShell &, void > &rLink)
Definition: wrtsh.hxx:645
bool m_bBlockMode
Definition: wrtsh.hxx:588
bool FwdPara()
Definition: wrtsh.hxx:234
bool IsSelFrameMode() const
Definition: wrtsh.hxx:177
bool IsRetainSelection() const
Definition: wrtsh.hxx:276
SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp)
Definition: select.cxx:808
bool IsStdMode() const
Definition: wrtsh.hxx:153
void ToggleInsMode()
Definition: wrtsh.hxx:171
bool IsSttOfPara() const
Definition: wrtsh.hxx:196
bool m_bSelWrd
Definition: wrtsh.hxx:590
void BwdPara()
Definition: wrtsh.hxx:236
@ BOOKMARK_INDEX
Definition: wrtsh.hxx:631
@ BOOKMARK_NEXT
Definition: wrtsh.hxx:632
void EndSelTableCells()
Definition: wrtsh.hxx:651
SAL_DLLPRIVATE bool BwdPara_()
Definition: wrtsh4.cxx:221
void NxtWrd(bool bSelect=false)
Definition: wrtsh.hxx:217
FieldDialogPressedButton
Definition: wrtsh.hxx:380
std::unique_ptr< CursorStack > m_pCursorStack
Definition: wrtsh.hxx:559
SELECTFUNC2 m_fnDrag
Definition: wrtsh.hxx:114
bool FwdPara_()
Definition: wrtsh4.cxx:210
Point m_aStart
Definition: wrtsh.hxx:596
void FwdSentence(bool bSelect=false)
Definition: wrtsh.hxx:238
SAL_DLLPRIVATE void LeaveExtSel()
Definition: wrtsh.hxx:623
bool IsModePushed() const
Definition: wrtsh.hxx:138
bool PrvWrd(bool bSelect=false)
Definition: wrtsh.hxx:218
SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false)
Definition: select.cxx:304
SwView & GetView()
Definition: wrtsh.hxx:439
void(SwWrtShell::* SELECTFUNC2)(const Point *, bool bProp)
Definition: wrtsh.hxx:112
bool Is_FnDragEQBeginDrag() const
Definition: wrtsh.hxx:659
void ResetCursorStack()
Definition: wrtsh.hxx:639
tools::Long CallSetCursor(const Point *pPt, bool bProp)
Definition: wrtsh.hxx:123
SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp)
Definition: select.cxx:778
bool m_bIsInClickToEdit
Definition: wrtsh.hxx:592
SAL_DLLPRIVATE bool NxtWrd_()
Definition: wrtsh4.cxx:67
SAL_DLLPRIVATE bool BwdSentence_()
Definition: wrtsh4.cxx:193
tools::Long KillSelection(const Point *pPt, bool bProp)
Definition: wrtsh.hxx:126
SwNavigationMgr & GetNavigationMgr()
Definition: wrtsh.hxx:480
bool m_bExtMode
Definition: wrtsh.hxx:586
@ GETSTYLE_CREATESOME
Definition: wrtsh.hxx:362
Link< SwWrtShell &, void > m_aSelTableLink
Definition: wrtsh.hxx:597
bool m_bAddMode
Definition: wrtsh.hxx:587
bool IsBlockMode() const
Definition: wrtsh.hxx:168
SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp)
Definition: select.cxx:379
void MakeAllFoldedOutlineContentVisible(bool bMakeVisible=true)
Definition: wrtsh1.cxx:2492
bool IsInSelect() const
Definition: wrtsh.hxx:144
bool HasCursorStack() const
Definition: wrtsh.hxx:566
DECL_DLLPRIVATE_LINK(ExecFlyMac, const SwFlyFrameFormat *, void)
void BwdSentence(bool bSelect=false)
Definition: wrtsh.hxx:240
void SetRetainSelection(bool bRet)
Definition: wrtsh.hxx:277
bool m_bSelLn
Definition: wrtsh.hxx:591
SwView & m_rView
Definition: wrtsh.hxx:561
SwNavigationMgr m_aNavigationMgr
Definition: wrtsh.hxx:562
void EndDrag(const Point *pPt, bool bProp)
Definition: wrtsh.hxx:125
void Drag(const Point *pPt, bool bProp)
Definition: wrtsh.hxx:124
SAL_DLLPRIVATE bool PrvWrd_()
Definition: wrtsh4.cxx:98
Point m_aDest
Definition: wrtsh.hxx:564
bool HasSelection() const
Definition: wrtsh.hxx:147
bool IsInsMode() const
Definition: wrtsh.hxx:172
SAL_DLLPRIVATE bool FwdSentence_()
Definition: wrtsh4.cxx:176
bool m_bIns
Definition: wrtsh.hxx:584
bool m_bClearMark
Definition: wrtsh.hxx:593
SAL_DLLPRIVATE void ResetCursorStack_()
Definition: move.cxx:533
bool IsAddMode() const
Definition: wrtsh.hxx:163
bool IsEndOfPara() const
Definition: wrtsh.hxx:197
bool IsExtSel() const
Definition: wrtsh.hxx:188
void SetInSelect()
Definition: wrtsh.hxx:145
bool m_bLayoutMode
Definition: wrtsh.hxx:589
bool IsInClickToEdit() const
Definition: wrtsh.hxx:657
bool m_bRetainSelection
Definition: wrtsh.hxx:594
@ MV_PAGE_UP
Definition: wrtsh.hxx:536
bool IsExtMode() const
Definition: wrtsh.hxx:158
bool m_bInSelect
Definition: wrtsh.hxx:585
const SwView & GetView() const
Definition: wrtsh.hxx:438
SwDocPositions
Definition: cshtyp.hxx:104
FindRanges
Definition: cshtyp.hxx:91
@ InBody
Find "one" only in body text.
#define CNT_OLE
Definition: editsh.hxx:132
#define CNT_TXT
Definition: editsh.hxx:130
#define CNT_GRF
Definition: editsh.hxx:131
SvMacroItemId
FlyCntType
Definition: flyenum.hxx:24
@ FLYCNTTYPE_ALL
Definition: flyenum.hxx:25
SwContentControlType
SwLineBreakClear
Defines the location of a line break text wrapping restart.
SelectionType
void GetCurPageStyle(SwPaM const &rPaM, OUString &rString)
NONE
SwCharFormat * GetCharStyle(SwDoc &rDoc, const OUString &rName)
Get a Character Style which fits a given name.
SwTextFormatColl * GetParaStyle(SwDoc &rDoc, const OUString &rName)
Get a Paragraph Style which fits a given name.
long Long
std::unique_ptr< CursorStack > pNext
Definition: wrtsh.hxx:543
CursorStack(bool bValid, bool bFrameSel, const Point &rDocPos, SwTwips lOff, std::unique_ptr< CursorStack > pN)
Definition: wrtsh.hxx:548
ModeStack(ModeStack *pNextMode, bool _bIns, bool _bExt, bool _bAdd, bool _bBlock)
Definition: wrtsh.hxx:523
ModeStack * pNext
Definition: wrtsh.hxx:518
SwCursorSkipMode
Definition: swcrsr.hxx:65
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
RndStdIds
tools::Long SwTwips
Definition: swtypes.hxx:51
FrameControlType
Definition: swtypes.hxx:244
LoadUrlFlags
Definition: swurl.hxx:27
sal_uInt16 sal_Unicode
SelectionType
Definition: wrtsh.hxx:65