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(); }
150
151 void EnterStdMode();
152 bool IsStdMode() const { return !m_bExtMode && !m_bAddMode && !m_bBlockMode; }
153
154 void EnterExtMode();
155 void LeaveExtMode();
156 void ToggleExtMode();
157 bool IsExtMode() const { return m_bExtMode; }
158
159 void EnterAddMode();
160 void LeaveAddMode();
161 void ToggleAddMode();
162 bool IsAddMode() const { return m_bAddMode; }
163
164 void EnterBlockMode();
165 void LeaveBlockMode();
166 void ToggleBlockMode();
167 bool IsBlockMode() const { return m_bBlockMode; }
168
169 void SetInsMode( bool bOn = true );
170 void ToggleInsMode() { SetInsMode( !m_bIns ); }
171 bool IsInsMode() const { return m_bIns; }
172 void SetRedlineFlagsAndCheckInsMode( RedlineFlags eMode );
173
174 void EnterSelFrameMode(const Point *pStartDrag = nullptr);
175 void LeaveSelFrameMode();
176 bool IsSelFrameMode() const { return m_bLayoutMode; }
177 // reset selection of frames
178 void UnSelectFrame();
179
180 void Invalidate();
181
182 // select table cells for editing of formulas in the ribbonbar
183 inline void SelTableCells( const Link<SwWrtShell&,void> &rLink );
184 inline void EndSelTableCells();
185
186 // leave per word or per line selection mode. Is usually called in MB-Up.
187 bool IsExtSel() const { return m_bSelWrd || m_bSelLn; }
188
189 // query whether the active m_fnDrag pointer is set to BeginDrag
190 // is needed for MouseMove to work around bugs 55592/55931
191 inline bool Is_FnDragEQBeginDrag() const;
192
193 // base requests
194 bool IsEndWrd();
195 bool IsSttOfPara() const { return IsSttPara(); }
196 bool IsEndOfPara() const { return IsEndPara(); }
197
198 // select word / sentence
199 bool SelNearestWrd();
200 bool SelWrd (const Point * = nullptr );
201 // #i32329# Enhanced selection
202 void SelSentence (const Point *);
203 void SelPara (const Point *);
204 void SelAll();
205
206 // basecursortravelling
207typedef bool (SwWrtShell::*FNSimpleMove)();
208 bool SimpleMove( FNSimpleMove, bool bSelect );
209
210 bool Left ( sal_uInt16 nMode, bool bSelect,
211 sal_uInt16 nCount, bool bBasicCall, bool bVisual = false );
212 bool Right ( sal_uInt16 nMode, bool bSelect,
213 sal_uInt16 nCount, bool bBasicCall, bool bVisual = false );
214 bool Up ( bool bSelect, sal_uInt16 nCount = 1, bool bBasicCall = false );
215 bool Down ( bool bSelect, sal_uInt16 nCount = 1, bool bBasicCall = false );
216 void NxtWrd ( bool bSelect = false ) { SimpleMove( &SwWrtShell::NxtWrd_, bSelect ); }
217 bool PrvWrd ( bool bSelect = false ) { return SimpleMove( &SwWrtShell::PrvWrd_, bSelect ); }
218
219 bool LeftMargin ( bool bSelect, bool bBasicCall );
220 bool RightMargin( bool bSelect, bool bBasicCall );
221
222 bool StartOfSection( bool bSelect = false );
223 bool EndOfSection ( bool bSelect = false );
224
225 bool SttNxtPg ( bool bSelect = false );
226 void SttPrvPg ( bool bSelect = false );
227 void EndNxtPg ( bool bSelect = false );
228 bool EndPrvPg ( bool bSelect = false );
229 bool SttPg ( bool bSelect = false );
230 bool EndPg ( bool bSelect = false );
231 bool SttPara ( bool bSelect = false );
232 void EndPara ( bool bSelect = false );
233 bool FwdPara ()
234 { return SimpleMove( &SwWrtShell::FwdPara_, false/*bSelect*/ ); }
235 void BwdPara ()
236 { SimpleMove( &SwWrtShell::BwdPara_, false/*bSelect*/ ); }
237 void FwdSentence( bool bSelect = false )
238 { SimpleMove( &SwWrtShell::FwdSentence_, bSelect ); }
239 void BwdSentence( bool bSelect = false )
240 { SimpleMove( &SwWrtShell::BwdSentence_, bSelect ); }
241
242 // #i20126# Enhanced table selection
243 bool SelectTableRowCol( const Point& rPt, const Point* pEnd = nullptr, bool bRowDrag = false );
244 void SelectTableRow();
245 void SelectTableCol();
246 void SelectTableCell();
247
248 bool SelectTextAttr( sal_uInt16 nWhich, const SwTextAttr* pAttr = nullptr );
249
250 // per column jumps
251 void StartOfColumn ();
252 void EndOfColumn ();
253 void StartOfNextColumn ();
254 void EndOfNextColumn ();
255 void StartOfPrevColumn ();
256 void EndOfPrevColumn ();
257
258 // set the cursor to page "nPage" at the beginning
259 // additionally to an identically named implementation in crsrsh.hxx
260 // here all existing selections are being reset before setting the
261 // cursor
262 bool GotoPage( sal_uInt16 nPage, bool bRecord );
263
264 // setting the cursor; remember the old position for turning back
265 DECL_DLLPRIVATE_LINK( ExecFlyMac, const SwFlyFrameFormat*, void );
266
267 bool PageCursor(SwTwips lOffset, bool bSelect);
268
269 // update fields
270 void UpdateInputFields( SwInputFieldList* pLst = nullptr );
271
272 void NoEdit(bool bHideCursor = true);
273 void Edit();
274
275 bool IsRetainSelection() const { return m_bRetainSelection; }
276 void SetRetainSelection( bool bRet ) { m_bRetainSelection = bRet; }
277
278 // change current data base and notify
279 void ChgDBData(const SwDBData& SwDBData);
280
281 // delete
282 void DelToEndOfLine();
283 void DelToStartOfLine();
284 void DelLine();
285 bool DelLeft();
286
287 // also deletes the frame or sets the cursor in the frame when bDelFrame == false
288 bool DelRight(bool isReplaceHeuristic = false);
289 void DelToEndOfPara();
290 void DelToStartOfPara();
291 bool DelToEndOfSentence();
292 void DelToStartOfSentence();
293 void DelNxtWord();
294 void DelPrvWord();
295
296 // checks whether a word selection exists.
297 // According to the rules for intelligent Cut / Paste
298 // surrounding spaces are cut out.
299 // returns type of word selection (see enum)
300 enum word {
301 NO_WORD = 0,
302 WORD_SPACE_BEFORE = 1,
303 WORD_SPACE_AFTER = 2,
304 WORD_NO_SPACE = 3
305 };
306 int IntelligentCut(SelectionType nSelectionType, bool bCut = true);
307
308 // edit
309 bool InsertField2(SwField const &, SwPaM* pAnnotationRange = nullptr);
310 void Insert(const OUString &);
311 // graphic
312 void InsertGraphic( const OUString &rPath, const OUString &rFilter,
313 const Graphic &, SwFlyFrameAttrMgr * = nullptr,
314 RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA);
315
316 void InsertByWord( const OUString & );
317 void InsertPageBreak(const OUString *pPageDesc = nullptr, const ::std::optional<sal_uInt16>& rPgNum = std::nullopt);
318 void InsertLineBreak(std::optional<SwLineBreakClear> oClear = std::nullopt);
319 void InsertColumnBreak();
320 void InsertContentControl(SwContentControlType eType);
321 void InsertFootnote(const OUString &, bool bEndNote = false, bool bEdit = true );
322 void SplitNode( bool bAutoFormat = false );
323 bool CanInsert();
324
325 // indexes
326 void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = nullptr);
327 void UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = nullptr);
328
329 // numbering and bullets
336 void NumOrBulletOn(bool bNum); // #i29560#
337 void NumOrBulletOff(); // #i29560#
338 void NumOn();
339 void BulletOn();
340
341 //OLE
342 void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 for clipboard
344 SvGlobalName const *pName, // != 0 create object accordingly
345 sal_uInt16 nSlotId = 0); // SlotId for dialog
346
347 bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrameFormat **pFlyFrameFormat = nullptr );
348 void LaunchOLEObj(sal_Int32 nVerb = css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY); // start server
349 virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ) override;
350 virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
351 const SwRect *pFlyPrtRect = nullptr,
352 const SwRect *pFlyFrameRect = nullptr,
353 const bool bNoTextFramePrtAreaChanged = false ) override;
354 virtual void ConnectObj( svt::EmbeddedObjectRef& xIPObj, const SwRect &rPrt,
355 const SwRect &rFrame ) override;
356
357 // styles and formats
358
359 // enum tells when should happen when the style was not found
360 enum GetStyle { GETSTYLE_NOCREATE, // create none
361 GETSTYLE_CREATESOME, // if on PoolId create mapt
362 GETSTYLE_CREATEANY }; // return standard if applicable
363
364 SwTextFormatColl* GetParaStyle(const OUString &rCollName,
365 GetStyle eCreate = GETSTYLE_NOCREATE);
366 SwCharFormat* GetCharStyle(const OUString &rFormatName,
367 GetStyle eCreate = GETSTYLE_NOCREATE);
368 SwFrameFormat* GetTableStyle(std::u16string_view rFormatName);
369
370 void SetPageStyle(const OUString &rCollName);
371
372 OUString const & GetCurPageStyle() const;
373
374 // change current style using the attributes in effect
375 void QuickUpdateStyle();
376
377 enum DoType { UNDO, REDO, REPEAT };
378
380
381 void Do(DoType eDoType, sal_uInt16 nCnt = 1, sal_uInt16 nOffset = 0);
382 OUString GetDoString( DoType eDoType ) const;
383 OUString GetRepeatString() const;
384 void GetDoStrings( DoType eDoType, SfxStringListItem& rStrLstItem ) const;
385
386 // search and replace
387 sal_uLong SearchPattern(const i18nutil::SearchOptions2& rSearchOpt,
388 bool bSearchInNotes,
389 SwDocPositions eStart, SwDocPositions eEnd,
391 bool bReplace = false );
392
393 sal_uLong SearchTempl (const OUString &rTempl,
394 SwDocPositions eStart, SwDocPositions eEnd,
396 const OUString* pReplTempl = nullptr );
397
398 sal_uLong SearchAttr (const SfxItemSet& rFindSet,
399 bool bNoColls,
400 SwDocPositions eStart, SwDocPositions eEnd,
402 const i18nutil::SearchOptions2* pSearchOpt = nullptr,
403 const SfxItemSet* pReplaceSet = nullptr);
404
405 void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar );
406
407 // action ahead of cursor movement
408 // resets selection if applicable, triggers timer and GCAttr()
409 void MoveCursor( bool bWithSelect = false );
410
411 // update input fields
412 bool StartInputFieldDlg(SwField*, bool bPrevButton, bool bNextButton, weld::Widget* pParentWin, FieldDialogPressedButton* pPressedButton = nullptr);
413 // update DropDown fields
414 bool StartDropDownFieldDlg(SwField*, bool bPrevButton, bool bNextButton, weld::Widget* pParentWin, FieldDialogPressedButton* pPressedButton = nullptr);
415
416 //"Handler" for changes at DrawView - for controls.
417 virtual void DrawSelChanged( ) override;
418
419 // jump to bookmark and set the "selections-flags" correctly again
420 void GotoMark( const ::sw::mark::IMark* const pMark );
421 bool GotoMark( const ::sw::mark::IMark* const pMark, bool bSelect );
422 void GotoMark( const OUString& rName );
423 bool GoNextBookmark(); // true when there still was one
424 bool GoPrevBookmark();
425
426 bool GotoFieldmark(::sw::mark::IFieldmark const * const pMark);
427
428 bool GotoField( const SwFormatField& rField );
429
430 bool GotoContentControl(const SwFormatContentControl& rContentControl);
431
432 // jump to the next / previous hyperlink - inside text and also
433 // on graphics
434 void SelectNextPrevHyperlink( bool bNext );
435
436 // determine corresponding SwView
437 const SwView& GetView() const { return m_rView; }
438 SwView& GetView() { return m_rView; }
439
440 // Because nobody else is doing it, here is an ExecMacro()
441 void ExecMacro( const SvxMacro& rMacro, OUString* pRet = nullptr, SbxArray* pArgs = nullptr );
442 // call into the dark Basic/JavaScript
443 sal_uInt16 CallEvent( SvMacroItemId nEvent, const SwCallMouseEvent& rCallEvent,
444 bool bCheckPtr = false );
445
446 // a click at the given field. the cursor is on it.
447 // execute the predefined actions.
448 void ClickToField( const SwField& rField, bool bExecHyperlinks );
449 void ClickToINetAttr( const SwFormatINetFormat& rItem, LoadUrlFlags nFilter = LoadUrlFlags::NONE );
450 bool ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter );
451 inline bool IsInClickToEdit() const ;
452
453 // if a URL-Button is selected, return its URL; otherwise an empty string
454 bool GetURLFromButton( OUString& rURL, OUString& rDescr ) const;
455
456 void NavigatorPaste( const NaviContentBookmark& rBkmk,
457 const sal_uInt16 nAction );
458
459 virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
460 virtual void SetReadonlyOption( bool bSet ) override;
461
462 // automatic update of styles
463 void AutoUpdateFrame(SwFrameFormat* pFormat, const SfxItemSet& rStyleSet);
464 void AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM = nullptr );
465
466 // starts dialog for inserting ranges via Drag&Drop/Clipboard
467 void StartInsertRegionDialog(const SwSectionData&);
468
469 // ctor, the first one is a kind of a controlled copy ctor for more views of a document
470 SwWrtShell( SwWrtShell&, vcl::Window *pWin, SwView &rShell);
471 SwWrtShell( SwDoc& rDoc, vcl::Window *pWin, SwView &rShell,
472 const SwViewOption *pViewOpt);
473 virtual ~SwWrtShell() override;
474
475 bool TryRemoveIndent(); // #i23725#
476
477 OUString GetSelDescr() const;
478
479 SwNavigationMgr& GetNavigationMgr() { return m_aNavigationMgr; }
480
481 void addCurrentPosition();
482 bool GotoFly( const OUString& rName, FlyCntType eType = FLYCNTTYPE_ALL,
483 bool bSelFrame = true );
484 bool GotoINetAttr( const SwTextINetFormat& rAttr );
486 bool GotoOutline( const OUString& rName );
487 bool GotoRegion( std::u16string_view rName );
488 bool GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType = 0,
489 sal_uInt16 nSeqNo = 0 );
490 bool GotoNextTOXBase( const OUString* pName = nullptr);
491 bool GotoTable( const OUString& rName );
492 void GotoFormatField( const SwFormatField& rField );
493 const SwRangeRedline* GotoRedline( SwRedlineTable::size_type nArrPos, bool bSelect);
494 bool GotoDrawingObject(std::u16string_view rName);
495 void GotoFootnoteAnchor(const SwTextFootnote& rTextFootnote);
496 void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning);
497 virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) override;
498
500 void InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq);
501
502 bool IsOutlineContentVisible(const size_t nPos);
503 void MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible = true);
504 void MakeAllFoldedOutlineContentVisible(bool bMakeVisible = true);
505 void InvalidateOutlineContentVisibility();
506 bool GetAttrOutlineContentVisible(const size_t nPos);
507
508 OString getLOKPayload(int nType, int nViewId, bool* ignore) const;
509
510private:
511
512 SAL_DLLPRIVATE void OpenMark();
513 SAL_DLLPRIVATE void CloseMark( bool bOkFlag );
514
516 {
518 bool bAdd,
522 ModeStack(ModeStack *pNextMode, bool _bIns, bool _bExt, bool _bAdd, bool _bBlock):
523 pNext(pNextMode),
524 bAdd(_bAdd),
525 bBlock(_bBlock),
526 bExt(_bExt),
527 bIns(_bIns)
528 {}
529 } *m_pModeStack = nullptr;
530
531 // carry cursor along when PageUp / -Down
533 {
536 MV_PAGE_DOWN
537 } m_ePageMove = MV_NO;
538
540 {
542 std::unique_ptr<CursorStack> pNext;
543 bool bValidCurPos : 1;
544 bool bIsFrameSel : 1;
546
547 CursorStack( bool bValid, bool bFrameSel, const Point &rDocPos,
548 SwTwips lOff, std::unique_ptr<CursorStack> pN )
549 : aDocPos(rDocPos),
550 pNext(std::move(pN)),
551 bValidCurPos( bValid ),
552 bIsFrameSel( bFrameSel ),
553 lOffset(lOff)
554 {
555 }
556
557 };
558 std::unique_ptr<CursorStack> m_pCursorStack;
559
562
564 bool m_bDestOnStack = false;
565 bool HasCursorStack() const { return nullptr != m_pCursorStack; }
566 SAL_DLLPRIVATE bool PushCursor(SwTwips lOffset, bool bSelect);
567 SAL_DLLPRIVATE bool PopCursor(bool bUpdate, bool bSelect = false);
568
569 // take END cursor along when PageUp / -Down
570 SAL_DLLPRIVATE void SttWrd();
571 SAL_DLLPRIVATE void EndWrd();
572 SAL_DLLPRIVATE bool NxtWrd_();
573 SAL_DLLPRIVATE bool PrvWrd_();
574 // #i92468#
575 SAL_DLLPRIVATE bool NxtWrdForDelete();
576 SAL_DLLPRIVATE bool PrvWrdForDelete();
577 SAL_DLLPRIVATE bool FwdSentence_();
578 SAL_DLLPRIVATE bool BwdSentence_();
579 bool FwdPara_();
580 SAL_DLLPRIVATE bool BwdPara_();
581
582 // selections
583 bool m_bIns :1;
584 bool m_bInSelect :1;
585 bool m_bExtMode :1;
586 bool m_bAddMode :1;
589 bool m_bSelWrd :1;
590 bool m_bSelLn :1;
592 bool m_bClearMark :1; // don't delete selection for ChartAutoPilot
593 bool m_bRetainSelection :1; // Do not remove selections
594
597
598 // resets the cursor stack after movement by PageUp/-Down
599 SAL_DLLPRIVATE void ResetCursorStack_();
600
602 SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false );
603
604 SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp );
605
606 SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp );
607 SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp );
608 SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp );
609
610 SAL_DLLPRIVATE void ExtSelWrd(const Point *, bool bProp );
611 SAL_DLLPRIVATE void ExtSelLn(const Point *, bool bProp );
612
613 SAL_DLLPRIVATE void BeginFrameDrag(const Point *, bool bProp );
614
615 // after SSize/Move of a frame update; Point is destination.
616 SAL_DLLPRIVATE void UpdateLayoutFrame(const Point *, bool bProp );
617
618 SAL_DLLPRIVATE void SttLeaveSelect();
619 SAL_DLLPRIVATE void AddLeaveSelect();
620 SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp );
621
622 SAL_DLLPRIVATE void LeaveExtSel() { m_bSelWrd = m_bSelLn = false;}
623
624 SAL_DLLPRIVATE bool GoStart(bool KeepArea, bool *,
625 bool bSelect, bool bDontMoveRegion = false);
626 SAL_DLLPRIVATE bool GoEnd(bool KeepArea = false, const bool * = nullptr);
627
629 {
632 BOOKMARK_PREV
633 };
634
635 SAL_DLLPRIVATE bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=nullptr);
636};
637
639{
640 if ( HasCursorStack() )
642}
643
645{
646 SetSelTableCells( true );
647 m_bClearMark = true;
648 m_aSelTableLink = rLink;
649}
651{
652 SetSelTableCells( false );
653 m_bClearMark = true;
654}
655
656inline bool SwWrtShell::IsInClickToEdit() const { return m_bIsInClickToEdit; }
657
659{
660#ifdef __GNUC__
662 return m_fnDrag == fnTmp;
663#else
665#endif
666}
667
669{
670private:
672 bool m_bDone = false;
673public:
674 static sal_uInt32 nLock;
676 {
677 ++nLock;
678 if (nLock > 1)
679 return;
680 if (SwDocShell* pDocSh = pDoc->GetDocShell())
681 if ((m_pWrtSh = pDocSh->GetWrtShell()) && m_pWrtSh->GetViewOptions() &&
683 {
686 m_bDone = true;
687 }
688 }
689
691 {
692 --nLock;
693 if (nLock > 0)
694 return;
695 if (m_bDone && m_pWrtSh)
696 {
699 }
700 }
701};
702
703/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const short REDO
const short REPEAT
const short UNDO
MakeAllOutlineContentTemporarilyVisible(SwDoc *pDoc)
Definition: wrtsh.hxx:675
~MakeAllOutlineContentTemporarilyVisible() COVERITY_NOEXCEPT_FALSE
Definition: wrtsh.hxx:690
Represents the style of a text portion.
Definition: charfmt.hxx:27
Stores the properties of a content control.
bool GotoRefMark(const OUString &rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo)
jump to reference marker
Definition: crstrvl.cxx:1311
bool LeftMargin()
Definition: crsrsh.hxx:360
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
Definition: crsrsh.cxx:761
bool HasSelection() const
Does the current cursor create a selection?
Definition: crsrsh.cxx:2528
bool IsMultiSelection() const
Definition: crsrsh.hxx:893
bool GotoFieldmark(const ::sw::mark::IFieldmark *const pMark)
Definition: crbm.cxx:305
bool GotoFootnoteAnchor()
jump from footnote to anchor
Definition: trvlfnfl.cxx:169
bool GotoTable(const OUString &rName)
Definition: trvltbl.cxx:794
bool IsEndPara() const
Definition: crsrsh.cxx:1114
bool RightMargin(bool bAPI=false)
Definition: crsrsh.hxx:361
bool GotoPage(sal_uInt16 nPage)
Definition: crsrsh.cxx:1188
bool GoPrevBookmark()
Definition: crbm.cxx:236
void SetSelTableCells(bool bFlag)
Definition: crsrsh.hxx:811
bool IsSttPara() const
Definition: crsrsh.cxx:1095
bool GotoMark(const ::sw::mark::IMark *const pMark)
Definition: crbm.cxx:187
bool Left(sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:354
bool SelectTextAttr(sal_uInt16 nWhich, bool bExpand, const SwTextAttr *pAttr=nullptr)
Definition: crstrvl.cxx:2138
bool Right(sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual=false)
Definition: crsrsh.hxx:356
bool GotoNextTOXBase(const OUString *=nullptr)
jump to the next index
Definition: crstrvl.cxx:268
const SwRangeRedline * GotoRedline(SwRedlineTable::size_type nArrPos, bool bSelect)
Definition: crstrvl.cxx:2491
bool Down(sal_uInt16 nCnt=1)
Definition: crsrsh.hxx:359
bool GotoOutline(const OUString &rName)
Definition: crstrvl.cxx:1075
bool GotoRegion(std::u16string_view rName)
Definition: trvlreg.cxx:270
bool GoNextBookmark()
Definition: crbm.cxx:203
bool Pop(PopMode)
delete cursor
Definition: crsrsh.cxx:2270
bool GotoFormatField(const SwFormatField &rField)
Definition: crstrvl.cxx:900
bool GotoINetAttr(const SwTextINetFormat &rAttr)
Definition: crstrvl.cxx:2167
bool Up(sal_uInt16 nCnt=1)
Definition: crsrsh.hxx:358
Definition: doc.hxx:188
SwDocShell * GetDocShell()
Definition: doc.hxx:1351
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:1093
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:123
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
update tables of content
Definition: edtox.cxx:151
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:928
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:1315
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:2615
void Insert(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet)
Definition: fefly1.cxx:837
size_t IsObjSelected() const
Definition: feshview.cxx:1246
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:61
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:138
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:428
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2474
virtual void SetShowHeaderFooterSeparator(FrameControlType eControl, bool bShow)
Definition: viewsh.cxx:99
Definition: view.hxx:145
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void SelTableCells(const Link< SwWrtShell &, void > &rLink)
Definition: wrtsh.hxx:644
bool m_bBlockMode
Definition: wrtsh.hxx:587
bool FwdPara()
Definition: wrtsh.hxx:233
bool IsSelFrameMode() const
Definition: wrtsh.hxx:176
bool IsRetainSelection() const
Definition: wrtsh.hxx:275
SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp)
Definition: select.cxx:808
bool IsStdMode() const
Definition: wrtsh.hxx:152
void ToggleInsMode()
Definition: wrtsh.hxx:170
bool IsSttOfPara() const
Definition: wrtsh.hxx:195
bool m_bSelWrd
Definition: wrtsh.hxx:589
void BwdPara()
Definition: wrtsh.hxx:235
@ BOOKMARK_INDEX
Definition: wrtsh.hxx:630
@ BOOKMARK_NEXT
Definition: wrtsh.hxx:631
void EndSelTableCells()
Definition: wrtsh.hxx:650
SAL_DLLPRIVATE bool BwdPara_()
Definition: wrtsh4.cxx:221
void NxtWrd(bool bSelect=false)
Definition: wrtsh.hxx:216
FieldDialogPressedButton
Definition: wrtsh.hxx:379
std::unique_ptr< CursorStack > m_pCursorStack
Definition: wrtsh.hxx:558
SELECTFUNC2 m_fnDrag
Definition: wrtsh.hxx:114
bool FwdPara_()
Definition: wrtsh4.cxx:210
Point m_aStart
Definition: wrtsh.hxx:595
void FwdSentence(bool bSelect=false)
Definition: wrtsh.hxx:237
SAL_DLLPRIVATE void LeaveExtSel()
Definition: wrtsh.hxx:622
bool IsModePushed() const
Definition: wrtsh.hxx:138
bool PrvWrd(bool bSelect=false)
Definition: wrtsh.hxx:217
SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false)
Definition: select.cxx:304
SwView & GetView()
Definition: wrtsh.hxx:438
void(SwWrtShell::* SELECTFUNC2)(const Point *, bool bProp)
Definition: wrtsh.hxx:112
bool Is_FnDragEQBeginDrag() const
Definition: wrtsh.hxx:658
void ResetCursorStack()
Definition: wrtsh.hxx:638
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:591
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:479
bool m_bExtMode
Definition: wrtsh.hxx:585
@ GETSTYLE_CREATESOME
Definition: wrtsh.hxx:361
Link< SwWrtShell &, void > m_aSelTableLink
Definition: wrtsh.hxx:596
bool m_bAddMode
Definition: wrtsh.hxx:586
bool IsBlockMode() const
Definition: wrtsh.hxx:167
SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp)
Definition: select.cxx:379
void MakeAllFoldedOutlineContentVisible(bool bMakeVisible=true)
Definition: wrtsh1.cxx:2478
bool IsInSelect() const
Definition: wrtsh.hxx:144
bool HasCursorStack() const
Definition: wrtsh.hxx:565
DECL_DLLPRIVATE_LINK(ExecFlyMac, const SwFlyFrameFormat *, void)
void BwdSentence(bool bSelect=false)
Definition: wrtsh.hxx:239
void SetRetainSelection(bool bRet)
Definition: wrtsh.hxx:276
bool m_bSelLn
Definition: wrtsh.hxx:590
SwView & m_rView
Definition: wrtsh.hxx:560
SwNavigationMgr m_aNavigationMgr
Definition: wrtsh.hxx:561
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:563
bool HasSelection() const
Definition: wrtsh.hxx:147
bool IsInsMode() const
Definition: wrtsh.hxx:171
SAL_DLLPRIVATE bool FwdSentence_()
Definition: wrtsh4.cxx:176
bool m_bIns
Definition: wrtsh.hxx:583
bool m_bClearMark
Definition: wrtsh.hxx:592
SAL_DLLPRIVATE void ResetCursorStack_()
Definition: move.cxx:533
bool IsAddMode() const
Definition: wrtsh.hxx:162
bool IsEndOfPara() const
Definition: wrtsh.hxx:196
bool IsExtSel() const
Definition: wrtsh.hxx:187
void SetInSelect()
Definition: wrtsh.hxx:145
bool m_bLayoutMode
Definition: wrtsh.hxx:588
bool IsInClickToEdit() const
Definition: wrtsh.hxx:656
bool m_bRetainSelection
Definition: wrtsh.hxx:593
@ MV_PAGE_UP
Definition: wrtsh.hxx:535
bool IsExtMode() const
Definition: wrtsh.hxx:157
bool m_bInSelect
Definition: wrtsh.hxx:584
const SwView & GetView() const
Definition: wrtsh.hxx:437
SwDocPositions
Definition: cshtyp.hxx:104
FindRanges
Definition: cshtyp.hxx:91
@ InBody
Find "one" only in body text.
#define CNT_OLE
Definition: editsh.hxx:131
#define CNT_TXT
Definition: editsh.hxx:129
#define CNT_GRF
Definition: editsh.hxx:130
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
sal_uIntPtr sal_uLong
std::unique_ptr< CursorStack > pNext
Definition: wrtsh.hxx:542
CursorStack(bool bValid, bool bFrameSel, const Point &rDocPos, SwTwips lOff, std::unique_ptr< CursorStack > pN)
Definition: wrtsh.hxx:547
ModeStack(ModeStack *pNextMode, bool _bIns, bool _bExt, bool _bAdd, bool _bBlock)
Definition: wrtsh.hxx:522
ModeStack * pNext
Definition: wrtsh.hxx:517
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
RndStdIds
tools::Long SwTwips
Definition: swtypes.hxx:51
FrameControlType
Definition: swtypes.hxx:234
LoadUrlFlags
Definition: swurl.hxx:27
sal_uInt16 sal_Unicode
SelectionType
Definition: wrtsh.hxx:65