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 bool m_bIsHighlightCharDF = false;
274
275 static constexpr sal_uInt16 MAX_ZOOM_PERCENT = 600;
276 static constexpr sal_uInt16 MIN_ZOOM_PERCENT = 20;
277
278 // methods for searching
279 // set search context
280 SAL_DLLPRIVATE bool SearchAndWrap(bool bApi);
281 SAL_DLLPRIVATE sal_uInt16 SearchAll();
282 SAL_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
283 SAL_DLLPRIVATE void Replace();
284
285 bool IsDocumentBorder();
286
287 SAL_DLLPRIVATE bool IsTextTool() const;
288
289 DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
290
291 inline tools::Long GetXScroll() const;
292 inline tools::Long GetYScroll() const;
293 SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
294 SAL_DLLPRIVATE void CalcPt( Point* pPt,const tools::Rectangle& rRect,
295 sal_uInt16 nRangeX,
296 sal_uInt16 nRangeY);
297
298 SAL_DLLPRIVATE bool GetPageScrollUpOffset(SwTwips& rOff) const;
299 SAL_DLLPRIVATE bool GetPageScrollDownOffset(SwTwips& rOff) const;
300
301 // scrollbar movements
302 SAL_DLLPRIVATE bool PageUp();
303 SAL_DLLPRIVATE bool PageDown();
304 SAL_DLLPRIVATE bool PageUpCursor(bool bSelect);
305 SAL_DLLPRIVATE bool PageDownCursor(bool bSelect);
306 SAL_DLLPRIVATE void PhyPageUp();
307 SAL_DLLPRIVATE void PhyPageDown();
308
309 SAL_DLLPRIVATE void CreateScrollbar( bool bHori );
310 DECL_DLLPRIVATE_LINK(HoriScrollHdl, weld::Scrollbar&, void);
311 DECL_DLLPRIVATE_LINK(VertScrollHdl, weld::Scrollbar&, void);
312 SAL_DLLPRIVATE void EndScrollHdl(weld::Scrollbar& rScrollbar, bool bHorizontal);
313 SAL_DLLPRIVATE bool UpdateScrollbars();
314 DECL_DLLPRIVATE_LINK( WindowChildEventListener, VclWindowEvent&, void );
315 SAL_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
316
317 // linguistics functions
318 SAL_DLLPRIVATE void HyphenateDocument();
319 SAL_DLLPRIVATE bool IsDrawTextHyphenate();
320 SAL_DLLPRIVATE void HyphenateDrawText();
321 SAL_DLLPRIVATE void StartThesaurus();
322
323 // text conversion
324 SAL_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
325
326 // used for spell checking and text conversion
327 SAL_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, bool bStartDone,
328 bool bEndDone, SwConversionArgs *pConvArgs );
329 SAL_DLLPRIVATE void SpellEnd( SwConversionArgs const *pConvArgs );
330
331 SAL_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
332 SAL_DLLPRIVATE void SpellContext(bool bOn = true)
333 { m_bCenterCursor = bOn; }
334
335 // for readonly switching
336 SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
337 SAL_DLLPRIVATE void CheckReadonlyState();
338 SAL_DLLPRIVATE void CheckReadonlySelection();
339
340 // method for rotating PageDesc
341 SAL_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
342
343 SAL_DLLPRIVATE void SetZoom_( const Size &rEditSz,
344 SvxZoomType eZoomType,
345 short nFactor,
346 bool bViewOnly);
347 SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill );
348
349 SAL_DLLPRIVATE void ShowAtResize();
350
351 SAL_DLLPRIVATE virtual void Move() override;
352
353public: // #i123922# Needs to be called from a 2nd place now as a helper method
354 SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& );
355
356protected:
357
358 SwView_Impl* GetViewImpl() {return m_pViewImpl.get();}
359
360 void ImpSetVerb( SelectionType nSelType );
361
362 SelectionType GetSelectionType() const { return m_nSelectionType; }
363 void SetSelectionType(SelectionType nSet) { m_nSelectionType = nSet;}
364
365 // for SwWebView
366 void SetShell( SfxShell* pS ) { m_pShell = pS; }
367 void SetFormShell( FmFormShell* pSh ) { m_pFormShell = pSh; }
368
369 virtual void SelectShell();
370
371 virtual void Activate(bool) override;
372 virtual void Deactivate(bool) override;
373 virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
374 virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
375
376 const SwFrameFormat* GetLastTableFrameFormat() const {return m_pLastTableFormat;}
377 void SetLastTableFrameFormat(const SwFrameFormat* pSet) {m_pLastTableFormat = pSet;}
378
379 // form letter execution
380 void GenerateFormLetter(bool bUseCurrentDocument);
381
383
384public:
387
388private:
390 static void InitInterface_Impl();
391
392public:
394
395 void GotFocus() const;
396 virtual SdrView* GetDrawView() const override;
397 virtual bool HasUIFeature(SfxShellFeature nFeature) const override;
398 virtual void ShowCursor( bool bOn = true ) override;
399 virtual ErrCode DoVerb(sal_Int32 nVerb) override;
400
401 virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
402 SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override;
403 ShellMode GetShellMode() const;
404
405 css::view::XSelectionSupplier* GetUNOObject();
406
407 OUString GetSelectionTextParam( bool bCompleteWords,
408 bool bEraseTrail );
409 virtual bool HasSelection( bool bText = true ) const override;
410 virtual OUString GetSelectionText( bool bCompleteWords = false, bool bOnlyASample = false ) override;
411 virtual bool PrepareClose( bool bUI = true ) override;
412 virtual void MarginChanged() override;
413
414 // replace word/selection with text from the thesaurus
415 // (this code has special handling for "in word" character)
416 void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
417 bool IsValidSelectionForThesaurus() const;
418 OUString GetThesaurusLookUpText( bool bSelection ) const;
419
420 // immediately switch shell -> for GetSelectionObject
421 void StopShellTimer();
422
423 SwWrtShell& GetWrtShell () const { return *m_pWrtShell; }
424 SwWrtShell* GetWrtShellPtr() const { return m_pWrtShell.get(); }
425
426 SwEditWin &GetEditWin() { return *m_pEditWin; }
427 const SwEditWin &GetEditWin () const { return *m_pEditWin; }
428
429#if defined(_WIN32) || defined UNX
430 void ScannerEventHdl();
431#endif
432
433 // hand the handler for text blocks to the shell; create if applicable
434 SwGlossaryHdl* GetGlosHdl();
435
436 const tools::Rectangle& GetVisArea() const { return m_aVisArea; }
437
438 bool IsScroll(const tools::Rectangle& rRect) const;
439 void Scroll( const tools::Rectangle& rRect,
440 sal_uInt16 nRangeX = USHRT_MAX,
441 sal_uInt16 nRangeY = USHRT_MAX);
442
443 tools::Long SetVScrollMax(tools::Long lMax);
444 tools::Long SetHScrollMax(tools::Long lMax);
445
446 void SpellError(LanguageType eLang);
447 bool ExecSpellPopup( const Point& rPt );
448 void ExecSmartTagPopup( const Point& rPt );
449
450 DECL_DLLPRIVATE_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
451 bool ExecDrwTextSpellPopup(const Point& rPt);
452
453 void SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
454 void SetTabColFromDoc( bool b ) { m_bTabColFromDoc = b; }
455 bool IsTabColFromDoc() const { return m_bTabColFromDoc; }
456 void SetTabRowFromDoc( bool b ) { m_bTabRowFromDoc = b; }
457 bool IsTabRowFromDoc() const { return m_bTabRowFromDoc; }
458
459 void SetNumRuleNodeFromDoc( SwTextNode * pNumRuleNode )
460 { m_pNumRuleNodeFromDoc = pNumRuleNode; }
461
462 void DocSzChgd( const Size& rNewSize );
463 const Size& GetDocSz() const { return m_aDocSz; }
464 void SetVisArea( const tools::Rectangle&, bool bUpdateScrollbar = true);
465 void SetVisArea( const Point&, bool bUpdateScrollbar = true);
466 void CheckVisArea();
467
468 void RecheckBrowseMode();
469 static SvxSearchDialog* GetSearchDialog();
470
471 static sal_uInt16 GetMoveType();
472 static void SetMoveType(sal_uInt16 nSet);
473 DECL_DLLPRIVATE_LINK( MoveNavigationHdl, void*, void );
474 static void SetActMark(sal_Int32 nSet);
475
476 bool HandleWheelCommands( const CommandEvent& );
477 bool HandleGestureZoomCommand(const CommandEvent&);
478
479 // insert frames
480 void InsFrameMode(sal_uInt16 nCols);
481
482 void SetZoom( SvxZoomType eZoomType, short nFactor = 100, bool bViewOnly = false);
483 virtual void SetZoomFactor( const Fraction &rX, const Fraction & ) override;
484
485 void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly = false );
486
487 void ShowHScrollbar(bool bShow);
488 bool IsHScrollbarVisible()const;
489
490 void ShowVScrollbar(bool bShow);
491 bool IsVScrollbarVisible()const;
492
493 void EnableHScrollbar(bool bEnable);
494 void EnableVScrollbar(bool bEnable);
495
496 void CreateVRuler();
497 void KillVRuler();
498 void CreateTab();
499 void KillTab();
500
501 bool StatVRuler() const { return m_pVRuler->IsVisible(); }
502 void ChangeVRulerMetric(FieldUnit eUnit);
503 void GetVRulerMetric(FieldUnit& rToFill) const;
504
505 SvxRuler& GetHRuler() { return *m_pHRuler; }
506 SvxRuler& GetVRuler() { return *m_pVRuler; }
507 void InvalidateRulerPos();
508 void ChangeTabMetric(FieldUnit eUnit);
509 void GetHRulerMetric(FieldUnit& rToFill) const;
510
511 // Handler
512 void Execute(SfxRequest&);
513 void ExecLingu(SfxRequest&);
514 void ExecDlg(SfxRequest const &);
515 void ExecDlgExt(SfxRequest const &);
516 void ExecColl(SfxRequest const &);
517 void ExecutePrint(SfxRequest&);
518 void ExecDraw(const SfxRequest&);
519 void ExecTabWin(SfxRequest const &);
520 void ExecuteStatusLine(SfxRequest&);
521 DECL_DLLPRIVATE_LINK( ExecRulerClick, Ruler *, void );
522 void ExecSearch(SfxRequest&);
523 void ExecViewOptions(SfxRequest &);
524
525 virtual bool IsConditionalFastCall( const SfxRequest &rReq ) override;
526
527 void StateViewOptions(SfxItemSet &);
528 void StateSearch(SfxItemSet &);
529 void GetState(SfxItemSet&);
530 void StateStatusLine(SfxItemSet&);
531 void UpdateWordCount(SfxShell*, sal_uInt16);
532 void ExecFormatFootnote();
533 void ExecNumberingOutline(SfxItemPool &);
534
535 // functions for drawing
536 void SetDrawFuncPtr(std::unique_ptr<SwDrawBase> pFuncPtr);
537 SwDrawBase* GetDrawFuncPtr() const { return m_pDrawActual.get(); }
538 void GetDrawState(SfxItemSet &rSet);
539 void ExitDraw();
540 bool IsDrawRotate() const { return m_bDrawRotate; }
541 void FlipDrawRotate() { m_bDrawRotate = !m_bDrawRotate; }
542 bool IsDrawSelMode() const { return m_bDrawSelMode; }
543 void SetSelDrawSlot();
544 void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
545 void NoRotate(); // turn off rotate mode
546 bool EnterDrawTextMode(const Point& aDocPos);
548 bool EnterShapeDrawTextMode(SdrObject* pObject);
549 void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear(); m_eFormObjKind = SdrObjKind::NONE; }
550 bool IsDrawMode() const { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
551 bool IsFormMode() const;
552 bool IsBezierEditMode() const;
553 bool AreOnlyFormsSelected() const;
554 bool HasOnlyObj(SdrObject const *pSdrObj, SdrInventor eObjInventor) const;
555 bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=nullptr,
556 vcl::Window* pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false );
557 bool isSignatureLineSelected() const;
558 bool isSignatureLineSigned() const;
559 bool isQRCodeSelected() const;
560
561 void StateTabWin(SfxItemSet&);
562
563 // attributes have changed
564 DECL_LINK( AttrChangedNotify, LinkParamNone*, void );
565
566 // form control has been activated
567 DECL_DLLPRIVATE_LINK( FormControlActivated, LinkParamNone*, void );
568
569 // edit links
570 void EditLinkDlg();
571 void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = nullptr);
572 void InsertCaption(const InsCaptionOpt *pOpt);
573
574 // Async call by Core
575 void UpdatePageNums();
576
577 OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
578
581 {
582 m_nLOKPageUpDownOffset = nTwips;
583 }
584
585 // hand over Shell
587 SwDocShell *GetDocShell();
588 inline const SwDocShell *GetDocShell() const;
589 virtual FmFormShell *GetFormShell() override { return m_pFormShell; }
590 virtual const FmFormShell *GetFormShell() const override { return m_pFormShell; }
591
592 // so that in the SubShells' DTors m_pShell can be reset if applicable
593 void ResetSubShell() { m_pShell = nullptr; }
594
595 virtual void WriteUserData(OUString &, bool bBrowse = false) override;
596 virtual void ReadUserData(const OUString &, bool bBrowse = false) override;
597 virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ) override;
598 virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ) override;
599
600 void SetCursorAtTop( bool bFlag, bool bCenter = false )
601 { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
602
603 bool JumpToSwMark( std::u16string_view rMark );
604
605 tools::Long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
606 const OUString& rFilterName, sal_Int16 nVersion = 0 );
607
608 void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
609 tools::Long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
610 DECL_DLLPRIVATE_LINK( DialogClosedHdl, sfx2::FileDialogHelper *, void );
611
612 // status methods for clipboard.
613 // Status changes now notified from the clipboard.
614 bool IsPasteAllowed();
615 bool IsPasteSpecialAllowed();
616 bool IsPasteSpreadsheet(bool bHasOwnTableCopied);
617
618 // Enable mail merge - mail merge field dialog enabled
619 void EnableMailMerge();
620 //apply Accessibility options
621 void ApplyAccessibilityOptions();
622
624 virtual ~SwView() override;
625
626 void NotifyDBChanged();
627
628 SfxObjectShellLock CreateTmpSelectionDoc();
629
630 void AddTransferable(SwTransferable& rTransferable);
631
632 // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
633 // or to support printing
634 void SetMailMergeConfigItem(std::shared_ptr<SwMailMergeConfigItem> const & rConfigItem);
635 std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const;
636 std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr);
637
638 OUString GetDataSourceName() const;
639 static bool IsDataSourceAvailable(const OUString sDataSourceName);
640
641 void ExecFormatPaintbrush(SfxRequest const &);
642 void StateFormatPaintbrush(SfxItemSet &);
643
644 // public for D&D
645 ErrCode InsertGraphic( const OUString &rPath, const OUString &rFilter,
646 bool bLink, GraphicFilter *pFlt );
647
648 void ExecuteScan( SfxRequest& rReq );
649
650 SwPostItMgr* GetPostItMgr() { return m_pPostItMgr.get();}
651 const SwPostItMgr* GetPostItMgr() const { return m_pPostItMgr.get();}
652
653 // exhibition hack (MA,MBA)
654 void SelectShellForDrop();
655
656 void UpdateDocStats();
657
658 void SetMaxOutlineLevelShown(int nLevel) {m_nMaxOutlineLevelShown = nLevel;}
659 int GetMaxOutlineLevelShown() const {return m_nMaxOutlineLevelShown;}
660
661 // methods for printing
662 SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) override;
663 SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const override;
664 SAL_DLLPRIVATE virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
665 const SfxItemSet& rSet) override;
666 static SvxSearchItem* GetSearchItem() { return s_pSrchItem; }
668 int getPart() const override;
670 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
671 void SetRedlineAuthor(const OUString& rAuthor);
672 const OUString& GetRedlineAuthor() const;
674 void afterCallbackRegistered() override;
676 void NotifyCursor(SfxViewShell* pViewShell) const override;
678 ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const override;
680 OUString GetColorConfigName() const override;
681 void ShowUIElement(const OUString& sElementURL) const;
682
683
685 {
690 CachedStrings
691 };
692
693 OUString m_StringCache[CachedStrings];
694
695 const OUString& GetCachedString(CachedStringID id)
696 {
697 return m_StringCache[id];
698 }
699
700 void SetCachedString(CachedStringID id, const OUString& sStr)
701 {
702 m_StringCache[id] = sStr;
703 }
704
705 const OUString& GetOldGrfCat();
706 void SetOldGrfCat(const OUString& sStr);
707 const OUString& GetOldTabCat();
708 void SetOldTabCat(const OUString& sStr);
709 const OUString& GetOldFrameCat();
710 void SetOldFrameCat(const OUString& sStr);
711 const OUString& GetOldDrwCat();
712 void SetOldDrwCat(const OUString& sStr);
713
714 virtual tools::Rectangle getLOKVisibleArea() const override;
715 virtual void flushPendingLOKInvalidateTiles() override;
716 virtual std::optional<OString> getLOKPayload(int nType, int nViewId) const override;
717
718 bool IsHighlightCharDF() { return m_bIsHighlightCharDF; }
719};
720
722{
723 return (m_aVisArea.GetWidth() * nScrollX) / 100;
724}
725
727{
728 return (m_aVisArea.GetHeight() * nScrollY) / 100;
729}
730
731inline const SwDocShell *SwView::GetDocShell() const
732{
733 return const_cast<SwView*>(this)->GetDocShell();
734}
735
736std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
737 const SfxItemSet &rOptions,
738 bool bPreview);
739
740extern bool bDocSzUpdated;
741
742#endif
743
744/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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 OUString GetColorConfigName() const
virtual void Deactivate(bool IsMDIActivate) override
virtual void afterCallbackRegistered()
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 ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) 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:72
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
SwView & m_rView
Definition: view.hxx:138
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
Definition: view.cxx:1104
Definition: view.hxx:146
SvxRuler & GetVRuler()
Definition: view.hxx:506
std::unique_ptr< SwDrawBase > m_pDrawActual
Definition: view.hxx:212
CachedStringID
Definition: view.hxx:685
@ OldTabCat
Definition: view.hxx:687
@ OldFrameCat
Definition: view.hxx:688
@ OldDrwCat
Definition: view.hxx:689
@ OldGrfCat
Definition: view.hxx:686
SvxSearchCmd m_eLastSearchCommand
Definition: view.hxx:235
OUString m_sDrawCustom
Definition: view.hxx:226
SfxShell * GetCurShell()
Definition: view.hxx:586
void SetTabColFromDocPos(const Point &rPt)
Definition: view.hxx:453
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:501
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:423
sal_uInt16 m_nFormSfxId
Definition: view.hxx:227
DECL_LINK(AttrChangedNotify, LinkParamNone *, void)
void SetNumRuleNodeFromDoc(SwTextNode *pNumRuleNode)
Definition: view.hxx:459
void SetCachedString(CachedStringID id, const OUString &sStr)
Definition: view.hxx:700
SfxShell * m_pShell
Definition: view.hxx:197
bool IsTabColFromDoc() const
Definition: view.hxx:455
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:590
SelectionType GetSelectionType() const
Definition: view.hxx:362
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:589
int GetMaxOutlineLevelShown() const
Definition: view.hxx:659
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:580
bool m_bVScrollbarEnabled
Definition: view.hxx:206
VclPtr< SvxRuler > m_pHRuler
Definition: view.hxx:208
void SetMaxOutlineLevelShown(int nLevel)
Definition: view.hxx:658
sal_uInt16 m_nLeftBorderDistance
Definition: view.hxx:232
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:209
void SetFormShell(FmFormShell *pSh)
Definition: view.hxx:367
bool IsDrawSelMode() const
Definition: view.hxx:542
const SwPostItMgr * GetPostItMgr() const
Definition: view.hxx:651
tools::Long GetXScroll() const
Definition: view.hxx:721
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:436
const SwFrameFormat * GetLastTableFrameFormat() const
Definition: view.hxx:376
static std::unique_ptr< SearchAttrItemList > s_xReplaceList
Definition: view.hxx:175
void SetSelectionType(SelectionType nSet)
Definition: view.hxx:363
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:463
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:650
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:544
static sal_Int32 s_nActMark
Definition: view.hxx:168
bool IsTabRowFromDoc() const
Definition: view.hxx:457
void SetLastTableFrameFormat(const SwFrameFormat *pSet)
Definition: view.hxx:377
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:366
static bool s_bExtra
Definition: view.hxx:170
SAL_DLLPRIVATE void SpellContext(bool bOn=true)
Definition: view.hxx:332
DECL_DLLPRIVATE_LINK(MoveNavigationHdl, void *, void)
bool IsHighlightCharDF()
Definition: view.hxx:718
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:541
bool m_bDrawSelMode
Definition: view.hxx:251
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:424
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:537
DECL_DLLPRIVATE_LINK(FormControlActivated, LinkParamNone *, void)
void ResetSubShell()
Definition: view.hxx:593
SwEditWin & GetEditWin()
Definition: view.hxx:426
DECL_DLLPRIVATE_LINK(WindowChildEventListener, VclWindowEvent &, void)
const OUString & GetCachedString(CachedStringID id)
Definition: view.hxx:695
SwTextNode * m_pNumRuleNodeFromDoc
Definition: view.hxx:188
void SetCursorAtTop(bool bFlag, bool bCenter=false)
Definition: view.hxx:600
static bool s_bFound
Definition: view.hxx:171
const SwEditWin & GetEditWin() const
Definition: view.hxx:427
sal_uInt16 m_nOldPageNum
Definition: view.hxx:184
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
Definition: view.hxx:195
SwDocShell * GetDocShell()
Definition: view.cxx:1193
SwView_Impl * GetViewImpl()
Definition: view.hxx:358
SvxRuler & GetHRuler()
Definition: view.hxx:505
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:456
tools::Long GetYScroll() const
Definition: view.hxx:726
DECL_DLLPRIVATE_LINK(ExecRulerClick, Ruler *, void)
bool IsDrawMode() const
Definition: view.hxx:550
sal_uInt16 m_nDrawSfxId
Definition: view.hxx:225
bool m_bIsPreviewDoubleClick
Definition: view.hxx:260
void LeaveDrawCreate()
Definition: view.hxx:549
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:540
void SetTabColFromDoc(bool b)
Definition: view.hxx:454
bool m_bTabRowFromDoc
Definition: view.hxx:244
static SvxSearchItem * GetSearchItem()
Definition: view.hxx:666
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
struct _xmlTextWriter * xmlTextWriterPtr
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
union SwApplyTemplate::@29 aColl
SwFrameFormat * pFrameFormat
Definition: view.hxx:112
SfxStyleFamily eType
Definition: view.hxx:117
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:335
const tools::Long nScrollX
Definition: view.hxx:78
bool bDocSzUpdated
Definition: view.cxx:125
const tools::Long nLeftOfst
Definition: view.hxx:77
const tools::Long nScrollY
Definition: view.hxx:79
SfxPrinterChangeFlags
SelectionType
Definition: wrtsh.hxx:65
SvxZoomType