Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / inc / view.hxx
blob301ed1a92bb8c3f59bad37bd5081ed084ebd54aa
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 .
19 #ifndef INCLUDED_SW_INC_VIEW_HXX
20 #define INCLUDED_SW_INC_VIEW_HXX
22 #include <vcl/timer.hxx>
23 #include <sfx2/viewsh.hxx>
24 #include <sfx2/objsh.hxx>
25 #include <editeng/svxenum.hxx>
26 #include <sfx2/zoomitem.hxx>
27 #include <svx/ruler.hxx>
28 #include <svx/fmshell.hxx>
29 #include <svx/svdobj.hxx>
30 #include <svl/style.hxx>
31 #include "swdllapi.h"
32 #include "swtypes.hxx"
33 #include "shellid.hxx"
35 class SwTextFormatColl;
36 class SwPageDesc;
37 class SwFrameFormat;
38 class SwCharFormat;
39 class SwNumRule;
40 class SwGlossaryHdl;
41 class SwDrawBase;
42 class SvxLRSpaceItem;
43 class SwDocShell;
44 class SwScrollbar;
45 class SvBorder;
46 class Ruler;
47 class SvxSearchItem;
48 class SearchAttrItemList;
49 class SvxSearchDialog;
50 class SdrView;
51 class SdrPageView;
52 class SwEditWin;
53 class SwWrtShell;
54 class SwView_Impl;
55 struct SwSearchOptions;
56 class CommandEvent;
57 class InsCaptionOpt;
58 class SvGlobalName;
59 class SvtAccessibilityOptions;
60 class SwTransferable;
61 class SwMailMergeConfigItem;
62 class SwTextNode; // #i23726#
63 class SwFormatClipboard;
64 struct SwConversionArgs;
65 class GraphicFilter;
66 class SwPostItMgr;
67 enum class SotExchangeDest;
68 class SwCursorShell;
69 enum class SvxSearchCmd;
70 enum class SelectionType : sal_Int32;
72 namespace com::sun::star::view { class XSelectionSupplier; }
73 namespace sfx2 { class FileDialogHelper; }
74 namespace sw::mark { class IFieldmark; }
75 namespace weld { class Scrollbar; }
77 const tools::Long nLeftOfst = -370;
78 const tools::Long nScrollX = 30;
79 const tools::Long nScrollY = 30;
81 #define MINZOOM 20
82 #define MAXZOOM 600
84 #define MAX_MARKS 5
86 enum class ShellMode
88 Text,
89 Frame,
90 Graphic,
91 Object,
92 Draw,
93 DrawForm,
94 DrawText,
95 Bezier,
96 ListText,
97 TableText,
98 TableListText,
99 Media,
100 ExtrudedCustomShape,
101 FontWork,
102 PostIt
105 // apply a template
106 struct SwApplyTemplate
108 union
110 SwTextFormatColl* pTextColl;
111 SwPageDesc* pPageDesc;
112 SwFrameFormat* pFrameFormat;
113 SwCharFormat* pCharFormat;
114 SwNumRule* pNumRule;
115 } aColl;
117 SfxStyleFamily eType;
118 sal_uInt16 nColor;
119 SwFormatClipboard* m_pFormatClipboard;
120 size_t nUndo; //< The initial undo stack depth.
122 SwApplyTemplate() :
123 eType(SfxStyleFamily::None),
124 nColor(0),
125 m_pFormatClipboard(nullptr),
126 nUndo(0)
128 aColl.pTextColl = nullptr;
132 class SwView;
134 // manage connection and disconnection of SwView and SwDocShell
135 class SwViewGlueDocShell
137 private:
138 SwView& m_rView;
139 public:
140 SwViewGlueDocShell(SwView& rView, SwDocShell& rDocSh);
141 ~SwViewGlueDocShell();
144 // view of a document
145 class SW_DLLPUBLIC SwView: public SfxViewShell
147 friend class SwHHCWrapper;
148 friend class SwHyphWrapper;
149 friend class SwView_Impl;
150 friend class SwClipboardChangeListener;
152 // selection cycle
153 struct SelectCycle
155 Point m_pInitialCursor;
156 Point m_MarkPt;
157 Point m_PointPt;
158 sal_uInt16 nStep;
160 SelectCycle() :
161 nStep(0) {}
164 // search & replace
165 static SvxSearchItem *s_pSrchItem;
167 static sal_uInt16 s_nMoveType; // for buttons below the scrollbar (viewmdi)
168 static sal_Int32 s_nActMark; // current jump mark for unknown mark
170 static bool s_bExtra;
171 static bool s_bFound;
172 static bool s_bJustOpened;
174 static std::unique_ptr<SearchAttrItemList> s_xSearchList;
175 static std::unique_ptr<SearchAttrItemList> s_xReplaceList;
177 Timer m_aTimer; // for delayed ChgLnks during an action
178 OUString m_sSwViewData,
179 //and the new cursor position if the user double click in the PagePreview
180 m_sNewCursorPos;
181 // to support keyboard the number of the page to go to can be set too
182 sal_uInt16 m_nNewPage;
184 sal_uInt16 m_nOldPageNum;
185 OUString m_sOldSectionName;
187 Point m_aTabColFromDocPos; // moving table columns out of the document
188 SwTextNode * m_pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
190 Size m_aDocSz; // current document size
191 tools::Rectangle m_aVisArea; // visible region
193 VclPtr<SwEditWin> m_pEditWin;
194 std::unique_ptr<SwWrtShell> m_pWrtShell;
195 std::unique_ptr<SwViewGlueDocShell> m_xGlueDocShell;
197 SfxShell *m_pShell; // current SubShell at the dispatcher
198 FmFormShell *m_pFormShell; // DB-FormShell
200 std::unique_ptr<SwView_Impl> m_pViewImpl; // Impl-data for UNO + Basic
202 VclPtr<SwScrollbar> m_pHScrollbar, // MDI control elements
203 m_pVScrollbar;
205 bool m_bHScrollbarEnabled;
206 bool m_bVScrollbarEnabled;
208 VclPtr<SvxRuler> m_pHRuler,
209 m_pVRuler;
211 std::unique_ptr<SwGlossaryHdl> m_pGlosHdl; // handle text block
212 std::unique_ptr<SwDrawBase> m_pDrawActual;
214 const SwFrameFormat *m_pLastTableFormat;
215 const SwFrameFormat* m_pLastFlyFormat;
217 std::unique_ptr<SwFormatClipboard> m_pFormatClipboard; //holds data for format paintbrush
219 std::unique_ptr<SwPostItMgr> m_pPostItMgr;
221 SelectionType m_nSelectionType;
222 sal_uInt16 m_nPageCnt;
224 // current draw mode
225 sal_uInt16 m_nDrawSfxId;
226 OUString m_sDrawCustom; //some drawing types are marked with strings!
227 sal_uInt16 m_nFormSfxId;
228 SdrObjKind m_eFormObjKind;
229 SotExchangeDest m_nLastPasteDestination;
231 // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
232 sal_uInt16 m_nLeftBorderDistance;
233 sal_uInt16 m_nRightBorderDistance;
235 SvxSearchCmd m_eLastSearchCommand;
237 bool m_bWheelScrollInProgress;
238 double m_fLastZoomScale = 0;
239 double m_fAccumulatedZoom = 0;
241 bool m_bCenterCursor : 1,
242 m_bTopCursor : 1,
243 m_bTabColFromDoc : 1,
244 m_bTabRowFromDoc : 1,
245 m_bSetTabColFromDoc : 1 ,
246 m_bSetTabRowFromDoc : 1,
247 m_bAttrChgNotified : 1,
248 m_bAttrChgNotifiedWithRegistrations : 1,
249 m_bVerbsActive : 1,
250 m_bDrawRotate : 1,
251 m_bDrawSelMode : 1,
252 m_bShowAtResize : 1,
253 m_bInOuterResizePixel : 1,
254 m_bInInnerResizePixel : 1,
255 m_bPasteState : 1,
256 m_bPasteSpecialState : 1,
257 m_bInMailMerge : 1,
258 m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
259 m_bOldShellWasPagePreview : 1,
260 m_bIsPreviewDoubleClick : 1, // #i114045#
261 m_bMakeSelectionVisible : 1, // transport the bookmark selection
262 m_bForceChangesToolbar : 1; // on load of documents with change tracking
263 bool m_bInitOnceCompleted = false;
265 /// LibreOfficeKit has to force the page size for PgUp/PgDown
266 /// functionality based on the user's view, instead of using the m_aVisArea.
267 SwTwips m_nLOKPageUpDownOffset;
269 SelectCycle m_aSelectCycle;
271 int m_nMaxOutlineLevelShown = 10;
273 bool m_bIsHighlightCharDF = false;
275 static constexpr sal_uInt16 MAX_ZOOM_PERCENT = 600;
276 static constexpr sal_uInt16 MIN_ZOOM_PERCENT = 20;
278 // methods for searching
279 // set search context
280 SAL_DLLPRIVATE bool SearchAndWrap(bool bApi);
281 SAL_DLLPRIVATE sal_uInt16 SearchAll();
282 SAL_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
283 SAL_DLLPRIVATE void Replace();
285 bool IsDocumentBorder();
287 SAL_DLLPRIVATE bool IsTextTool() const;
289 DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
291 inline tools::Long GetXScroll() const;
292 inline tools::Long GetYScroll() const;
293 SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
294 SAL_DLLPRIVATE void CalcPt( Point* pPt,const tools::Rectangle& rRect,
295 sal_uInt16 nRangeX,
296 sal_uInt16 nRangeY);
298 SAL_DLLPRIVATE bool GetPageScrollUpOffset(SwTwips& rOff) const;
299 SAL_DLLPRIVATE bool GetPageScrollDownOffset(SwTwips& rOff) const;
301 // scrollbar movements
302 SAL_DLLPRIVATE bool PageUp();
303 SAL_DLLPRIVATE bool PageDown();
304 SAL_DLLPRIVATE bool PageUpCursor(bool bSelect);
305 SAL_DLLPRIVATE bool PageDownCursor(bool bSelect);
306 SAL_DLLPRIVATE void PhyPageUp();
307 SAL_DLLPRIVATE void PhyPageDown();
309 SAL_DLLPRIVATE void CreateScrollbar( bool bHori );
310 DECL_DLLPRIVATE_LINK(HoriScrollHdl, weld::Scrollbar&, void);
311 DECL_DLLPRIVATE_LINK(VertScrollHdl, weld::Scrollbar&, void);
312 SAL_DLLPRIVATE void EndScrollHdl(weld::Scrollbar& rScrollbar, bool bHorizontal);
313 SAL_DLLPRIVATE bool UpdateScrollbars();
314 DECL_DLLPRIVATE_LINK( WindowChildEventListener, VclWindowEvent&, void );
315 SAL_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
317 // linguistics functions
318 SAL_DLLPRIVATE void HyphenateDocument();
319 SAL_DLLPRIVATE bool IsDrawTextHyphenate();
320 SAL_DLLPRIVATE void HyphenateDrawText();
321 SAL_DLLPRIVATE void StartThesaurus();
323 // text conversion
324 SAL_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
326 // used for spell checking and text conversion
327 SAL_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, bool bStartDone,
328 bool bEndDone, SwConversionArgs *pConvArgs );
329 SAL_DLLPRIVATE void SpellEnd( SwConversionArgs const *pConvArgs );
331 SAL_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
332 SAL_DLLPRIVATE void SpellContext(bool bOn = true)
333 { m_bCenterCursor = bOn; }
335 // for readonly switching
336 SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
337 SAL_DLLPRIVATE void CheckReadonlyState();
338 SAL_DLLPRIVATE void CheckReadonlySelection();
340 // method for rotating PageDesc
341 SAL_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
343 SAL_DLLPRIVATE void SetZoom_( const Size &rEditSz,
344 SvxZoomType eZoomType,
345 short nFactor,
346 bool bViewOnly);
347 SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill );
349 SAL_DLLPRIVATE void ShowAtResize();
351 SAL_DLLPRIVATE virtual void Move() override;
353 public: // #i123922# Needs to be called from a 2nd place now as a helper method
354 SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& );
356 protected:
358 SwView_Impl* GetViewImpl() {return m_pViewImpl.get();}
360 void ImpSetVerb( SelectionType nSelType );
362 SelectionType GetSelectionType() const { return m_nSelectionType; }
363 void SetSelectionType(SelectionType nSet) { m_nSelectionType = nSet;}
365 // for SwWebView
366 void SetShell( SfxShell* pS ) { m_pShell = pS; }
367 void SetFormShell( FmFormShell* pSh ) { m_pFormShell = pSh; }
369 virtual void SelectShell();
371 virtual void Activate(bool) override;
372 virtual void Deactivate(bool) override;
373 virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
374 virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
376 const SwFrameFormat* GetLastTableFrameFormat() const {return m_pLastTableFormat;}
377 void SetLastTableFrameFormat(const SwFrameFormat* pSet) {m_pLastTableFormat = pSet;}
379 // form letter execution
380 void GenerateFormLetter(bool bUseCurrentDocument);
382 using SfxShell::GetDispatcher;
384 public:
385 SFX_DECL_VIEWFACTORY(SwView);
386 SFX_DECL_INTERFACE(SW_VIEWSHELL)
388 private:
389 /// SfxInterface initializer.
390 static void InitInterface_Impl();
392 public:
393 SfxDispatcher &GetDispatcher();
395 void GotFocus() const;
396 virtual SdrView* GetDrawView() const override;
397 virtual bool HasUIFeature(SfxShellFeature nFeature) const override;
398 virtual void ShowCursor( bool bOn = true ) override;
399 virtual ErrCode DoVerb(sal_Int32 nVerb) override;
401 virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
402 SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override;
403 ShellMode GetShellMode() const;
405 css::view::XSelectionSupplier* GetUNOObject();
407 OUString GetSelectionTextParam( bool bCompleteWords,
408 bool bEraseTrail );
409 virtual bool HasSelection( bool bText = true ) const override;
410 virtual OUString GetSelectionText( bool bCompleteWords = false, bool bOnlyASample = false ) override;
411 virtual bool PrepareClose( bool bUI = true ) override;
412 virtual void MarginChanged() override;
414 // replace word/selection with text from the thesaurus
415 // (this code has special handling for "in word" character)
416 void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
417 bool IsValidSelectionForThesaurus() const;
418 OUString GetThesaurusLookUpText( bool bSelection ) const;
420 // immediately switch shell -> for GetSelectionObject
421 void StopShellTimer();
423 SwWrtShell& GetWrtShell () const { return *m_pWrtShell; }
424 SwWrtShell* GetWrtShellPtr() const { return m_pWrtShell.get(); }
426 SwEditWin &GetEditWin() { return *m_pEditWin; }
427 const SwEditWin &GetEditWin () const { return *m_pEditWin; }
429 #if defined(_WIN32) || defined UNX
430 void ScannerEventHdl();
431 #endif
433 // hand the handler for text blocks to the shell; create if applicable
434 SwGlossaryHdl* GetGlosHdl();
436 const tools::Rectangle& GetVisArea() const { return m_aVisArea; }
438 bool IsScroll(const tools::Rectangle& rRect) const;
439 void Scroll( const tools::Rectangle& rRect,
440 sal_uInt16 nRangeX = USHRT_MAX,
441 sal_uInt16 nRangeY = USHRT_MAX);
443 tools::Long SetVScrollMax(tools::Long lMax);
444 tools::Long SetHScrollMax(tools::Long lMax);
446 void SpellError(LanguageType eLang);
447 bool ExecSpellPopup( const Point& rPt );
448 void ExecSmartTagPopup( const Point& rPt );
450 DECL_DLLPRIVATE_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
451 bool ExecDrwTextSpellPopup(const Point& rPt);
453 void SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
454 void SetTabColFromDoc( bool b ) { m_bTabColFromDoc = b; }
455 bool IsTabColFromDoc() const { return m_bTabColFromDoc; }
456 void SetTabRowFromDoc( bool b ) { m_bTabRowFromDoc = b; }
457 bool IsTabRowFromDoc() const { return m_bTabRowFromDoc; }
459 void SetNumRuleNodeFromDoc( SwTextNode * pNumRuleNode )
460 { m_pNumRuleNodeFromDoc = pNumRuleNode; }
462 void DocSzChgd( const Size& rNewSize );
463 const Size& GetDocSz() const { return m_aDocSz; }
464 void SetVisArea( const tools::Rectangle&, bool bUpdateScrollbar = true);
465 void SetVisArea( const Point&, bool bUpdateScrollbar = true);
466 void CheckVisArea();
468 void RecheckBrowseMode();
469 static SvxSearchDialog* GetSearchDialog();
471 static sal_uInt16 GetMoveType();
472 static void SetMoveType(sal_uInt16 nSet);
473 DECL_DLLPRIVATE_LINK( MoveNavigationHdl, void*, void );
474 static void SetActMark(sal_Int32 nSet);
476 bool HandleWheelCommands( const CommandEvent& );
477 bool HandleGestureZoomCommand(const CommandEvent&);
479 // insert frames
480 void InsFrameMode(sal_uInt16 nCols);
482 void SetZoom( SvxZoomType eZoomType, short nFactor = 100, bool bViewOnly = false);
483 virtual void SetZoomFactor( const Fraction &rX, const Fraction & ) override;
485 void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly = false );
487 void ShowHScrollbar(bool bShow);
488 bool IsHScrollbarVisible()const;
490 void ShowVScrollbar(bool bShow);
491 bool IsVScrollbarVisible()const;
493 void EnableHScrollbar(bool bEnable);
494 void EnableVScrollbar(bool bEnable);
496 void CreateVRuler();
497 void KillVRuler();
498 void CreateTab();
499 void KillTab();
501 bool StatVRuler() const { return m_pVRuler->IsVisible(); }
502 void ChangeVRulerMetric(FieldUnit eUnit);
503 void GetVRulerMetric(FieldUnit& rToFill) const;
505 SvxRuler& GetHRuler() { return *m_pHRuler; }
506 SvxRuler& GetVRuler() { return *m_pVRuler; }
507 void InvalidateRulerPos();
508 void ChangeTabMetric(FieldUnit eUnit);
509 void GetHRulerMetric(FieldUnit& rToFill) const;
511 // Handler
512 void Execute(SfxRequest&);
513 void ExecLingu(SfxRequest&);
514 void ExecDlg(SfxRequest const &);
515 void ExecDlgExt(SfxRequest const &);
516 void ExecColl(SfxRequest const &);
517 void ExecutePrint(SfxRequest&);
518 void ExecDraw(const SfxRequest&);
519 void ExecTabWin(SfxRequest const &);
520 void ExecuteStatusLine(SfxRequest&);
521 DECL_DLLPRIVATE_LINK( ExecRulerClick, Ruler *, void );
522 void ExecSearch(SfxRequest&);
523 void ExecViewOptions(SfxRequest &);
525 virtual bool IsConditionalFastCall( const SfxRequest &rReq ) override;
527 void StateViewOptions(SfxItemSet &);
528 void StateSearch(SfxItemSet &);
529 void GetState(SfxItemSet&);
530 void StateStatusLine(SfxItemSet&);
531 void UpdateWordCount(SfxShell*, sal_uInt16);
532 void ExecFormatFootnote();
533 void ExecNumberingOutline(SfxItemPool &);
535 // functions for drawing
536 void SetDrawFuncPtr(std::unique_ptr<SwDrawBase> pFuncPtr);
537 SwDrawBase* GetDrawFuncPtr() const { return m_pDrawActual.get(); }
538 void GetDrawState(SfxItemSet &rSet);
539 void ExitDraw();
540 bool IsDrawRotate() const { return m_bDrawRotate; }
541 void FlipDrawRotate() { m_bDrawRotate = !m_bDrawRotate; }
542 bool IsDrawSelMode() const { return m_bDrawSelMode; }
543 void SetSelDrawSlot();
544 void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
545 void NoRotate(); // turn off rotate mode
546 bool EnterDrawTextMode(const Point& aDocPos);
547 /// Same as EnterDrawTextMode(), but takes an SdrObject instead of guessing it by document position.
548 bool EnterShapeDrawTextMode(SdrObject* pObject);
549 void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear(); m_eFormObjKind = SdrObjKind::NONE; }
550 bool IsDrawMode() const { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
551 bool IsFormMode() const;
552 bool IsBezierEditMode() const;
553 bool AreOnlyFormsSelected() const;
554 bool HasOnlyObj(SdrObject const *pSdrObj, SdrInventor eObjInventor) const;
555 bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=nullptr,
556 vcl::Window* pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false );
557 bool isSignatureLineSelected() const;
558 bool isSignatureLineSigned() const;
559 bool isQRCodeSelected() const;
561 void StateTabWin(SfxItemSet&);
563 // attributes have changed
564 DECL_LINK( AttrChangedNotify, LinkParamNone*, void );
566 // form control has been activated
567 DECL_DLLPRIVATE_LINK( FormControlActivated, LinkParamNone*, void );
569 // edit links
570 void EditLinkDlg();
571 void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = nullptr);
572 void InsertCaption(const InsCaptionOpt *pOpt);
574 // Async call by Core
575 void UpdatePageNums();
577 OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
579 /// Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea.
580 void ForcePageUpDownOffset(SwTwips nTwips)
582 m_nLOKPageUpDownOffset = nTwips;
585 // hand over Shell
586 SfxShell *GetCurShell() { return m_pShell; }
587 SwDocShell *GetDocShell();
588 inline const SwDocShell *GetDocShell() const;
589 virtual FmFormShell *GetFormShell() override { return m_pFormShell; }
590 virtual const FmFormShell *GetFormShell() const override { return m_pFormShell; }
592 // so that in the SubShells' DTors m_pShell can be reset if applicable
593 void ResetSubShell() { m_pShell = nullptr; }
595 virtual void WriteUserData(OUString &, bool bBrowse = false) override;
596 virtual void ReadUserData(const OUString &, bool bBrowse = false) override;
597 virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ) override;
598 virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ) override;
600 void SetCursorAtTop( bool bFlag, bool bCenter = false )
601 { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
603 bool JumpToSwMark( std::u16string_view rMark );
605 tools::Long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
606 const OUString& rFilterName, sal_Int16 nVersion = 0 );
608 void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
609 tools::Long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
610 DECL_DLLPRIVATE_LINK( DialogClosedHdl, sfx2::FileDialogHelper *, void );
612 // status methods for clipboard.
613 // Status changes now notified from the clipboard.
614 bool IsPasteAllowed();
615 bool IsPasteSpecialAllowed();
616 bool IsPasteSpreadsheet(bool bHasOwnTableCopied);
618 // Enable mail merge - mail merge field dialog enabled
619 void EnableMailMerge();
620 //apply Accessibility options
621 void ApplyAccessibilityOptions();
623 SwView(SfxViewFrame& rFrame, SfxViewShell*);
624 virtual ~SwView() override;
626 void NotifyDBChanged();
628 SfxObjectShellLock CreateTmpSelectionDoc();
630 void AddTransferable(SwTransferable& rTransferable);
632 // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
633 // or to support printing
634 void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem> const & rConfigItem);
635 std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const;
636 std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr);
638 OUString GetDataSourceName() const;
639 static bool IsDataSourceAvailable(const OUString sDataSourceName);
641 void ExecFormatPaintbrush(SfxRequest const &);
642 void StateFormatPaintbrush(SfxItemSet &);
644 // public for D&D
645 ErrCode InsertGraphic( const OUString &rPath, const OUString &rFilter,
646 bool bLink, GraphicFilter *pFlt );
648 void ExecuteScan( SfxRequest& rReq );
650 SwPostItMgr* GetPostItMgr() { return m_pPostItMgr.get();}
651 const SwPostItMgr* GetPostItMgr() const { return m_pPostItMgr.get();}
653 // exhibition hack (MA,MBA)
654 void SelectShellForDrop();
656 void UpdateDocStats();
658 void SetMaxOutlineLevelShown(int nLevel) {m_nMaxOutlineLevelShown = nLevel;}
659 int GetMaxOutlineLevelShown() const {return m_nMaxOutlineLevelShown;}
661 // methods for printing
662 SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) override;
663 SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const override;
664 SAL_DLLPRIVATE virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
665 const SfxItemSet& rSet) override;
666 static SvxSearchItem* GetSearchItem() { return s_pSrchItem; }
667 /// See SfxViewShell::getPart().
668 int getPart() const override;
669 /// See SfxViewShell::dumpAsXml().
670 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
671 void SetRedlineAuthor(const OUString& rAuthor);
672 const OUString& GetRedlineAuthor() const;
673 /// See SfxViewShell::afterCallbackRegistered().
674 void afterCallbackRegistered() override;
675 /// See SfxViewShell::NotifyCursor().
676 void NotifyCursor(SfxViewShell* pViewShell) const override;
677 void ShowUIElement(const OUString& sElementURL) const;
680 enum CachedStringID
682 OldGrfCat,
683 OldTabCat,
684 OldFrameCat,
685 OldDrwCat,
686 CachedStrings
689 OUString m_StringCache[CachedStrings];
691 const OUString& GetCachedString(CachedStringID id)
693 return m_StringCache[id];
696 void SetCachedString(CachedStringID id, const OUString& sStr)
698 m_StringCache[id] = sStr;
701 const OUString& GetOldGrfCat();
702 void SetOldGrfCat(const OUString& sStr);
703 const OUString& GetOldTabCat();
704 void SetOldTabCat(const OUString& sStr);
705 const OUString& GetOldFrameCat();
706 void SetOldFrameCat(const OUString& sStr);
707 const OUString& GetOldDrwCat();
708 void SetOldDrwCat(const OUString& sStr);
710 virtual tools::Rectangle getLOKVisibleArea() const override;
711 virtual void flushPendingLOKInvalidateTiles() override;
712 virtual std::optional<OString> getLOKPayload(int nType, int nViewId) const override;
714 bool IsHighlightCharDF() { return m_bIsHighlightCharDF; }
717 inline tools::Long SwView::GetXScroll() const
719 return (m_aVisArea.GetWidth() * nScrollX) / 100;
722 inline tools::Long SwView::GetYScroll() const
724 return (m_aVisArea.GetHeight() * nScrollY) / 100;
727 inline const SwDocShell *SwView::GetDocShell() const
729 return const_cast<SwView*>(this)->GetDocShell();
732 std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
733 const SfxItemSet &rOptions,
734 bool bPreview);
736 extern bool bDocSzUpdated;
738 #endif
740 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */