LibreOffice Module sw (master)  1
view.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 #ifndef INCLUDED_SW_INC_VIEW_HXX
20 #define INCLUDED_SW_INC_VIEW_HXX
21 
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"
34 
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;
60 class SwTransferable;
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;
71 
72 namespace com::sun::star::view { class XSelectionSupplier; }
73 namespace sfx2 { class FileDialogHelper; }
74 namespace sw::mark { class IFieldmark; }
75 
76 const tools::Long nLeftOfst = -370;
77 const tools::Long nScrollX = 30;
78 const tools::Long nScrollY = 30;
79 
80 #define MINZOOM 20
81 #define MAXZOOM 600
82 
83 #define MAX_MARKS 5
84 
85 enum class ShellMode
86 {
87  Text,
88  Frame,
89  Graphic,
90  Object,
91  Draw,
92  DrawForm,
93  DrawText,
94  Bezier,
95  ListText,
96  TableText,
98  Media,
100  FontWork,
101  PostIt
102 };
103 
104 // apply a template
106 {
107  union
108  {
114  } aColl;
115 
117  sal_uInt16 nColor;
119  size_t nUndo; //< The initial undo stack depth.
120 
122  eType(SfxStyleFamily::None),
123  nColor(0),
124  m_pFormatClipboard(nullptr),
125  nUndo(0)
126  {
127  aColl.pTextColl = nullptr;
128  }
129 };
130 
131 class SwView;
132 
133 // manage connection and disconnection of SwView and SwDocShell
135 {
136 private:
138 public:
139  SwViewGlueDocShell(SwView& rView, SwDocShell& rDocSh);
141 };
142 
143 // view of a document
145 {
146  friend class SwHHCWrapper;
147  friend class SwHyphWrapper;
148  friend class SwView_Impl;
150 
151  // selection cycle
152  struct SelectCycle
153  {
157  sal_uInt16 nStep;
158 
160  nStep(0) {}
161  };
162 
163  // search & replace
165 
166  static sal_uInt16 m_nMoveType; // for buttons below the scrollbar (viewmdi)
167  static sal_Int32 m_nActMark; // current jump mark for unknown mark
168 
169  static bool s_bExtra;
170  static bool s_bFound;
171  static bool s_bJustOpened;
172 
173  static std::unique_ptr<SearchAttrItemList> s_xSearchList;
174  static std::unique_ptr<SearchAttrItemList> s_xReplaceList;
175 
176  Timer m_aTimer; // for delayed ChgLnks during an action
177  OUString m_sSwViewData,
178  //and the new cursor position if the user double click in the PagePreview
179  m_sNewCursorPos;
180  // to support keyboard the number of the page to go to can be set too
181  sal_uInt16 m_nNewPage;
182 
183  sal_uInt16 m_nOldPageNum;
185 
186  Point m_aTabColFromDocPos; // moving table columns out of the document
187  SwTextNode * m_pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
188 
189  Size m_aDocSz; // current document size
190  tools::Rectangle m_aVisArea; // visible region
191 
193  std::unique_ptr<SwWrtShell> m_pWrtShell;
194  std::unique_ptr<SwViewGlueDocShell> m_xGlueDocShell;
195 
196  SfxShell *m_pShell; // current SubShell at the dispatcher
197  FmFormShell *m_pFormShell; // DB-FormShell
198 
199  std::unique_ptr<SwView_Impl> m_pViewImpl; // Impl-data for UNO + Basic
200 
201  VclPtr<SwScrollbar> m_pHScrollbar, // MDI control elements
203 
206 
207  VclPtr<vcl::Window> m_pScrollFill; // dummy window for filling the lower right edge
208  // when both scrollbars are active
209 
210  VclPtr<SvxRuler> m_pHRuler,
211  m_pVRuler;
212 
213  std::unique_ptr<SwGlossaryHdl> m_pGlosHdl; // handle text block
214  std::unique_ptr<SwDrawBase> m_pDrawActual;
215 
217 
218  std::unique_ptr<SwFormatClipboard> m_pFormatClipboard; //holds data for format paintbrush
219 
220  std::unique_ptr<SwPostItMgr> m_pPostItMgr;
221 
223  sal_uInt16 m_nPageCnt;
224 
225  // current draw mode
226  sal_uInt16 m_nDrawSfxId;
227  OUString m_sDrawCustom; //some drawing types are marked with strings!
228  sal_uInt16 m_nFormSfxId;
231 
232  // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
235 
237 
239 
240  bool m_bCenterCursor : 1,
241  m_bTopCursor : 1,
242  m_bTabColFromDoc : 1,
243  m_bTabRowFromDoc : 1,
244  m_bSetTabColFromDoc : 1 ,
245  m_bSetTabRowFromDoc : 1,
246  m_bAttrChgNotified : 1,
247  m_bAttrChgNotifiedWithRegistrations : 1,
248  m_bVerbsActive : 1,
249  m_bDrawRotate : 1,
250  m_bDrawSelMode : 1,
251  m_bShowAtResize : 1,
252  m_bInOuterResizePixel : 1,
253  m_bInInnerResizePixel : 1,
254  m_bPasteState : 1,
255  m_bPasteSpecialState : 1,
256  m_bInMailMerge : 1,
257  m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
258  m_bOldShellWasPagePreview : 1,
259  m_bIsPreviewDoubleClick : 1, // #i114045#
260  m_bMakeSelectionVisible : 1, // transport the bookmark selection
261  m_bForceChangesToolbar : 1; // on load of documents with change tracking
262  bool m_bInitOnceCompleted = false;
263 
267 
269  // methods for searching
270  // set search context
271  SAL_DLLPRIVATE bool SearchAndWrap(bool bApi);
272  SAL_DLLPRIVATE bool SearchAll();
273  SAL_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
274  SAL_DLLPRIVATE void Replace();
275 
276  bool IsDocumentBorder();
277 
278  SAL_DLLPRIVATE bool IsTextTool() const;
279 
280  DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
281 
282  inline tools::Long GetXScroll() const;
283  inline tools::Long GetYScroll() const;
284  SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
285  SAL_DLLPRIVATE void CalcPt( Point* pPt,const tools::Rectangle& rRect,
286  sal_uInt16 nRangeX,
287  sal_uInt16 nRangeY);
288 
289  SAL_DLLPRIVATE bool GetPageScrollUpOffset(SwTwips& rOff) const;
290  SAL_DLLPRIVATE bool GetPageScrollDownOffset(SwTwips& rOff) const;
291 
292  // scrollbar movements
293  SAL_DLLPRIVATE bool PageUp();
294  SAL_DLLPRIVATE bool PageDown();
295  SAL_DLLPRIVATE bool PageUpCursor(bool bSelect);
296  SAL_DLLPRIVATE bool PageDownCursor(bool bSelect);
297  SAL_DLLPRIVATE void PhyPageUp();
298  SAL_DLLPRIVATE void PhyPageDown();
299 
300  SAL_DLLPRIVATE void CreateScrollbar( bool bHori );
301  DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar*, void );
302  DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar*, void );
303  SAL_DLLPRIVATE bool UpdateScrollbars();
304  DECL_DLLPRIVATE_LINK( WindowChildEventListener, VclWindowEvent&, void );
305  SAL_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
306 
307  // linguistics functions
308  SAL_DLLPRIVATE void HyphenateDocument();
309  SAL_DLLPRIVATE bool IsDrawTextHyphenate();
310  SAL_DLLPRIVATE void HyphenateDrawText();
311  SAL_DLLPRIVATE void StartThesaurus();
312 
313  // text conversion
314  SAL_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
315 
316  // used for spell checking and text conversion
317  SAL_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, bool bStartDone,
318  bool bEndDone, SwConversionArgs *pConvArgs );
319  SAL_DLLPRIVATE void SpellEnd( SwConversionArgs const *pConvArgs );
320 
321  SAL_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
322  SAL_DLLPRIVATE void SpellContext(bool bOn = true)
323  { m_bCenterCursor = bOn; }
324 
325  // for readonly switching
326  SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
327  SAL_DLLPRIVATE void CheckReadonlyState();
328  SAL_DLLPRIVATE void CheckReadonlySelection();
329 
330  // method for rotating PageDesc
331  SAL_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
332 
333  SAL_DLLPRIVATE void SetZoom_( const Size &rEditSz,
334  SvxZoomType eZoomType,
335  short nFactor,
336  bool bViewOnly);
337  SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill );
338 
339  SAL_DLLPRIVATE void ShowAtResize();
340 
341  SAL_DLLPRIVATE virtual void Move() override;
342 
343 public: // #i123922# Needs to be called from a 2nd place now as a helper method
344  SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& );
345 
346 protected:
347 
348  SwView_Impl* GetViewImpl() {return m_pViewImpl.get();}
349 
350  void ImpSetVerb( SelectionType nSelType );
351 
352  SelectionType GetSelectionType() const { return m_nSelectionType; }
353  void SetSelectionType(SelectionType nSet) { m_nSelectionType = nSet;}
354 
355  // for SwWebView
356  void SetShell( SfxShell* pS ) { m_pShell = pS; }
357  void SetFormShell( FmFormShell* pSh ) { m_pFormShell = pSh; }
358 
359  virtual void SelectShell();
360 
361  virtual void Activate(bool) override;
362  virtual void Deactivate(bool) override;
363  virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
364  virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
365 
366  const SwFrameFormat* GetLastTableFrameFormat() const {return m_pLastTableFormat;}
367  void SetLastTableFrameFormat(const SwFrameFormat* pSet) {m_pLastTableFormat = pSet;}
368 
369  // form letter execution
370  void GenerateFormLetter(bool bUseCurrentDocument);
371 
373 
374 public:
377 
378 private:
380  static void InitInterface_Impl();
381 
382 public:
383  SfxDispatcher &GetDispatcher();
384 
385  void GotFocus() const;
386  virtual SdrView* GetDrawView() const override;
387  virtual bool HasUIFeature(SfxShellFeature nFeature) const override;
388  virtual void ShowCursor( bool bOn = true ) override;
389  virtual ErrCode DoVerb(sal_Int32 nVerb) override;
390 
391  virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
392  SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override;
393  ShellMode GetShellMode() const;
394 
395  css::view::XSelectionSupplier* GetUNOObject();
396 
397  OUString GetSelectionTextParam( bool bCompleteWords,
398  bool bEraseTrail );
399  virtual bool HasSelection( bool bText = true ) const override;
400  virtual OUString GetSelectionText( bool bCompleteWords = false ) override;
401  virtual bool PrepareClose( bool bUI = true ) override;
402  virtual void MarginChanged() override;
403 
404  // replace word/selection with text from the thesaurus
405  // (this code has special handling for "in word" character)
406  void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
407  bool IsValidSelectionForThesaurus() const;
408  OUString GetThesaurusLookUpText( bool bSelection ) const;
409 
410  // immediately switch shell -> for GetSelectionObject
411  void StopShellTimer();
412 
413  SwWrtShell& GetWrtShell () const { return *m_pWrtShell; }
414  SwWrtShell* GetWrtShellPtr() const { return m_pWrtShell.get(); }
415 
416  SwEditWin &GetEditWin() { return *m_pEditWin; }
417  const SwEditWin &GetEditWin () const { return *m_pEditWin; }
418 
419 #if defined(_WIN32) || defined UNX
420  void ScannerEventHdl();
421 #endif
422 
423  // hand the handler for text blocks to the shell; create if applicable
424  SwGlossaryHdl* GetGlosHdl();
425 
426  const tools::Rectangle& GetVisArea() const { return m_aVisArea; }
427 
428  bool IsScroll(const tools::Rectangle& rRect) const;
429  void Scroll( const tools::Rectangle& rRect,
430  sal_uInt16 nRangeX = USHRT_MAX,
431  sal_uInt16 nRangeY = USHRT_MAX);
432 
433  tools::Long SetVScrollMax(tools::Long lMax);
434  tools::Long SetHScrollMax(tools::Long lMax);
435 
436  void SpellError(LanguageType eLang);
437  bool ExecSpellPopup( const Point& rPt );
438  void ExecSmartTagPopup( const Point& rPt );
439 
440  DECL_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
441  bool ExecDrwTextSpellPopup(const Point& rPt);
442 
443  void SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
444  void SetTabColFromDoc( bool b ) { m_bTabColFromDoc = b; }
445  bool IsTabColFromDoc() const { return m_bTabColFromDoc; }
446  void SetTabRowFromDoc( bool b ) { m_bTabRowFromDoc = b; }
447  bool IsTabRowFromDoc() const { return m_bTabRowFromDoc; }
448 
449  void SetNumRuleNodeFromDoc( SwTextNode * pNumRuleNode )
450  { m_pNumRuleNodeFromDoc = pNumRuleNode; }
451 
452  void DocSzChgd( const Size& rNewSize );
453  const Size& GetDocSz() const { return m_aDocSz; }
454  void SetVisArea( const tools::Rectangle&, bool bUpdateScrollbar = true);
455  void SetVisArea( const Point&, bool bUpdateScrollbar = true);
456  void CheckVisArea();
457 
458  void RecheckBrowseMode();
459  static SvxSearchDialog* GetSearchDialog();
460 
461  static sal_uInt16 GetMoveType();
462  static void SetMoveType(sal_uInt16 nSet);
463  DECL_LINK( MoveNavigationHdl, void*, void );
464  static void SetActMark(sal_Int32 nSet);
465 
466  bool HandleWheelCommands( const CommandEvent& );
467 
468  // insert frames
469  void InsFrameMode(sal_uInt16 nCols);
470 
471  void SetZoom( SvxZoomType eZoomType, short nFactor = 100, bool bViewOnly = false);
472  virtual void SetZoomFactor( const Fraction &rX, const Fraction & ) override;
473 
474  void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly = false );
475 
476  void ShowHScrollbar(bool bShow);
477  bool IsHScrollbarVisible()const;
478 
479  void ShowVScrollbar(bool bShow);
480  bool IsVScrollbarVisible()const;
481 
482  void EnableHScrollbar(bool bEnable);
483  void EnableVScrollbar(bool bEnable);
484 
485  void CreateVRuler();
486  void KillVRuler();
487  void CreateTab();
488  void KillTab();
489 
490  bool StatVRuler() const { return m_pVRuler->IsVisible(); }
491  void ChangeVRulerMetric(FieldUnit eUnit);
492  void GetVRulerMetric(FieldUnit& rToFill) const;
493 
494  SvxRuler& GetHRuler() { return *m_pHRuler; }
495  SvxRuler& GetVRuler() { return *m_pVRuler; }
496  void InvalidateRulerPos();
497  void ChangeTabMetric(FieldUnit eUnit);
498  void GetHRulerMetric(FieldUnit& rToFill) const;
499 
500  // Handler
501  void Execute(SfxRequest&);
502  void ExecLingu(SfxRequest&);
503  void ExecDlg(SfxRequest const &);
504  void ExecDlgExt(SfxRequest const &);
505  void ExecColl(SfxRequest const &);
506  void ExecutePrint(SfxRequest&);
507  void ExecDraw(SfxRequest&);
508  void ExecTabWin(SfxRequest const &);
509  void ExecuteStatusLine(SfxRequest&);
510  DECL_LINK( ExecRulerClick, Ruler *, void );
511  void ExecSearch(SfxRequest&);
512  void ExecViewOptions(SfxRequest &);
513 
514  virtual bool IsConditionalFastCall( const SfxRequest &rReq ) override;
515 
516  void StateViewOptions(SfxItemSet &);
517  void StateSearch(SfxItemSet &);
518  void GetState(SfxItemSet&);
519  void StateStatusLine(SfxItemSet&);
520  void UpdateWordCount(SfxShell*, sal_uInt16);
521  void ExecFormatFootnote();
522  void ExecNumberingOutline(SfxItemPool &);
523 
524  // functions for drawing
525  void SetDrawFuncPtr(std::unique_ptr<SwDrawBase> pFuncPtr);
526  SwDrawBase* GetDrawFuncPtr() const { return m_pDrawActual.get(); }
527  void GetDrawState(SfxItemSet &rSet);
528  void ExitDraw();
529  bool IsDrawRotate() const { return m_bDrawRotate; }
530  void FlipDrawRotate() { m_bDrawRotate = !m_bDrawRotate; }
531  bool IsDrawSelMode() const { return m_bDrawSelMode; }
532  void SetSelDrawSlot();
533  void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
534  void NoRotate(); // turn off rotate mode
535  bool EnterDrawTextMode(const Point& aDocPos);
537  bool EnterShapeDrawTextMode(SdrObject* pObject);
538  void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear(); m_eFormObjKind = OBJ_NONE; }
539  bool IsDrawMode() const { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
540  bool IsFormMode() const;
541  bool IsBezierEditMode() const;
542  bool AreOnlyFormsSelected() const;
543  bool HasOnlyObj(SdrObject const *pSdrObj, SdrInventor eObjInventor) const;
544  bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=nullptr,
545  vcl::Window* pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false );
546  bool isSignatureLineSelected() const;
547  bool isSignatureLineSigned() const;
548  bool isQRCodeSelected() const;
549 
550  void StateTabWin(SfxItemSet&);
551 
552  // attributes have changed
553  DECL_LINK( AttrChangedNotify, LinkParamNone*, void );
554 
555  // form control has been activated
556  DECL_LINK( FormControlActivated, LinkParamNone*, void );
557 
558  DECL_LINK( ExchangeDatabaseHandler, weld::Button&, void);
559 
560  // edit links
561  void EditLinkDlg();
562  void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = nullptr);
563  void InsertCaption(const InsCaptionOpt *pOpt);
564 
565  // Async call by Core
566  void UpdatePageNums();
567 
568  OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
569 
572  {
573  m_nLOKPageUpDownOffset = nTwips;
574  }
575 
576  // hand over Shell
577  SfxShell *GetCurShell() { return m_pShell; }
578  SwDocShell *GetDocShell();
579  inline const SwDocShell *GetDocShell() const;
580  virtual FmFormShell *GetFormShell() override { return m_pFormShell; }
581  virtual const FmFormShell *GetFormShell() const override { return m_pFormShell; }
582 
583  // so that in the SubShells' DTors m_pShell can be reset if applicable
584  void ResetSubShell() { m_pShell = nullptr; }
585 
586  virtual void WriteUserData(OUString &, bool bBrowse = false) override;
587  virtual void ReadUserData(const OUString &, bool bBrowse = false) override;
588  virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ) override;
589  virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ) override;
590 
591  void SetCursorAtTop( bool bFlag, bool bCenter = false )
592  { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
593 
594  bool JumpToSwMark( const OUString& rMark );
595 
596  tools::Long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
597  const OUString& rFilterName, sal_Int16 nVersion = 0 );
598 
599  void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
600  tools::Long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
601  DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper *, void );
602 
603  // status methods for clipboard.
604  // Status changes now notified from the clipboard.
605  bool IsPasteAllowed();
606  bool IsPasteSpecialAllowed();
607  bool IsPasteSpreadsheet(bool bHasOwnTableCopied);
608 
609  // Enable mail merge - mail merge field dialog enabled
610  void EnableMailMerge();
611  //apply Accessibility options
612  void ApplyAccessibilityOptions(SvtAccessibilityOptions const & rAccessibilityOptions);
613 
614  SwView(SfxViewFrame* pFrame, SfxViewShell*);
615  virtual ~SwView() override;
616 
617  void NotifyDBChanged();
618 
619  SfxObjectShellLock CreateTmpSelectionDoc();
620 
621  void AddTransferable(SwTransferable& rTransferable);
622 
623  // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
624  // or to support printing
625  void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem> const & rConfigItem);
626  std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const;
627  std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr);
628 
629  OUString GetDataSourceName() const;
630  static bool IsDataSourceAvailable(const OUString sDataSourceName);
631  void AppendDataSourceInfobar();
632 
633  void ExecFormatPaintbrush(SfxRequest const &);
634  void StateFormatPaintbrush(SfxItemSet &);
635 
636  // public for D&D
637  ErrCode InsertGraphic( const OUString &rPath, const OUString &rFilter,
638  bool bLink, GraphicFilter *pFlt );
639 
640  void ExecuteScan( SfxRequest& rReq );
641 
642  SwPostItMgr* GetPostItMgr() { return m_pPostItMgr.get();}
643  const SwPostItMgr* GetPostItMgr() const { return m_pPostItMgr.get();}
644 
645  // exhibition hack (MA,MBA)
646  void SelectShellForDrop();
647 
648  void UpdateDocStats();
649 
650  // methods for printing
651  SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) override;
652  SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const override;
653  SAL_DLLPRIVATE virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
654  const SfxItemSet& rSet) override;
655  static SvxSearchItem* GetSearchItem() { return s_pSrchItem; }
657  int getPart() const override;
659  void dumpAsXml(xmlTextWriterPtr pWriter) const override;
660  void SetRedlineAuthor(const OUString& rAuthor);
661  const OUString& GetRedlineAuthor() const;
663  void NotifyCursor(SfxViewShell* pViewShell) const override;
664  void ShowUIElement(const OUString& sElementURL) const;
665 
666 
668  {
673  CachedStrings
674  };
675 
676  OUString m_StringCache[CachedStrings];
677 
678  const OUString& GetCachedString(CachedStringID id)
679  {
680  return m_StringCache[id];
681  }
682 
683  void SetCachedString(CachedStringID id, const OUString& sStr)
684  {
685  m_StringCache[id] = sStr;
686  }
687 
688  const OUString& GetOldGrfCat();
689  void SetOldGrfCat(const OUString& sStr);
690  const OUString& GetOldTabCat();
691  void SetOldTabCat(const OUString& sStr);
692  const OUString& GetOldFrameCat();
693  void SetOldFrameCat(const OUString& sStr);
694  const OUString& GetOldDrwCat();
695  void SetOldDrwCat(const OUString& sStr);
696 
697  virtual tools::Rectangle getLOKVisibleArea() const override;
698 };
699 
701 {
702  return (m_aVisArea.GetWidth() * nScrollX) / 100;
703 }
704 
706 {
707  return (m_aVisArea.GetHeight() * nScrollY) / 100;
708 }
709 
710 inline const SwDocShell *SwView::GetDocShell() const
711 {
712  return const_cast<SwView*>(this)->GetDocShell();
713 }
714 
715 std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
716  const SfxItemSet &rOptions,
717  bool bPreview);
718 
719 extern bool bDocSzUpdated;
720 
721 #endif
722 
723 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 m_nRightBorderDistance
Definition: view.hxx:234
tools::Long GetYScroll() const
Definition: view.hxx:705
size_t nUndo
Definition: view.hxx:119
FieldUnit
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
Definition: view.hxx:218
SdrObjKind m_eFormObjKind
Definition: view.hxx:229
bool IsTabRowFromDoc() const
Definition: view.hxx:447
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
Definition: view.hxx:194
bool IsDrawMode() const
Definition: view.hxx:539
bool JumpToSwMark(SwViewShell const *pVwSh, const OUString &rMark)
Definition: edtwin3.cxx:117
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual const FmFormShell * GetFormShell() const override
Definition: view.hxx:581
sal_uInt16 m_nPageCnt
Definition: view.hxx:223
SfxStyleFamily eType
Definition: view.hxx:116
virtual std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions)
void ForcePageUpDownOffset(SwTwips nTwips)
Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea. ...
Definition: view.hxx:571
std::unique_ptr< SwPostItMgr > m_pPostItMgr
Definition: view.hxx:220
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:193
bool StatVRuler() const
Definition: view.hxx:490
void FlipDrawRotate()
Definition: view.hxx:530
sal_uIntPtr sal_uLong
long Long
void SetSelectionType(SelectionType nSet)
Definition: view.hxx:353
Size m_aDocSz
Definition: view.hxx:189
tools::Long GetWidth() const
SdrInventor
SwEditWin & GetEditWin()
Definition: view.hxx:416
static std::unique_ptr< SearchAttrItemList > s_xSearchList
Definition: view.hxx:173
static std::unique_ptr< SearchAttrItemList > s_xReplaceList
Definition: view.hxx:174
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange)
SotExchangeDest
void SetCachedString(CachedStringID id, const OUString &sStr)
Definition: view.hxx:683
const SwFrameFormat * m_pLastTableFormat
Definition: view.hxx:216
CachedStringID
Definition: view.hxx:667
void ResetSubShell()
Definition: view.hxx:584
None
SdrObjKind
SwView & m_rView
Definition: view.hxx:137
SfxShell * GetCurShell()
Definition: view.hxx:577
SwPageDesc * pPageDesc
Definition: view.hxx:110
void SetTabColFromDocPos(const Point &rPt)
Definition: view.hxx:443
SwView_Impl * GetViewImpl()
Definition: view.hxx:348
SvxRuler & GetVRuler()
Definition: view.hxx:495
virtual bool HasPrintOptionsPage() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:91
sal_uInt16 m_nFormSfxId
Definition: view.hxx:228
virtual void WriteUserData(OUString &, bool bBrowse=false)
SelectionType m_nSelectionType
Definition: view.hxx:222
SwFormatClipboard * m_pFormatClipboard
Definition: view.hxx:118
virtual int getPart() const
SfxPrinterChangeFlags
bool m_bVScrollbarEnabled
Definition: view.hxx:205
OUString m_sDrawCustom
Definition: view.hxx:227
SwTextNode * m_pNumRuleNodeFromDoc
Definition: view.hxx:187
static bool s_bJustOpened
Definition: view.hxx:171
SfxStyleFamily
FmFormShell * m_pFormShell
Definition: view.hxx:197
const tools::Long nScrollY
Definition: view.hxx:78
std::unique_ptr< SwDrawBase > m_pDrawActual
Definition: view.hxx:214
ShellMode
Definition: view.hxx:85
const SwFrameFormat * GetLastTableFrameFormat() const
Definition: view.hxx:366
VclPtr< SwEditWin > m_pEditWin
Definition: view.hxx:192
SotExchangeDest m_nLastPasteDestination
Definition: view.hxx:230
bool IsDrawSelMode() const
Definition: view.hxx:531
const tools::Long nScrollX
Definition: view.hxx:77
struct _xmlTextWriter * xmlTextWriterPtr
void SetTabRowFromDoc(bool b)
Definition: view.hxx:446
#define SFX_DECL_VIEWFACTORY(Class)
sal_uInt16 m_nLeftBorderDistance
Definition: view.hxx:233
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:580
Style of a layout element.
Definition: frmfmt.hxx:58
std::unique_ptr< SwGlossaryHdl > m_pGlosHdl
Definition: view.hxx:213
sal_uInt16 m_nOldPageNum
Definition: view.hxx:183
SfxDispatcher * GetDispatcher() const
const SwEditWin & GetEditWin() const
Definition: view.hxx:417
SwTextFormatColl * pTextColl
Definition: view.hxx:109
SwNumRule * pNumRule
Definition: view.hxx:113
VclPtr< vcl::Window > m_pScrollFill
Definition: view.hxx:207
sal_uInt16 nStep
Definition: view.hxx:157
static sal_Int32 m_nActMark
Definition: view.hxx:167
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
virtual bool IsConditionalFastCall(const SfxRequest &rReq)
SAL_DLLPRIVATE void SpellContext(bool bOn=true)
Definition: view.hxx:322
void SetShell(SfxShell *pS)
Definition: view.hxx:356
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
SfxShellFeature
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
Definition: view.cxx:1059
SwTwips m_nLOKPageUpDownOffset
LibreOfficeKit has to force the page size for PgUp/PgDown functionality based on the user's view...
Definition: view.hxx:266
static SvxSearchItem * GetSearchItem()
Definition: view.hxx:655
virtual void ReadUserData(const OUString &, bool bBrowse=false)
SwFrameFormat * pFrameFormat
Definition: view.hxx:111
const tools::Long nLeftOfst
Definition: view.hxx:76
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize)
const OUString & GetCachedString(CachedStringID id)
Definition: view.hxx:678
bool IsDrawRotate() const
Definition: view.hxx:529
virtual void Activate(bool IsMDIActivate) override
void SetFormShell(FmFormShell *pSh)
Definition: view.hxx:357
void SetPrinter(IDocumentDeviceAccess *, SfxPrinter const *, bool bWeb)
Definition: viewprt.cxx:77
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
void LeaveDrawCreate()
Definition: view.hxx:538
bool m_bWheelScrollInProgress
Definition: view.hxx:238
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:526
const SwPostItMgr * GetPostItMgr() const
Definition: view.hxx:643
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:210
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
Definition: viewprt.cxx:294
virtual void Deactivate(bool IsMDIActivate) override
tools::Long SwTwips
Definition: swtypes.hxx:49
SelectCycle m_aSelectCycle
Definition: view.hxx:268
SwDocShell * GetDocShell()
Definition: view.cxx:1126
OUString m_sSwViewData
Definition: view.hxx:177
SelectionType
Definition: wrtsh.hxx:59
SwCharFormat * pCharFormat
Definition: view.hxx:112
virtual void NotifyCursor(SfxViewShell *) const
const Size & GetDocSz() const
Definition: view.hxx:453
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
tools::Rectangle m_aVisArea
Definition: view.hxx:190
sal_uInt16 m_nNewPage
Definition: view.hxx:181
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:414
VclPtr< SwScrollbar > m_pVScrollbar
Definition: view.hxx:201
Timer m_aTimer
Definition: view.hxx:176
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
void SetCursorAtTop(bool bFlag, bool bCenter=false)
Definition: view.hxx:591
SvxSpellArea
bool IsTabColFromDoc() const
Definition: view.hxx:445
std::unique_ptr< SwView_Impl > m_pViewImpl
Definition: view.hxx:199
static bool s_bFound
Definition: view.hxx:170
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
virtual tools::Rectangle getLOKVisibleArea() const
This class acts as data container and execution class for the format paintbrush feature in writer...
void SetLastTableFrameFormat(const SwFrameFormat *pSet)
Definition: view.hxx:367
Point m_aTabColFromDocPos
Definition: view.hxx:186
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:642
SvxSearchCmd m_eLastSearchCommand
Definition: view.hxx:236
static sal_uInt16 m_nMoveType
Definition: view.hxx:166
virtual SfxPrinter * GetPrinter(bool bCreate=false)
SvxRuler & GetHRuler()
Definition: view.hxx:494
SvxSearchCmd
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:426
bool bDocSzUpdated
Definition: view.cxx:122
tools::Long GetHeight() const
sal_uInt16 m_nDrawSfxId
Definition: view.hxx:226
tools::Long GetXScroll() const
Definition: view.hxx:700
SfxShell * m_pShell
Definition: view.hxx:196
SvxZoomType
SelectionType GetSelectionType() const
Definition: view.hxx:352
virtual void Move()
#define SW_VIEWSHELL
Definition: shellid.hxx:38
OUString m_sOldSectionName
Definition: view.hxx:184
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
union SwApplyTemplate::@32 aColl
void SetNumRuleNodeFromDoc(SwTextNode *pNumRuleNode)
Definition: view.hxx:449
static SvxSearchItem * s_pSrchItem
Definition: view.hxx:164
OBJ_NONE
bool m_bHScrollbarEnabled
Definition: view.hxx:204
void FlipDrawSelMode()
Definition: view.hxx:533
static bool s_bExtra
Definition: view.hxx:169
sal_uInt16 nColor
Definition: view.hxx:117
void SetTabColFromDoc(bool b)
Definition: view.hxx:444
Definition: view.hxx:144
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY)
Point m_pInitialCursor
Definition: view.hxx:154
#define SFX_DECL_INTERFACE(nId)