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