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