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