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  // search & replace
153 
154  static sal_uInt16 m_nMoveType; // for buttons below the scrollbar (viewmdi)
155  static sal_Int32 m_nActMark; // current jump mark for unknown mark
156 
157  static bool s_bExtra;
158  static bool s_bFound;
159  static bool s_bJustOpened;
160 
161  static std::unique_ptr<SearchAttrItemList> s_xSearchList;
162  static std::unique_ptr<SearchAttrItemList> s_xReplaceList;
163 
164  Timer m_aTimer; // for delayed ChgLnks during an action
165  OUString m_sSwViewData,
166  //and the new cursor position if the user double click in the PagePreview
167  m_sNewCursorPos;
168  // to support keyboard the number of the page to go to can be set too
169  sal_uInt16 m_nNewPage;
170 
171  sal_uInt16 m_nOldPageNum;
173 
174  Point m_aTabColFromDocPos; // moving table columns out of the document
175  SwTextNode * m_pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
176 
177  Size m_aDocSz; // current document size
178  tools::Rectangle m_aVisArea; // visible region
179 
181  std::unique_ptr<SwWrtShell> m_pWrtShell;
182  std::unique_ptr<SwViewGlueDocShell> m_xGlueDocShell;
183 
184  SfxShell *m_pShell; // current SubShell at the dispatcher
185  FmFormShell *m_pFormShell; // DB-FormShell
186 
187  std::unique_ptr<SwView_Impl> m_pViewImpl; // Impl-data for UNO + Basic
188 
189  VclPtr<SwScrollbar> m_pHScrollbar, // MDI control elements
191 
194 
195  VclPtr<vcl::Window> m_pScrollFill; // dummy window for filling the lower right edge
196  // when both scrollbars are active
197 
198  VclPtr<SvxRuler> m_pHRuler,
199  m_pVRuler;
200 
201  std::unique_ptr<SwGlossaryHdl> m_pGlosHdl; // handle text block
202  std::unique_ptr<SwDrawBase> m_pDrawActual;
203 
205 
206  std::unique_ptr<SwFormatClipboard> m_pFormatClipboard; //holds data for format paintbrush
207 
208  std::unique_ptr<SwPostItMgr> m_pPostItMgr;
209 
211  sal_uInt16 m_nPageCnt;
212 
213  // current draw mode
214  sal_uInt16 m_nDrawSfxId;
215  OUString m_sDrawCustom; //some drawing types are marked with strings!
216  sal_uInt16 m_nFormSfxId;
218 
219  // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
222 
224 
226 
227  bool m_bCenterCursor : 1,
228  m_bTopCursor : 1,
229  m_bTabColFromDoc : 1,
230  m_bTabRowFromDoc : 1,
231  m_bSetTabColFromDoc : 1 ,
232  m_bSetTabRowFromDoc : 1,
233  m_bAttrChgNotified : 1,
234  m_bAttrChgNotifiedWithRegistrations : 1,
235  m_bVerbsActive : 1,
236  m_bDrawRotate : 1,
237  m_bDrawSelMode : 1,
238  m_bShowAtResize : 1,
239  m_bInOuterResizePixel : 1,
240  m_bInInnerResizePixel : 1,
241  m_bPasteState : 1,
242  m_bPasteSpecialState : 1,
243  m_bInMailMerge : 1,
244  m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
245  m_bOldShellWasPagePreview : 1,
246  m_bIsPreviewDoubleClick : 1, // #i114045#
247  m_bMakeSelectionVisible : 1; // transport the bookmark selection
248  bool m_bInitOnceCompleted = false;
249 
253 
254  // methods for searching
255  // set search context
256  SAL_DLLPRIVATE bool SearchAndWrap(bool bApi);
257  SAL_DLLPRIVATE bool SearchAll();
258  SAL_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
259  SAL_DLLPRIVATE void Replace();
260 
261  bool IsDocumentBorder();
262 
263  SAL_DLLPRIVATE bool IsTextTool() const;
264 
265  DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
266 
267  inline tools::Long GetXScroll() const;
268  inline tools::Long GetYScroll() const;
269  SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
270  SAL_DLLPRIVATE void CalcPt( Point* pPt,const tools::Rectangle& rRect,
271  sal_uInt16 nRangeX,
272  sal_uInt16 nRangeY);
273 
274  SAL_DLLPRIVATE bool GetPageScrollUpOffset(SwTwips& rOff) const;
275  SAL_DLLPRIVATE bool GetPageScrollDownOffset(SwTwips& rOff) const;
276 
277  // scrollbar movements
278  SAL_DLLPRIVATE bool PageUp();
279  SAL_DLLPRIVATE bool PageDown();
280  SAL_DLLPRIVATE bool PageUpCursor(bool bSelect);
281  SAL_DLLPRIVATE bool PageDownCursor(bool bSelect);
282  SAL_DLLPRIVATE void PhyPageUp();
283  SAL_DLLPRIVATE void PhyPageDown();
284 
285  SAL_DLLPRIVATE void CreateScrollbar( bool bHori );
286  DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar*, void );
287  DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar*, void );
288  SAL_DLLPRIVATE bool UpdateScrollbars();
289  DECL_DLLPRIVATE_LINK( WindowChildEventListener, VclWindowEvent&, void );
290  SAL_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
291 
292  // linguistics functions
293  SAL_DLLPRIVATE void HyphenateDocument();
294  SAL_DLLPRIVATE bool IsDrawTextHyphenate();
295  SAL_DLLPRIVATE void HyphenateDrawText();
296  SAL_DLLPRIVATE void StartThesaurus();
297 
298  // text conversion
299  SAL_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
300 
301  // used for spell checking and text conversion
302  SAL_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, bool bStartDone,
303  bool bEndDone, SwConversionArgs *pConvArgs );
304  SAL_DLLPRIVATE void SpellEnd( SwConversionArgs const *pConvArgs );
305 
306  SAL_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
307  SAL_DLLPRIVATE void SpellContext(bool bOn = true)
308  { m_bCenterCursor = bOn; }
309 
310  // for readonly switching
311  SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
312  SAL_DLLPRIVATE void CheckReadonlyState();
313  SAL_DLLPRIVATE void CheckReadonlySelection();
314 
315  // method for rotating PageDesc
316  SAL_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
317 
318  SAL_DLLPRIVATE void SetZoom_( const Size &rEditSz,
319  SvxZoomType eZoomType,
320  short nFactor,
321  bool bViewOnly);
322  SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill );
323 
324  SAL_DLLPRIVATE void ShowAtResize();
325 
326  SAL_DLLPRIVATE virtual void Move() override;
327 
328 public: // #i123922# Needs to be called from a 2nd place now as a helper method
329  SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& );
330 
331 protected:
332 
333  SwView_Impl* GetViewImpl() {return m_pViewImpl.get();}
334 
335  void ImpSetVerb( SelectionType nSelType );
336 
337  SelectionType GetSelectionType() const { return m_nSelectionType; }
338  void SetSelectionType(SelectionType nSet) { m_nSelectionType = nSet;}
339 
340  // for SwWebView
341  void SetShell( SfxShell* pS ) { m_pShell = pS; }
342  void SetFormShell( FmFormShell* pSh ) { m_pFormShell = pSh; }
343 
344  virtual void SelectShell();
345 
346  virtual void Activate(bool) override;
347  virtual void Deactivate(bool) override;
348  virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
349  virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
350 
351  const SwFrameFormat* GetLastTableFrameFormat() const {return m_pLastTableFormat;}
352  void SetLastTableFrameFormat(const SwFrameFormat* pSet) {m_pLastTableFormat = pSet;}
353 
354  // form letter execution
355  void GenerateFormLetter(bool bUseCurrentDocument);
356 
358 
359 public:
362 
363 private:
365  static void InitInterface_Impl();
366 
367 public:
368  SfxDispatcher &GetDispatcher();
369 
370  void GotFocus() const;
371  virtual SdrView* GetDrawView() const override;
372  virtual bool HasUIFeature(SfxShellFeature nFeature) const override;
373  virtual void ShowCursor( bool bOn = true ) override;
374  virtual ErrCode DoVerb( tools::Long nVerb ) override;
375 
376  virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
377  SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override;
378  ShellMode GetShellMode() const;
379 
380  css::view::XSelectionSupplier* GetUNOObject();
381 
382  OUString GetSelectionTextParam( bool bCompleteWords,
383  bool bEraseTrail );
384  virtual bool HasSelection( bool bText = true ) const override;
385  virtual OUString GetSelectionText( bool bCompleteWords = false ) override;
386  virtual bool PrepareClose( bool bUI = true ) override;
387  virtual void MarginChanged() override;
388 
389  // replace word/selection with text from the thesaurus
390  // (this code has special handling for "in word" character)
391  void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
392  bool IsValidSelectionForThesaurus() const;
393  OUString GetThesaurusLookUpText( bool bSelection ) const;
394 
395  // immediately switch shell -> for GetSelectionObject
396  void StopShellTimer();
397 
398  SwWrtShell& GetWrtShell () const { return *m_pWrtShell; }
399  SwWrtShell* GetWrtShellPtr() const { return m_pWrtShell.get(); }
400 
401  SwEditWin &GetEditWin() { return *m_pEditWin; }
402  const SwEditWin &GetEditWin () const { return *m_pEditWin; }
403 
404 #if defined(_WIN32) || defined UNX
405  void ScannerEventHdl();
406 #endif
407 
408  // hand the handler for text blocks to the shell; create if applicable
409  SwGlossaryHdl* GetGlosHdl();
410 
411  const tools::Rectangle& GetVisArea() const { return m_aVisArea; }
412 
413  bool IsScroll(const tools::Rectangle& rRect) const;
414  void Scroll( const tools::Rectangle& rRect,
415  sal_uInt16 nRangeX = USHRT_MAX,
416  sal_uInt16 nRangeY = USHRT_MAX);
417 
418  tools::Long SetVScrollMax(tools::Long lMax);
419  tools::Long SetHScrollMax(tools::Long lMax);
420 
421  void SpellError(LanguageType eLang);
422  bool ExecSpellPopup( const Point& rPt );
423  void ExecSmartTagPopup( const Point& rPt );
424 
425  DECL_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
426  bool ExecDrwTextSpellPopup(const Point& rPt);
427 
428  void SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
429  void SetTabColFromDoc( bool b ) { m_bTabColFromDoc = b; }
430  bool IsTabColFromDoc() const { return m_bTabColFromDoc; }
431  void SetTabRowFromDoc( bool b ) { m_bTabRowFromDoc = b; }
432  bool IsTabRowFromDoc() const { return m_bTabRowFromDoc; }
433 
434  void SetNumRuleNodeFromDoc( SwTextNode * pNumRuleNode )
435  { m_pNumRuleNodeFromDoc = pNumRuleNode; }
436 
437  void DocSzChgd( const Size& rNewSize );
438  const Size& GetDocSz() const { return m_aDocSz; }
439  void SetVisArea( const tools::Rectangle&, bool bUpdateScrollbar = true);
440  void SetVisArea( const Point&, bool bUpdateScrollbar = true);
441  void CheckVisArea();
442 
443  void RecheckBrowseMode();
444  static SvxSearchDialog* GetSearchDialog();
445 
446  static sal_uInt16 GetMoveType();
447  static void SetMoveType(sal_uInt16 nSet);
448  DECL_LINK( MoveNavigationHdl, void*, void );
449  static void SetActMark(sal_Int32 nSet);
450 
451  bool HandleWheelCommands( const CommandEvent& );
452 
453  // insert frames
454  void InsFrameMode(sal_uInt16 nCols);
455 
456  void SetZoom( SvxZoomType eZoomType, short nFactor = 100, bool bViewOnly = false);
457  virtual void SetZoomFactor( const Fraction &rX, const Fraction & ) override;
458 
459  void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly = false );
460 
461  void ShowHScrollbar(bool bShow);
462  bool IsHScrollbarVisible()const;
463 
464  void ShowVScrollbar(bool bShow);
465  bool IsVScrollbarVisible()const;
466 
467  void EnableHScrollbar(bool bEnable);
468  void EnableVScrollbar(bool bEnable);
469 
470  void CreateVRuler();
471  void KillVRuler();
472  void CreateTab();
473  void KillTab();
474 
475  bool StatVRuler() const { return m_pVRuler->IsVisible(); }
476  void ChangeVRulerMetric(FieldUnit eUnit);
477  void GetVRulerMetric(FieldUnit& rToFill) const;
478 
479  SvxRuler& GetHRuler() { return *m_pHRuler; }
480  SvxRuler& GetVRuler() { return *m_pVRuler; }
481  void InvalidateRulerPos();
482  void ChangeTabMetric(FieldUnit eUnit);
483  void GetHRulerMetric(FieldUnit& rToFill) const;
484 
485  // Handler
486  void Execute(SfxRequest&);
487  void ExecLingu(SfxRequest&);
488  void ExecDlg(SfxRequest const &);
489  void ExecDlgExt(SfxRequest const &);
490  void ExecColl(SfxRequest const &);
491  void ExecutePrint(SfxRequest&);
492  void ExecDraw(SfxRequest&);
493  void ExecTabWin(SfxRequest const &);
494  void ExecuteStatusLine(SfxRequest&);
495  DECL_LINK( ExecRulerClick, Ruler *, void );
496  void ExecSearch(SfxRequest&);
497  void ExecViewOptions(SfxRequest &);
498 
499  virtual bool IsConditionalFastCall( const SfxRequest &rReq ) override;
500 
501  void StateViewOptions(SfxItemSet &);
502  void StateSearch(SfxItemSet &);
503  void GetState(SfxItemSet&);
504  void StateStatusLine(SfxItemSet&);
505  void UpdateWordCount(SfxShell*, sal_uInt16);
506  void ExecFormatFootnote();
507  void ExecNumberingOutline(SfxItemPool &);
508 
509  // functions for drawing
510  void SetDrawFuncPtr(std::unique_ptr<SwDrawBase> pFuncPtr);
511  SwDrawBase* GetDrawFuncPtr() const { return m_pDrawActual.get(); }
512  void GetDrawState(SfxItemSet &rSet);
513  void ExitDraw();
514  bool IsDrawRotate() const { return m_bDrawRotate; }
515  void FlipDrawRotate() { m_bDrawRotate = !m_bDrawRotate; }
516  bool IsDrawSelMode() const { return m_bDrawSelMode; }
517  void SetSelDrawSlot();
518  void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
519  void NoRotate(); // turn off rotate mode
520  bool EnterDrawTextMode(const Point& aDocPos);
522  bool EnterShapeDrawTextMode(SdrObject* pObject);
523  void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear();}
524  bool IsDrawMode() const { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
525  bool IsFormMode() const;
526  bool IsBezierEditMode() const;
527  bool AreOnlyFormsSelected() const;
528  bool HasOnlyObj(SdrObject const *pSdrObj, SdrInventor eObjInventor) const;
529  bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=nullptr,
530  vcl::Window* pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false );
531  bool isSignatureLineSelected() const;
532  bool isSignatureLineSigned() const;
533  bool isQRCodeSelected() const;
534 
535  void StateTabWin(SfxItemSet&);
536 
537  // attributes have changed
538  DECL_LINK( AttrChangedNotify, LinkParamNone*, void );
539 
540  // form control has been activated
541  DECL_LINK( FormControlActivated, LinkParamNone*, void );
542 
543  // edit links
544  void EditLinkDlg();
545  void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = nullptr);
546  void InsertCaption(const InsCaptionOpt *pOpt);
547 
548  // Async call by Core
549  void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
550 
551  OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
552 
555  {
556  m_nLOKPageUpDownOffset = nTwips;
557  }
558 
559  // hand over Shell
560  SfxShell *GetCurShell() { return m_pShell; }
561  SwDocShell *GetDocShell();
562  inline const SwDocShell *GetDocShell() const;
563  virtual FmFormShell *GetFormShell() override { return m_pFormShell; }
564  virtual const FmFormShell *GetFormShell() const override { return m_pFormShell; }
565 
566  // so that in the SubShells' DTors m_pShell can be reset if applicable
567  void ResetSubShell() { m_pShell = nullptr; }
568 
569  virtual void WriteUserData(OUString &, bool bBrowse = false) override;
570  virtual void ReadUserData(const OUString &, bool bBrowse = false) override;
571  virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ) override;
572  virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ) override;
573 
574  void SetCursorAtTop( bool bFlag, bool bCenter = false )
575  { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
576 
577  bool JumpToSwMark( const OUString& rMark );
578 
579  tools::Long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
580  const OUString& rFilterName, sal_Int16 nVersion = 0 );
581 
582  void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
583  tools::Long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
584  DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper *, void );
585 
586  // status methods for clipboard.
587  // Status changes now notified from the clipboard.
588  bool IsPasteAllowed();
589  bool IsPasteSpecialAllowed();
590  bool IsPasteSpreadsheet(bool bHasOwnTableCopied);
591 
592  // Enable mail merge - mail merge field dialog enabled
593  void EnableMailMerge();
594  //apply Accessibility options
595  void ApplyAccessibilityOptions(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 std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
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() const;
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 
678 {
679  return (m_aVisArea.GetWidth() * nScrollX) / 100;
680 }
681 
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 
692 std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
693  const SfxItemSet &rOptions,
694  bool bPreview);
695 
696 extern bool bDocSzUpdated;
697 
698 #endif
699 
700 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 m_nRightBorderDistance
Definition: view.hxx:221
tools::Long GetYScroll() const
Definition: view.hxx:682
size_t nUndo
Definition: view.hxx:119
FieldUnit
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
Definition: view.hxx:206
bool IsTabRowFromDoc() const
Definition: view.hxx:432
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
Definition: view.hxx:182
bool IsDrawMode() const
Definition: view.hxx:524
bool JumpToSwMark(SwViewShell const *pVwSh, const OUString &rMark)
Definition: edtwin3.cxx:118
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual const FmFormShell * GetFormShell() const override
Definition: view.hxx:564
sal_uInt16 m_nPageCnt
Definition: view.hxx:211
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:554
std::unique_ptr< SwPostItMgr > m_pPostItMgr
Definition: view.hxx:208
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:181
bool StatVRuler() const
Definition: view.hxx:475
void FlipDrawRotate()
Definition: view.hxx:515
sal_uIntPtr sal_uLong
long Long
void SetSelectionType(SelectionType nSet)
Definition: view.hxx:338
Size m_aDocSz
Definition: view.hxx:177
tools::Long GetWidth() const
long SwTwips
Definition: swtypes.hxx:49
SdrInventor
SwEditWin & GetEditWin()
Definition: view.hxx:401
static std::unique_ptr< SearchAttrItemList > s_xSearchList
Definition: view.hxx:161
static std::unique_ptr< SearchAttrItemList > s_xReplaceList
Definition: view.hxx:162
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange)
SotExchangeDest
void SetCachedString(CachedStringID id, const OUString &sStr)
Definition: view.hxx:662
const SwFrameFormat * m_pLastTableFormat
Definition: view.hxx:204
CachedStringID
Definition: view.hxx:646
void ResetSubShell()
Definition: view.hxx:567
None
SwView & m_rView
Definition: view.hxx:137
SfxShell * GetCurShell()
Definition: view.hxx:560
SwPageDesc * pPageDesc
Definition: view.hxx:110
void SetTabColFromDocPos(const Point &rPt)
Definition: view.hxx:428
SwView_Impl * GetViewImpl()
Definition: view.hxx:333
SvxRuler & GetVRuler()
Definition: view.hxx:480
virtual bool HasPrintOptionsPage() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
sal_uInt16 m_nFormSfxId
Definition: view.hxx:216
virtual void WriteUserData(OUString &, bool bBrowse=false)
SelectionType m_nSelectionType
Definition: view.hxx:210
SwFormatClipboard * m_pFormatClipboard
Definition: view.hxx:118
virtual int getPart() const
SfxPrinterChangeFlags
bool m_bVScrollbarEnabled
Definition: view.hxx:193
OUString m_sDrawCustom
Definition: view.hxx:215
SwTextNode * m_pNumRuleNodeFromDoc
Definition: view.hxx:175
static bool s_bJustOpened
Definition: view.hxx:159
SfxStyleFamily
FmFormShell * m_pFormShell
Definition: view.hxx:185
const tools::Long nScrollY
Definition: view.hxx:78
std::unique_ptr< SwDrawBase > m_pDrawActual
Definition: view.hxx:202
ShellMode
Definition: view.hxx:85
const SwFrameFormat * GetLastTableFrameFormat() const
Definition: view.hxx:351
VclPtr< SwEditWin > m_pEditWin
Definition: view.hxx:180
SotExchangeDest m_nLastPasteDestination
Definition: view.hxx:217
bool IsDrawSelMode() const
Definition: view.hxx:516
const tools::Long nScrollX
Definition: view.hxx:77
struct _xmlTextWriter * xmlTextWriterPtr
void SetTabRowFromDoc(bool b)
Definition: view.hxx:431
#define SFX_DECL_VIEWFACTORY(Class)
sal_uInt16 m_nLeftBorderDistance
Definition: view.hxx:220
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:563
Style of a layout element.
Definition: frmfmt.hxx:57
std::unique_ptr< SwGlossaryHdl > m_pGlosHdl
Definition: view.hxx:201
sal_uInt16 m_nOldPageNum
Definition: view.hxx:171
SfxDispatcher * GetDispatcher() const
const SwEditWin & GetEditWin() const
Definition: view.hxx:402
SwTextFormatColl * pTextColl
Definition: view.hxx:109
SwNumRule * pNumRule
Definition: view.hxx:113
VclPtr< vcl::Window > m_pScrollFill
Definition: view.hxx:195
static sal_Int32 m_nActMark
Definition: view.hxx:155
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:307
void SetShell(SfxShell *pS)
Definition: view.hxx:341
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
SfxShellFeature
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
Definition: view.cxx:1041
SwTwips m_nLOKPageUpDownOffset
LibreOfficeKit has to force the page size for PgUp/PgDown functionality based on the user's view...
Definition: view.hxx:252
static SvxSearchItem * GetSearchItem()
Definition: view.hxx:634
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:657
bool IsDrawRotate() const
Definition: view.hxx:514
virtual void Activate(bool IsMDIActivate) override
void SetFormShell(FmFormShell *pSh)
Definition: view.hxx:342
void SetPrinter(IDocumentDeviceAccess *, SfxPrinter const *, bool bWeb)
Definition: viewprt.cxx:76
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
void LeaveDrawCreate()
Definition: view.hxx:523
bool m_bWheelScrollInProgress
Definition: view.hxx:225
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:511
const SwPostItMgr * GetPostItMgr() const
Definition: view.hxx:622
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:198
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
Definition: viewprt.cxx:293
virtual void Deactivate(bool IsMDIActivate) override
SwDocShell * GetDocShell()
Definition: view.cxx:1108
OUString m_sSwViewData
Definition: view.hxx:165
SelectionType
Definition: wrtsh.hxx:58
SwCharFormat * pCharFormat
Definition: view.hxx:112
virtual void NotifyCursor(SfxViewShell *) const
const Size & GetDocSz() const
Definition: view.hxx:438
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
tools::Rectangle m_aVisArea
Definition: view.hxx:178
sal_uInt16 m_nNewPage
Definition: view.hxx:169
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:399
VclPtr< SwScrollbar > m_pVScrollbar
Definition: view.hxx:189
Timer m_aTimer
Definition: view.hxx:164
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
void SetCursorAtTop(bool bFlag, bool bCenter=false)
Definition: view.hxx:574
SvxSpellArea
bool IsTabColFromDoc() const
Definition: view.hxx:430
std::unique_ptr< SwView_Impl > m_pViewImpl
Definition: view.hxx:187
static bool s_bFound
Definition: view.hxx:158
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
This class acts as data container and execution class for the format paintbrush feature in writer...
void SetLastTableFrameFormat(const SwFrameFormat *pSet)
Definition: view.hxx:352
Point m_aTabColFromDocPos
Definition: view.hxx:174
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:621
SvxSearchCmd m_eLastSearchCommand
Definition: view.hxx:223
static sal_uInt16 m_nMoveType
Definition: view.hxx:154
virtual SfxPrinter * GetPrinter(bool bCreate=false)
SvxRuler & GetHRuler()
Definition: view.hxx:479
SvxSearchCmd
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:411
bool bDocSzUpdated
Definition: view.cxx:113
tools::Long GetHeight() const
sal_uInt16 m_nDrawSfxId
Definition: view.hxx:214
tools::Long GetXScroll() const
Definition: view.hxx:677
SfxShell * m_pShell
Definition: view.hxx:184
SvxZoomType
SelectionType GetSelectionType() const
Definition: view.hxx:337
virtual void Move()
#define SW_VIEWSHELL
Definition: shellid.hxx:38
OUString m_sOldSectionName
Definition: view.hxx:172
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
union SwApplyTemplate::@32 aColl
void SetNumRuleNodeFromDoc(SwTextNode *pNumRuleNode)
Definition: view.hxx:434
static SvxSearchItem * s_pSrchItem
Definition: view.hxx:152
bool m_bHScrollbarEnabled
Definition: view.hxx:192
void FlipDrawSelMode()
Definition: view.hxx:518
static bool s_bExtra
Definition: view.hxx:157
sal_uInt16 nColor
Definition: view.hxx:117
void SetTabColFromDoc(bool b)
Definition: view.hxx:429
Definition: view.hxx:144
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY)
#define SFX_DECL_INTERFACE(nId)