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;
219 
220  // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
223 
225 
227 
228  bool m_bCenterCursor : 1,
229  m_bTopCursor : 1,
230  m_bTabColFromDoc : 1,
231  m_bTabRowFromDoc : 1,
232  m_bSetTabColFromDoc : 1 ,
233  m_bSetTabRowFromDoc : 1,
234  m_bAttrChgNotified : 1,
235  m_bAttrChgNotifiedWithRegistrations : 1,
236  m_bVerbsActive : 1,
237  m_bDrawRotate : 1,
238  m_bDrawSelMode : 1,
239  m_bShowAtResize : 1,
240  m_bInOuterResizePixel : 1,
241  m_bInInnerResizePixel : 1,
242  m_bPasteState : 1,
243  m_bPasteSpecialState : 1,
244  m_bInMailMerge : 1,
245  m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
246  m_bOldShellWasPagePreview : 1,
247  m_bIsPreviewDoubleClick : 1, // #i114045#
248  m_bMakeSelectionVisible : 1; // transport the bookmark selection
249  bool m_bInitOnceCompleted = false;
250 
254 
255  // methods for searching
256  // set search context
257  SAL_DLLPRIVATE bool SearchAndWrap(bool bApi);
258  SAL_DLLPRIVATE bool SearchAll();
259  SAL_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
260  SAL_DLLPRIVATE void Replace();
261 
262  bool IsDocumentBorder();
263 
264  SAL_DLLPRIVATE bool IsTextTool() const;
265 
266  DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
267 
268  inline tools::Long GetXScroll() const;
269  inline tools::Long GetYScroll() const;
270  SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
271  SAL_DLLPRIVATE void CalcPt( Point* pPt,const tools::Rectangle& rRect,
272  sal_uInt16 nRangeX,
273  sal_uInt16 nRangeY);
274 
275  SAL_DLLPRIVATE bool GetPageScrollUpOffset(SwTwips& rOff) const;
276  SAL_DLLPRIVATE bool GetPageScrollDownOffset(SwTwips& rOff) const;
277 
278  // scrollbar movements
279  SAL_DLLPRIVATE bool PageUp();
280  SAL_DLLPRIVATE bool PageDown();
281  SAL_DLLPRIVATE bool PageUpCursor(bool bSelect);
282  SAL_DLLPRIVATE bool PageDownCursor(bool bSelect);
283  SAL_DLLPRIVATE void PhyPageUp();
284  SAL_DLLPRIVATE void PhyPageDown();
285 
286  SAL_DLLPRIVATE void CreateScrollbar( bool bHori );
287  DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar*, void );
288  DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar*, void );
289  SAL_DLLPRIVATE bool UpdateScrollbars();
290  DECL_DLLPRIVATE_LINK( WindowChildEventListener, VclWindowEvent&, void );
291  SAL_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
292 
293  // linguistics functions
294  SAL_DLLPRIVATE void HyphenateDocument();
295  SAL_DLLPRIVATE bool IsDrawTextHyphenate();
296  SAL_DLLPRIVATE void HyphenateDrawText();
297  SAL_DLLPRIVATE void StartThesaurus();
298 
299  // text conversion
300  SAL_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
301 
302  // used for spell checking and text conversion
303  SAL_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, bool bStartDone,
304  bool bEndDone, SwConversionArgs *pConvArgs );
305  SAL_DLLPRIVATE void SpellEnd( SwConversionArgs const *pConvArgs );
306 
307  SAL_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
308  SAL_DLLPRIVATE void SpellContext(bool bOn = true)
309  { m_bCenterCursor = bOn; }
310 
311  // for readonly switching
312  SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
313  SAL_DLLPRIVATE void CheckReadonlyState();
314  SAL_DLLPRIVATE void CheckReadonlySelection();
315 
316  // method for rotating PageDesc
317  SAL_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
318 
319  SAL_DLLPRIVATE void SetZoom_( const Size &rEditSz,
320  SvxZoomType eZoomType,
321  short nFactor,
322  bool bViewOnly);
323  SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill );
324 
325  SAL_DLLPRIVATE void ShowAtResize();
326 
327  SAL_DLLPRIVATE virtual void Move() override;
328 
329 public: // #i123922# Needs to be called from a 2nd place now as a helper method
330  SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& );
331 
332 protected:
333 
334  SwView_Impl* GetViewImpl() {return m_pViewImpl.get();}
335 
336  void ImpSetVerb( SelectionType nSelType );
337 
338  SelectionType GetSelectionType() const { return m_nSelectionType; }
339  void SetSelectionType(SelectionType nSet) { m_nSelectionType = nSet;}
340 
341  // for SwWebView
342  void SetShell( SfxShell* pS ) { m_pShell = pS; }
343  void SetFormShell( FmFormShell* pSh ) { m_pFormShell = pSh; }
344 
345  virtual void SelectShell();
346 
347  virtual void Activate(bool) override;
348  virtual void Deactivate(bool) override;
349  virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
350  virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
351 
352  const SwFrameFormat* GetLastTableFrameFormat() const {return m_pLastTableFormat;}
353  void SetLastTableFrameFormat(const SwFrameFormat* pSet) {m_pLastTableFormat = pSet;}
354 
355  // form letter execution
356  void GenerateFormLetter(bool bUseCurrentDocument);
357 
359 
360 public:
363 
364 private:
366  static void InitInterface_Impl();
367 
368 public:
369  SfxDispatcher &GetDispatcher();
370 
371  void GotFocus() const;
372  virtual SdrView* GetDrawView() const override;
373  virtual bool HasUIFeature(SfxShellFeature nFeature) const override;
374  virtual void ShowCursor( bool bOn = true ) override;
375  virtual ErrCode DoVerb( tools::Long nVerb ) override;
376 
377  virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
378  SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override;
379  ShellMode GetShellMode() const;
380 
381  css::view::XSelectionSupplier* GetUNOObject();
382 
383  OUString GetSelectionTextParam( bool bCompleteWords,
384  bool bEraseTrail );
385  virtual bool HasSelection( bool bText = true ) const override;
386  virtual OUString GetSelectionText( bool bCompleteWords = false ) override;
387  virtual bool PrepareClose( bool bUI = true ) override;
388  virtual void MarginChanged() override;
389 
390  // replace word/selection with text from the thesaurus
391  // (this code has special handling for "in word" character)
392  void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
393  bool IsValidSelectionForThesaurus() const;
394  OUString GetThesaurusLookUpText( bool bSelection ) const;
395 
396  // immediately switch shell -> for GetSelectionObject
397  void StopShellTimer();
398 
399  SwWrtShell& GetWrtShell () const { return *m_pWrtShell; }
400  SwWrtShell* GetWrtShellPtr() const { return m_pWrtShell.get(); }
401 
402  SwEditWin &GetEditWin() { return *m_pEditWin; }
403  const SwEditWin &GetEditWin () const { return *m_pEditWin; }
404 
405 #if defined(_WIN32) || defined UNX
406  void ScannerEventHdl();
407 #endif
408 
409  // hand the handler for text blocks to the shell; create if applicable
410  SwGlossaryHdl* GetGlosHdl();
411 
412  const tools::Rectangle& GetVisArea() const { return m_aVisArea; }
413 
414  bool IsScroll(const tools::Rectangle& rRect) const;
415  void Scroll( const tools::Rectangle& rRect,
416  sal_uInt16 nRangeX = USHRT_MAX,
417  sal_uInt16 nRangeY = USHRT_MAX);
418 
419  tools::Long SetVScrollMax(tools::Long lMax);
420  tools::Long SetHScrollMax(tools::Long lMax);
421 
422  void SpellError(LanguageType eLang);
423  bool ExecSpellPopup( const Point& rPt );
424  void ExecSmartTagPopup( const Point& rPt );
425 
426  DECL_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
427  bool ExecDrwTextSpellPopup(const Point& rPt);
428 
429  void SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
430  void SetTabColFromDoc( bool b ) { m_bTabColFromDoc = b; }
431  bool IsTabColFromDoc() const { return m_bTabColFromDoc; }
432  void SetTabRowFromDoc( bool b ) { m_bTabRowFromDoc = b; }
433  bool IsTabRowFromDoc() const { return m_bTabRowFromDoc; }
434 
435  void SetNumRuleNodeFromDoc( SwTextNode * pNumRuleNode )
436  { m_pNumRuleNodeFromDoc = pNumRuleNode; }
437 
438  void DocSzChgd( const Size& rNewSize );
439  const Size& GetDocSz() const { return m_aDocSz; }
440  void SetVisArea( const tools::Rectangle&, bool bUpdateScrollbar = true);
441  void SetVisArea( const Point&, bool bUpdateScrollbar = true);
442  void CheckVisArea();
443 
444  void RecheckBrowseMode();
445  static SvxSearchDialog* GetSearchDialog();
446 
447  static sal_uInt16 GetMoveType();
448  static void SetMoveType(sal_uInt16 nSet);
449  DECL_LINK( MoveNavigationHdl, void*, void );
450  static void SetActMark(sal_Int32 nSet);
451 
452  bool HandleWheelCommands( const CommandEvent& );
453 
454  // insert frames
455  void InsFrameMode(sal_uInt16 nCols);
456 
457  void SetZoom( SvxZoomType eZoomType, short nFactor = 100, bool bViewOnly = false);
458  virtual void SetZoomFactor( const Fraction &rX, const Fraction & ) override;
459 
460  void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly = false );
461 
462  void ShowHScrollbar(bool bShow);
463  bool IsHScrollbarVisible()const;
464 
465  void ShowVScrollbar(bool bShow);
466  bool IsVScrollbarVisible()const;
467 
468  void EnableHScrollbar(bool bEnable);
469  void EnableVScrollbar(bool bEnable);
470 
471  void CreateVRuler();
472  void KillVRuler();
473  void CreateTab();
474  void KillTab();
475 
476  bool StatVRuler() const { return m_pVRuler->IsVisible(); }
477  void ChangeVRulerMetric(FieldUnit eUnit);
478  void GetVRulerMetric(FieldUnit& rToFill) const;
479 
480  SvxRuler& GetHRuler() { return *m_pHRuler; }
481  SvxRuler& GetVRuler() { return *m_pVRuler; }
482  void InvalidateRulerPos();
483  void ChangeTabMetric(FieldUnit eUnit);
484  void GetHRulerMetric(FieldUnit& rToFill) const;
485 
486  // Handler
487  void Execute(SfxRequest&);
488  void ExecLingu(SfxRequest&);
489  void ExecDlg(SfxRequest const &);
490  void ExecDlgExt(SfxRequest const &);
491  void ExecColl(SfxRequest const &);
492  void ExecutePrint(SfxRequest&);
493  void ExecDraw(SfxRequest&);
494  void ExecTabWin(SfxRequest const &);
495  void ExecuteStatusLine(SfxRequest&);
496  DECL_LINK( ExecRulerClick, Ruler *, void );
497  void ExecSearch(SfxRequest&);
498  void ExecViewOptions(SfxRequest &);
499 
500  virtual bool IsConditionalFastCall( const SfxRequest &rReq ) override;
501 
502  void StateViewOptions(SfxItemSet &);
503  void StateSearch(SfxItemSet &);
504  void GetState(SfxItemSet&);
505  void StateStatusLine(SfxItemSet&);
506  void UpdateWordCount(SfxShell*, sal_uInt16);
507  void ExecFormatFootnote();
508  void ExecNumberingOutline(SfxItemPool &);
509 
510  // functions for drawing
511  void SetDrawFuncPtr(std::unique_ptr<SwDrawBase> pFuncPtr);
512  SwDrawBase* GetDrawFuncPtr() const { return m_pDrawActual.get(); }
513  void GetDrawState(SfxItemSet &rSet);
514  void ExitDraw();
515  bool IsDrawRotate() const { return m_bDrawRotate; }
516  void FlipDrawRotate() { m_bDrawRotate = !m_bDrawRotate; }
517  bool IsDrawSelMode() const { return m_bDrawSelMode; }
518  void SetSelDrawSlot();
519  void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
520  void NoRotate(); // turn off rotate mode
521  bool EnterDrawTextMode(const Point& aDocPos);
523  bool EnterShapeDrawTextMode(SdrObject* pObject);
524  void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear(); m_eFormObjKind = OBJ_NONE; }
525  bool IsDrawMode() const { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
526  bool IsFormMode() const;
527  bool IsBezierEditMode() const;
528  bool AreOnlyFormsSelected() const;
529  bool HasOnlyObj(SdrObject const *pSdrObj, SdrInventor eObjInventor) const;
530  bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=nullptr,
531  vcl::Window* pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false );
532  bool isSignatureLineSelected() const;
533  bool isSignatureLineSigned() const;
534  bool isQRCodeSelected() const;
535 
536  void StateTabWin(SfxItemSet&);
537 
538  // attributes have changed
539  DECL_LINK( AttrChangedNotify, LinkParamNone*, 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();
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  tools::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  tools::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  bool IsPasteSpreadsheet(bool bHasOwnTableCopied);
592 
593  // Enable mail merge - mail merge field dialog enabled
594  void EnableMailMerge();
595  //apply Accessibility options
596  void ApplyAccessibilityOptions(SvtAccessibilityOptions const & rAccessibilityOptions);
597 
598  SwView(SfxViewFrame* pFrame, SfxViewShell*);
599  virtual ~SwView() override;
600 
601  void NotifyDBChanged();
602 
603  SfxObjectShellLock CreateTmpSelectionDoc();
604 
605  void AddTransferable(SwTransferable& rTransferable);
606 
607  // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
608  // or to support printing
609  void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem> const & rConfigItem);
610  std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const;
611  std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr);
612 
613  void ExecFormatPaintbrush(SfxRequest const &);
614  void StateFormatPaintbrush(SfxItemSet &);
615 
616  // public for D&D
617  ErrCode InsertGraphic( const OUString &rPath, const OUString &rFilter,
618  bool bLink, GraphicFilter *pFlt );
619 
620  void ExecuteScan( SfxRequest& rReq );
621 
622  SwPostItMgr* GetPostItMgr() { return m_pPostItMgr.get();}
623  const SwPostItMgr* GetPostItMgr() const { return m_pPostItMgr.get();}
624 
625  // exhibition hack (MA,MBA)
626  void SelectShellForDrop();
627 
628  void UpdateDocStats();
629 
630  // methods for printing
631  SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) override;
632  SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const override;
633  SAL_DLLPRIVATE virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
634  const SfxItemSet& rSet) override;
635  static SvxSearchItem* GetSearchItem() { return s_pSrchItem; }
637  int getPart() const override;
639  void dumpAsXml(xmlTextWriterPtr pWriter) const override;
640  void SetRedlineAuthor(const OUString& rAuthor);
641  const OUString& GetRedlineAuthor() const;
643  void NotifyCursor(SfxViewShell* pViewShell) const override;
644  void ShowUIElement(const OUString& sElementURL) const;
645 
646 
648  {
653  CachedStrings
654  };
655 
656  OUString m_StringCache[CachedStrings];
657 
658  const OUString& GetCachedString(CachedStringID id)
659  {
660  return m_StringCache[id];
661  }
662 
663  void SetCachedString(CachedStringID id, const OUString& sStr)
664  {
665  m_StringCache[id] = sStr;
666  }
667 
668  const OUString& GetOldGrfCat();
669  void SetOldGrfCat(const OUString& sStr);
670  const OUString& GetOldTabCat();
671  void SetOldTabCat(const OUString& sStr);
672  const OUString& GetOldFrameCat();
673  void SetOldFrameCat(const OUString& sStr);
674  const OUString& GetOldDrwCat();
675  void SetOldDrwCat(const OUString& sStr);
676 };
677 
679 {
680  return (m_aVisArea.GetWidth() * nScrollX) / 100;
681 }
682 
684 {
685  return (m_aVisArea.GetHeight() * nScrollY) / 100;
686 }
687 
688 inline const SwDocShell *SwView::GetDocShell() const
689 {
690  return const_cast<SwView*>(this)->GetDocShell();
691 }
692 
693 std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
694  const SfxItemSet &rOptions,
695  bool bPreview);
696 
697 extern bool bDocSzUpdated;
698 
699 #endif
700 
701 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 m_nRightBorderDistance
Definition: view.hxx:222
tools::Long GetYScroll() const
Definition: view.hxx:683
size_t nUndo
Definition: view.hxx:119
FieldUnit
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
Definition: view.hxx:206
SdrObjKind m_eFormObjKind
Definition: view.hxx:217
bool IsTabRowFromDoc() const
Definition: view.hxx:433
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
Definition: view.hxx:182
bool IsDrawMode() const
Definition: view.hxx:525
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:565
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:555
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:476
void FlipDrawRotate()
Definition: view.hxx:516
sal_uIntPtr sal_uLong
long Long
void SetSelectionType(SelectionType nSet)
Definition: view.hxx:339
Size m_aDocSz
Definition: view.hxx:177
tools::Long GetWidth() const
SdrInventor
SwEditWin & GetEditWin()
Definition: view.hxx:402
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:663
const SwFrameFormat * m_pLastTableFormat
Definition: view.hxx:204
CachedStringID
Definition: view.hxx:647
void ResetSubShell()
Definition: view.hxx:568
None
SdrObjKind
SwView & m_rView
Definition: view.hxx:137
SfxShell * GetCurShell()
Definition: view.hxx:561
SwPageDesc * pPageDesc
Definition: view.hxx:110
void SetTabColFromDocPos(const Point &rPt)
Definition: view.hxx:429
SwView_Impl * GetViewImpl()
Definition: view.hxx:334
SvxRuler & GetVRuler()
Definition: view.hxx:481
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:352
VclPtr< SwEditWin > m_pEditWin
Definition: view.hxx:180
SotExchangeDest m_nLastPasteDestination
Definition: view.hxx:218
bool IsDrawSelMode() const
Definition: view.hxx:517
const tools::Long nScrollX
Definition: view.hxx:77
struct _xmlTextWriter * xmlTextWriterPtr
void SetTabRowFromDoc(bool b)
Definition: view.hxx:432
#define SFX_DECL_VIEWFACTORY(Class)
sal_uInt16 m_nLeftBorderDistance
Definition: view.hxx:221
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:564
Style of a layout element.
Definition: frmfmt.hxx:58
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:403
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:308
void SetShell(SfxShell *pS)
Definition: view.hxx:342
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
SfxShellFeature
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
Definition: view.cxx:1042
SwTwips m_nLOKPageUpDownOffset
LibreOfficeKit has to force the page size for PgUp/PgDown functionality based on the user's view...
Definition: view.hxx:253
static SvxSearchItem * GetSearchItem()
Definition: view.hxx:635
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:658
bool IsDrawRotate() const
Definition: view.hxx:515
virtual void Activate(bool IsMDIActivate) override
void SetFormShell(FmFormShell *pSh)
Definition: view.hxx:343
void SetPrinter(IDocumentDeviceAccess *, SfxPrinter const *, bool bWeb)
Definition: viewprt.cxx:76
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
void LeaveDrawCreate()
Definition: view.hxx:524
bool m_bWheelScrollInProgress
Definition: view.hxx:226
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:512
const SwPostItMgr * GetPostItMgr() const
Definition: view.hxx:623
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
tools::Long SwTwips
Definition: swtypes.hxx:49
SwDocShell * GetDocShell()
Definition: view.cxx:1109
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:439
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:400
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:575
SvxSpellArea
bool IsTabColFromDoc() const
Definition: view.hxx:431
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:353
Point m_aTabColFromDocPos
Definition: view.hxx:174
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:622
SvxSearchCmd m_eLastSearchCommand
Definition: view.hxx:224
static sal_uInt16 m_nMoveType
Definition: view.hxx:154
virtual SfxPrinter * GetPrinter(bool bCreate=false)
SvxRuler & GetHRuler()
Definition: view.hxx:480
SvxSearchCmd
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:412
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:678
SfxShell * m_pShell
Definition: view.hxx:184
SvxZoomType
SelectionType GetSelectionType() const
Definition: view.hxx:338
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:435
static SvxSearchItem * s_pSrchItem
Definition: view.hxx:152
OBJ_NONE
bool m_bHScrollbarEnabled
Definition: view.hxx:192
void FlipDrawSelMode()
Definition: view.hxx:519
static bool s_bExtra
Definition: view.hxx:157
sal_uInt16 nColor
Definition: view.hxx:117
void SetTabColFromDoc(bool b)
Definition: view.hxx:430
Definition: view.hxx:144
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY)
#define SFX_DECL_INTERFACE(nId)