Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / sw / inc / view.hxx
blob55f87ec829376c42d9791be7f08db784921342f7
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 <vcl/field.hxx>
24 #include <vcl/floatwin.hxx>
25 #include <svtools/htmlcfg.hxx>
26 #include <sfx2/viewfac.hxx>
27 #include <sfx2/viewsh.hxx>
28 #include <sfx2/objsh.hxx>
29 #include <editeng/svxenum.hxx>
30 #include <sfx2/zoomitem.hxx>
31 #include <svx/ruler.hxx>
32 #include <svx/svxids.hrc>
33 #include <svx/fmshell.hxx>
34 #include <editeng/editstat.hxx>
35 #include "swdllapi.h"
36 #include <swtypes.hxx>
37 #include <shellid.hxx>
38 #include <IMark.hxx>
40 class Button;
41 class ImageButton;
42 class SwTextFormatColl;
43 class SwPageDesc;
44 class SwFrameFormat;
45 class SwCharFormat;
46 class SwNumRule;
47 class SwGlossaryHdl;
48 class SwDrawBase;
49 class SvxRuler;
50 class SvxLRSpaceItem;
51 class SwDocShell;
52 class SwScrollbar;
53 class SvBorder;
54 class Ruler;
55 class SvxSearchItem;
56 class SearchAttrItemList;
57 class SvxSearchDialog;
58 class SdrView;
59 class Dialog;
60 class SdrObject;
61 class SdrPageView;
62 class SwHlpImageButton;
63 class SwView;
64 class SwEditWin;
65 class SwWrtShell;
66 class SwView_Impl;
67 struct SwSearchOptions;
68 class CommandEvent;
69 class InsCaptionOpt;
70 class SvGlobalName;
71 class SvtAccessibilityOptions;
72 class SwTransferable;
73 class SwMailMergeConfigItem;
74 class SwTextNode; // #i23726#
75 class SwFormatClipboard;
76 struct SwConversionArgs;
77 class Graphic;
78 class GraphicFilter;
79 class SwPostItMgr;
80 enum class SotExchangeDest;
81 class SwCursorShell;
82 enum class SvxSearchCmd;
83 enum class SelectionType : sal_Int32;
85 namespace com{ namespace sun { namespace star {
86 namespace view{ class XSelectionSupplier; }
87 }}}
88 namespace sfx2 { class FileDialogHelper; }
90 const long nLeftOfst = -370;
91 const long nScrollX = 30;
92 const long nScrollY = 30;
94 #define MINZOOM 20
95 #define MAXZOOM 600
97 #define MAX_MARKS 5
99 enum class ShellMode
101 Text,
102 Frame,
103 Graphic,
104 Object,
105 Draw,
106 DrawForm,
107 DrawText,
108 Bezier,
109 ListText,
110 TableText,
111 TableListText,
112 Media,
113 ExtrudedCustomShape,
114 FontWork,
115 PostIt
118 // apply a template
119 struct SwApplyTemplate
121 union
123 SwTextFormatColl* pTextColl;
124 SwPageDesc* pPageDesc;
125 SwFrameFormat* pFrameFormat;
126 SwCharFormat* pCharFormat;
127 SwNumRule* pNumRule;
128 } aColl;
130 SfxStyleFamily eType;
131 sal_uInt16 nColor;
132 SwFormatClipboard* m_pFormatClipboard;
133 size_t nUndo; //< The initial undo stack depth.
135 SwApplyTemplate() :
136 eType(SfxStyleFamily::None),
137 nColor(0),
138 m_pFormatClipboard(nullptr),
139 nUndo(0)
141 aColl.pTextColl = nullptr;
145 // view of a document
146 class SW_DLLPUBLIC SwView: public SfxViewShell
148 friend class SwHHCWrapper;
149 friend class SwHyphWrapper;
150 friend class SwView_Impl;
151 friend class SwClipboardChangeListener;
153 // search & replace
154 static SvxSearchItem *m_pSrchItem;
156 static sal_uInt16 m_nMoveType; // for buttons below the scrollbar (viewmdi)
157 static sal_Int32 m_nActMark; // current jump mark for unknown mark
159 static bool m_bExtra;
160 static bool m_bFound;
161 static bool m_bJustOpened;
163 static SearchAttrItemList* m_pSrchList;
164 static SearchAttrItemList* m_pReplList;
166 Timer m_aTimer; // for delayed ChgLnks during an action
167 OUString m_sSwViewData,
168 //and the new cursor position if the user double click in the PagePreview
169 m_sNewCursorPos;
170 // to support keyboard the number of the page to go to can be set too
171 sal_uInt16 m_nNewPage;
173 sal_uInt16 m_nOldPageNum;
174 OUString m_sOldSectionName;
176 Point m_aTabColFromDocPos; // moving table columns out of the document
177 SwTextNode * m_pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
179 Size m_aDocSz; // current document size
180 tools::Rectangle m_aVisArea; // visible region
182 VclPtr<SwEditWin> m_pEditWin;
183 SwWrtShell *m_pWrtShell;
185 SfxShell *m_pShell; // current SubShell at the dispatcher
186 FmFormShell *m_pFormShell; // DB-FormShell
188 SwView_Impl *m_pViewImpl; // Impl-data for UNO + Basic
190 VclPtr<SwScrollbar> m_pHScrollbar, // MDI control elements
191 m_pVScrollbar;
193 bool m_bHScrollbarEnabled;
194 bool m_bVScrollbarEnabled;
196 VclPtr<vcl::Window> m_pScrollFill; // dummy window for filling the lower right edge
197 // when both scrollbars are active
199 VclPtr<SvxRuler> m_pHRuler,
200 m_pVRuler;
201 VclPtr<ImageButton> m_pTogglePageBtn;
203 SwGlossaryHdl *m_pGlosHdl; // handle text block
204 SwDrawBase *m_pDrawActual;
206 const SwFrameFormat *m_pLastTableFormat;
208 SwFormatClipboard *m_pFormatClipboard; //holds data for format paintbrush
210 SwPostItMgr *m_pPostItMgr;
212 SelectionType m_nSelectionType;
213 VclPtr<FloatingWindow> m_pFieldPopup;
214 sal_uInt16 m_nPageCnt;
216 // current draw mode
217 sal_uInt16 m_nDrawSfxId;
218 OUString m_sDrawCustom; //some drawing types are marked with strings!
219 sal_uInt16 m_nFormSfxId;
220 SotExchangeDest m_nLastPasteDestination;
222 // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
223 sal_uInt16 m_nLeftBorderDistance;
224 sal_uInt16 m_nRightBorderDistance;
226 SvxSearchCmd m_eLastSearchCommand;
228 bool m_bWheelScrollInProgress;
230 bool m_bCenterCursor : 1,
231 m_bTopCursor : 1,
232 m_bAlwaysShowSel : 1,
233 m_bTabColFromDoc : 1,
234 m_bTabRowFromDoc : 1,
235 m_bSetTabColFromDoc : 1 ,
236 m_bSetTabRowFromDoc : 1,
237 m_bAttrChgNotified : 1,
238 m_bAttrChgNotifiedWithRegistrations : 1,
239 m_bVerbsActive : 1,
240 m_bDrawRotate : 1,
241 m_bDrawSelMode : 1,
242 m_bShowAtResize : 1,
243 m_bInOuterResizePixel : 1,
244 m_bInInnerResizePixel : 1,
245 m_bPasteState : 1,
246 m_bPasteSpecialState : 1,
247 m_bInMailMerge : 1,
248 m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
249 m_bOldShellWasPagePreview : 1,
250 m_bIsPreviewDoubleClick : 1, // #i114045#
251 m_bMakeSelectionVisible : 1, // transport the bookmark selection
252 m_bAnnotationMode; ///< The real cursor position is inside an annotation.
254 /// LibreOfficeKit has to force the page size for PgUp/PgDown
255 /// functionality based on the user's view, instead of using the m_aVisArea.
256 SwTwips m_nLOKPageUpDownOffset;
258 // methods for searching
259 // set search context
260 SAL_DLLPRIVATE bool SearchAndWrap(bool bApi);
261 SAL_DLLPRIVATE bool SearchAll();
262 SAL_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
263 SAL_DLLPRIVATE void Replace();
265 bool IsDocumentBorder();
267 SAL_DLLPRIVATE bool IsTextTool() const;
269 DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
271 DECL_DLLPRIVATE_LINK( FieldPopupModeEndHdl, FloatingWindow*, void );
273 inline long GetXScroll() const;
274 inline long GetYScroll() const;
275 SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
276 SAL_DLLPRIVATE void CalcPt( Point* pPt,const tools::Rectangle& rRect,
277 sal_uInt16 nRangeX,
278 sal_uInt16 nRangeY);
280 SAL_DLLPRIVATE bool GetPageScrollUpOffset(SwTwips& rOff) const;
281 SAL_DLLPRIVATE bool GetPageScrollDownOffset(SwTwips& rOff) const;
283 // scrollbar movements
284 SAL_DLLPRIVATE long PageUp();
285 SAL_DLLPRIVATE long PageDown();
286 SAL_DLLPRIVATE bool PageUpCursor(bool bSelect);
287 SAL_DLLPRIVATE bool PageDownCursor(bool bSelect);
288 SAL_DLLPRIVATE long PhyPageUp();
289 SAL_DLLPRIVATE long PhyPageDown();
291 SAL_DLLPRIVATE void CreateScrollbar( bool bHori );
292 DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar*, void );
293 DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar*, void );
294 SAL_DLLPRIVATE bool UpdateScrollbars();
295 DECL_DLLPRIVATE_LINK( WindowChildEventListener, VclWindowEvent&, void );
296 SAL_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
298 // linguistics functions
299 SAL_DLLPRIVATE void HyphenateDocument();
300 SAL_DLLPRIVATE bool IsDrawTextHyphenate();
301 SAL_DLLPRIVATE void HyphenateDrawText();
302 SAL_DLLPRIVATE void StartThesaurus();
304 // text conversion
305 SAL_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
307 // used for spell checking and text conversion
308 SAL_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, bool bStartDone,
309 bool bEndDone, SwConversionArgs *pConvArgs );
310 SAL_DLLPRIVATE void SpellEnd( SwConversionArgs *pConvArgs );
312 SAL_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
313 SAL_DLLPRIVATE void SpellKontext(bool bOn = true)
314 { m_bCenterCursor = bOn; m_bAlwaysShowSel = bOn; }
316 // for readonly switching
317 SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
318 SAL_DLLPRIVATE void CheckReadonlyState();
319 SAL_DLLPRIVATE void CheckReadonlySelection();
321 // method for rotating PageDesc
322 SAL_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
324 SAL_DLLPRIVATE void SetZoom_( const Size &rEditSz,
325 SvxZoomType eZoomType,
326 short nFactor,
327 bool bViewOnly);
328 SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill );
330 SAL_DLLPRIVATE void ShowAtResize();
332 SAL_DLLPRIVATE virtual void Move() override;
334 public: // #i123922# Needs to be called from a 2nd place now as a helper method
335 SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& );
337 protected:
339 SwView_Impl* GetViewImpl() {return m_pViewImpl;}
341 void ImpSetVerb( SelectionType nSelType );
343 SelectionType GetSelectionType() const { return m_nSelectionType; }
344 void SetSelectionType(SelectionType nSet) { m_nSelectionType = nSet;}
346 // for SwWebView
347 void SetShell( SfxShell* pS ) { m_pShell = pS; }
348 void SetFormShell( FmFormShell* pSh ) { m_pFormShell = pSh; }
350 virtual void SelectShell();
352 virtual void Activate(bool) override;
353 virtual void Deactivate(bool) override;
354 virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
355 virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
357 const SwFrameFormat* GetLastTableFrameFormat() const {return m_pLastTableFormat;}
358 void SetLastTableFrameFormat(const SwFrameFormat* pSet) {m_pLastTableFormat = pSet;}
360 // form letter execution
361 void GenerateFormLetter(bool bUseCurrentDocument);
363 using SfxShell::GetDispatcher;
365 public:
366 SFX_DECL_VIEWFACTORY(SwView);
367 SFX_DECL_INTERFACE(SW_VIEWSHELL)
369 private:
370 /// SfxInterface initializer.
371 static void InitInterface_Impl();
373 public:
374 SfxDispatcher &GetDispatcher();
376 void GotFocus() const;
377 virtual SdrView* GetDrawView() const override;
378 virtual bool HasUIFeature(SfxShellFeature nFeature) const override;
379 virtual void ShowCursor( bool bOn = true ) override;
380 virtual ErrCode DoVerb( long nVerb ) override;
382 virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
383 SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override;
384 ShellMode GetShellMode();
386 css::view::XSelectionSupplier* GetUNOObject();
388 OUString GetSelectionTextParam( bool bCompleteWords,
389 bool bEraseTrail );
390 virtual bool HasSelection( bool bText = true ) const override;
391 virtual OUString GetSelectionText( bool bCompleteWords = false ) override;
392 virtual bool PrepareClose( bool bUI = true ) override;
393 virtual void MarginChanged() override;
395 // replace word/selection with text from the thesaurus
396 // (this code has special handling for "in word" character)
397 void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
398 bool IsValidSelectionForThesaurus() const;
399 OUString GetThesaurusLookUpText( bool bSelection ) const;
401 // immediately switch shell -> for GetSelectionObject
402 void StopShellTimer();
404 SwWrtShell& GetWrtShell () const { return *m_pWrtShell; }
405 SwWrtShell* GetWrtShellPtr() const { return m_pWrtShell; }
407 SwEditWin &GetEditWin() { return *m_pEditWin; }
408 const SwEditWin &GetEditWin () const { return *m_pEditWin; }
410 #if defined(_WIN32) || defined UNX
411 void ScannerEventHdl();
412 #endif
414 // hand the handler for text blocks to the shell; create if applicable
415 SwGlossaryHdl* GetGlosHdl();
417 const tools::Rectangle& GetVisArea() const { return m_aVisArea; }
419 bool IsScroll(const tools::Rectangle& rRect) const;
420 void Scroll( const tools::Rectangle& rRect,
421 sal_uInt16 nRangeX = USHRT_MAX,
422 sal_uInt16 nRangeY = USHRT_MAX);
424 long SetVScrollMax(long lMax);
425 long SetHScrollMax(long lMax);
427 void SpellError(LanguageType eLang);
428 bool ExecSpellPopup( const Point& rPt );
429 void ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
430 void ExecSmartTagPopup( const Point& rPt );
432 DECL_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
433 bool ExecDrwTextSpellPopup(const Point& rPt);
435 void SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
436 void SetTabColFromDoc( bool b ) { m_bTabColFromDoc = b; }
437 bool IsTabColFromDoc() const { return m_bTabColFromDoc; }
438 void SetTabRowFromDoc( bool b ) { m_bTabRowFromDoc = b; }
439 bool IsTabRowFromDoc() const { return m_bTabRowFromDoc; }
441 void SetNumRuleNodeFromDoc( SwTextNode * pNumRuleNode )
442 { m_pNumRuleNodeFromDoc = pNumRuleNode; }
444 void DocSzChgd( const Size& rNewSize );
445 const Size& GetDocSz() const { return m_aDocSz; }
446 void SetVisArea( const tools::Rectangle&, bool bUpdateScrollbar = true);
447 void SetVisArea( const Point&, bool bUpdateScrollbar = true);
448 void CheckVisArea();
450 void RecheckBrowseMode();
451 static SvxSearchDialog* GetSearchDialog();
453 static sal_uInt16 GetMoveType();
454 static void SetMoveType(sal_uInt16 nSet);
455 DECL_LINK( MoveNavigationHdl, void*, void );
456 static void SetActMark(sal_Int32 nSet);
458 bool HandleWheelCommands( const CommandEvent& );
460 // insert frames
461 void InsFrameMode(sal_uInt16 nCols);
463 void SetZoom( SvxZoomType eZoomType, short nFactor = 100, bool bViewOnly = false);
464 virtual void SetZoomFactor( const Fraction &rX, const Fraction & ) override;
466 void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly = false );
468 void ShowHScrollbar(bool bShow);
469 bool IsHScrollbarVisible()const;
471 void ShowVScrollbar(bool bShow);
472 bool IsVScrollbarVisible()const;
474 void EnableHScrollbar(bool bEnable);
475 void EnableVScrollbar(bool bEnable);
477 int CreateVRuler();
478 int KillVRuler();
479 int CreateTab();
480 int KillTab();
482 bool StatVRuler() const { return m_pVRuler->IsVisible(); }
483 void ChangeVRulerMetric(FieldUnit eUnit);
484 void GetVRulerMetric(FieldUnit& rToFill) const;
486 SvxRuler& GetHRuler() { return *m_pHRuler; }
487 SvxRuler& GetVRuler() { return *m_pVRuler; }
488 void InvalidateRulerPos();
489 void ChangeTabMetric(FieldUnit eUnit);
490 void GetHRulerMetric(FieldUnit& rToFill) const;
492 // Handler
493 void Execute(SfxRequest&);
494 void ExecLingu(SfxRequest&);
495 void ExecDlg(SfxRequest&);
496 void ExecDlgExt(SfxRequest&);
497 void ExecColl(SfxRequest&);
498 void ExecutePrint(SfxRequest&);
499 void ExecDraw(SfxRequest&);
500 void ExecTabWin(SfxRequest&);
501 void ExecuteStatusLine(SfxRequest&);
502 DECL_LINK( ExecRulerClick, Ruler *, void );
503 void ExecSearch(SfxRequest&);
504 void ExecViewOptions(SfxRequest &);
506 void StateViewOptions(SfxItemSet &);
507 void StateSearch(SfxItemSet &);
508 void GetState(SfxItemSet&);
509 void StateStatusLine(SfxItemSet&);
510 void UpdateWordCount(SfxShell*, sal_uInt16);
511 void ExecFormatFootnote();
512 void ExecNumberingOutline(SfxItemPool &);
514 // functions for drawing
515 void SetDrawFuncPtr(SwDrawBase* pFuncPtr);
516 SwDrawBase* GetDrawFuncPtr() const { return m_pDrawActual; }
517 void GetDrawState(SfxItemSet &rSet);
518 void ExitDraw();
519 bool IsDrawRotate() { return m_bDrawRotate; }
520 void FlipDrawRotate() { m_bDrawRotate = !m_bDrawRotate; }
521 bool IsDrawSelMode() { return m_bDrawSelMode; }
522 void SetSelDrawSlot();
523 void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
524 void NoRotate(); // turn off rotate mode
525 bool EnterDrawTextMode(const Point& aDocPos);
526 /// Same as EnterDrawTextMode(), but takes an SdrObject instead of guessing it by document position.
527 bool EnterShapeDrawTextMode(SdrObject* pObject);
528 void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear();}
529 bool IsDrawMode() { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
530 bool IsFormMode() const;
531 bool IsBezierEditMode();
532 bool AreOnlyFormsSelected() const;
533 bool HasDrwObj(SdrObject *pSdrObj) const;
534 bool HasOnlyObj(SdrObject *pSdrObj, SdrInventor eObjInventor) const;
535 bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=nullptr,
536 vcl::Window* pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false );
538 void StateTabWin(SfxItemSet&);
540 // attributes have changed
541 DECL_LINK( AttrChangedNotify, SwCursorShell*, void );
543 // form control has been activated
544 DECL_LINK( FormControlActivated, LinkParamNone*, void );
546 // edit links
547 void EditLinkDlg();
548 void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = nullptr);
549 void InsertCaption(const InsCaptionOpt *pOpt);
551 // Async call by Core
552 void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
554 OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
556 /// Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea.
557 void ForcePageUpDownOffset(SwTwips nTwips)
559 m_nLOKPageUpDownOffset = nTwips;
562 // hand over Shell
563 SfxShell *GetCurShell() { return m_pShell; }
564 SwDocShell *GetDocShell();
565 inline const SwDocShell *GetDocShell() const;
566 virtual FmFormShell *GetFormShell() override { return m_pFormShell; }
567 virtual const FmFormShell *GetFormShell() const override { return m_pFormShell; }
569 // so that in the SubShells' DTors m_pShell can be reset if applicable
570 void ResetSubShell() { m_pShell = nullptr; }
572 virtual void WriteUserData(OUString &, bool bBrowse = false) override;
573 virtual void ReadUserData(const OUString &, bool bBrowse = false) override;
574 virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ) override;
575 virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ) override;
577 void SetCursorAtTop( bool bFlag, bool bCenter = false )
578 { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
580 bool JumpToSwMark( const OUString& rMark );
582 long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
583 const OUString& rFilterName, sal_Int16 nVersion = 0 );
585 void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
586 long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
587 DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper *, void );
589 // status methods for clipboard.
590 // Status changes now notified from the clipboard.
591 bool IsPasteAllowed();
592 bool IsPasteSpecialAllowed();
594 // Enable mail merge - mail merge field dialog enabled
595 void EnableMailMerge();
596 //apply Accessiblity options
597 void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
599 SwView(SfxViewFrame* pFrame, SfxViewShell*);
600 virtual ~SwView() override;
602 void NotifyDBChanged();
604 SfxObjectShellLock CreateTmpSelectionDoc();
606 void AddTransferable(SwTransferable& rTransferable);
608 // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
609 // or to support printing
610 void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem>& rConfigItem, sal_uInt16 nRestart);
611 std::shared_ptr<SwMailMergeConfigItem> GetMailMergeConfigItem() const;
612 std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr, sal_uInt16 nWizardRestartPage = 0);
614 void ExecFormatPaintbrush(SfxRequest &);
615 void StateFormatPaintbrush(SfxItemSet &);
617 //public fuer D&D
618 int InsertGraphic( const OUString &rPath, const OUString &rFilter,
619 bool bLink, GraphicFilter *pFlt );
621 void ExecuteScan( SfxRequest& rReq );
623 SwPostItMgr* GetPostItMgr() { return m_pPostItMgr;}
624 const SwPostItMgr* GetPostItMgr() const { return m_pPostItMgr;}
626 // exhibition hack (MA,MBA)
627 void SelectShellForDrop();
629 void UpdateDocStats();
630 /// Where is the real cursor: in the annotation or in the main document?
631 void SetAnnotationMode(bool bMode);
633 // methods for printing
634 SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) override;
635 SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const override;
636 SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window* pParent,
637 const SfxItemSet& rSet) override;
638 static SvxSearchItem* GetSearchItem() { return m_pSrchItem; }
639 /// See SfxViewShell::getPart().
640 int getPart() const override;
641 /// See SfxViewShell::dumpAsXml().
642 void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
643 void SetRedlineAuthor(const OUString& rAuthor);
644 const OUString& GetRedlineAuthor();
645 /// See SfxViewShell::NotifyCursor().
646 void NotifyCursor(SfxViewShell* pViewShell) const override;
649 inline long SwView::GetXScroll() const
651 return m_aVisArea.GetWidth() * nScrollX / 100L;
654 inline long SwView::GetYScroll() const
656 return m_aVisArea.GetHeight() * nScrollY / 100L;
659 inline const SwDocShell *SwView::GetDocShell() const
661 return const_cast<SwView*>(this)->GetDocShell();
664 VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent,
665 const SfxItemSet &rOptions,
666 bool bPreview);
668 extern bool bDocSzUpdated;
670 #endif
672 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */