19#ifndef INCLUDED_SW_INC_VIEW_HXX
20#define INCLUDED_SW_INC_VIEW_HXX
73namespace sfx2 {
class FileDialogHelper; }
74namespace sw::mark {
class IFieldmark; }
128 aColl.pTextColl =
nullptr;
238 double m_fLastZoomScale = 0;
239 double m_fAccumulatedZoom = 0;
263 bool m_bInitOnceCompleted =
false;
271 int m_nMaxOutlineLevelShown = 10;
273 bool m_bIsHighlightCharDF =
false;
275 static constexpr sal_uInt16 MAX_ZOOM_PERCENT = 600;
276 static constexpr sal_uInt16 MIN_ZOOM_PERCENT = 20;
280 SAL_DLLPRIVATE
bool SearchAndWrap(
bool bApi);
281 SAL_DLLPRIVATE sal_uInt16 SearchAll();
285 bool IsDocumentBorder();
287 SAL_DLLPRIVATE
bool IsTextTool()
const;
293 SAL_DLLPRIVATE
Point AlignToPixel(
const Point& rPt)
const;
298 SAL_DLLPRIVATE
bool GetPageScrollUpOffset(
SwTwips& rOff)
const;
299 SAL_DLLPRIVATE
bool GetPageScrollDownOffset(
SwTwips& rOff)
const;
302 SAL_DLLPRIVATE
bool PageUp();
304 SAL_DLLPRIVATE
bool PageUpCursor(
bool bSelect);
305 SAL_DLLPRIVATE
bool PageDownCursor(
bool bSelect);
306 SAL_DLLPRIVATE
void PhyPageUp();
307 SAL_DLLPRIVATE
void PhyPageDown();
309 SAL_DLLPRIVATE
void CreateScrollbar(
bool bHori );
312 SAL_DLLPRIVATE
void EndScrollHdl(
weld::Scrollbar& rScrollbar,
bool bHorizontal);
313 SAL_DLLPRIVATE
bool UpdateScrollbars();
315 SAL_DLLPRIVATE
void CalcVisArea(
const Size &rPixelSz );
318 SAL_DLLPRIVATE
void HyphenateDocument();
319 SAL_DLLPRIVATE
bool IsDrawTextHyphenate();
320 SAL_DLLPRIVATE
void HyphenateDrawText();
321 SAL_DLLPRIVATE
void StartThesaurus();
324 SAL_DLLPRIVATE
void StartTextConversion(
LanguageType nSourceLang,
LanguageType nTargetLang,
const vcl::Font *pTargetFont, sal_Int32 nOptions,
bool bIsInteractive );
327 SAL_DLLPRIVATE
void SpellStart(
SvxSpellArea eSpell,
bool bStartDone,
333 { m_bCenterCursor = bOn; }
337 SAL_DLLPRIVATE
void CheckReadonlyState();
338 SAL_DLLPRIVATE
void CheckReadonlySelection();
343 SAL_DLLPRIVATE
void SetZoom_(
const Size &rEditSz,
347 SAL_DLLPRIVATE
void CalcAndSetBorderPixel(
SvBorder &rToFill );
349 SAL_DLLPRIVATE
void ShowAtResize();
351 SAL_DLLPRIVATE
virtual void Move()
override;
354 SAL_DLLPRIVATE
bool InsertGraphicDlg(
SfxRequest& );
369 virtual void SelectShell();
371 virtual void Activate(
bool)
override;
380 void GenerateFormLetter(
bool bUseCurrentDocument);
395 void GotFocus()
const;
398 virtual void ShowCursor(
bool bOn =
true )
override;
405 css::view::XSelectionSupplier* GetUNOObject();
407 OUString GetSelectionTextParam(
bool bCompleteWords,
409 virtual bool HasSelection(
bool bText =
true )
const override;
410 virtual OUString
GetSelectionText(
bool bCompleteWords =
false,
bool bOnlyASample =
false )
override;
416 void InsertThesaurusSynonym(
const OUString &rSynonmText,
const OUString &rLookUpText,
bool bValidSelection );
417 bool IsValidSelectionForThesaurus()
const;
418 OUString GetThesaurusLookUpText(
bool bSelection )
const;
421 void StopShellTimer();
429#if defined(_WIN32) || defined UNX
430 void ScannerEventHdl();
440 sal_uInt16 nRangeX = USHRT_MAX,
441 sal_uInt16 nRangeY = USHRT_MAX);
447 bool ExecSpellPopup(
const Point& rPt );
448 void ExecSmartTagPopup(
const Point& rPt );
451 bool ExecDrwTextSpellPopup(
const Point& rPt);
460 { m_pNumRuleNodeFromDoc = pNumRuleNode; }
462 void DocSzChgd(
const Size& rNewSize );
465 void SetVisArea(
const Point&,
bool bUpdateScrollbar =
true);
468 void RecheckBrowseMode();
471 static sal_uInt16 GetMoveType();
472 static void SetMoveType(sal_uInt16 nSet);
474 static void SetActMark(sal_Int32 nSet);
480 void InsFrameMode(sal_uInt16 nCols);
485 void SetViewLayout( sal_uInt16 nColumns,
bool bBookMode,
bool bViewOnly =
false );
487 void ShowHScrollbar(
bool bShow);
488 bool IsHScrollbarVisible()
const;
490 void ShowVScrollbar(
bool bShow);
491 bool IsVScrollbarVisible()
const;
493 void EnableHScrollbar(
bool bEnable);
494 void EnableVScrollbar(
bool bEnable);
502 void ChangeVRulerMetric(
FieldUnit eUnit);
503 void GetVRulerMetric(
FieldUnit& rToFill)
const;
507 void InvalidateRulerPos();
509 void GetHRulerMetric(
FieldUnit& rToFill)
const;
531 void UpdateWordCount(
SfxShell*, sal_uInt16);
532 void ExecFormatFootnote();
536 void SetDrawFuncPtr(std::unique_ptr<SwDrawBase> pFuncPtr);
543 void SetSelDrawSlot();
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;
556 vcl::Window* pWin=
nullptr,
bool bIsNewObj=
false,
bool bSetSelectionToStart=
false );
557 bool isSignatureLineSelected()
const;
558 bool isSignatureLineSigned()
const;
559 bool isQRCodeSelected()
const;
571 void AutoCaption(
const sal_uInt16 nType,
const SvGlobalName *pOleId =
nullptr);
575 void UpdatePageNums();
577 OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum,
const OUString& rPgStr);
582 m_nLOKPageUpDownOffset = nTwips;
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;
601 { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
605 tools::Long InsertDoc( sal_uInt16 nSlotId,
const OUString& rFileName,
606 const OUString& rFilterName, sal_Int16 nVersion = 0 );
609 tools::Long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
614 bool IsPasteAllowed();
615 bool IsPasteSpecialAllowed();
616 bool IsPasteSpreadsheet(
bool bHasOwnTableCopied);
619 void EnableMailMerge();
621 void ApplyAccessibilityOptions();
626 void NotifyDBChanged();
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);
638 OUString GetDataSourceName()
const;
639 static bool IsDataSourceAvailable(
const OUString sDataSourceName);
641 void ExecFormatPaintbrush(
SfxRequest const &);
654 void SelectShellForDrop();
656 void UpdateDocStats();
671 void SetRedlineAuthor(
const OUString& rAuthor);
672 const OUString& GetRedlineAuthor()
const;
681 void ShowUIElement(
const OUString& sElementURL)
const;
693 OUString m_StringCache[CachedStrings];
697 return m_StringCache[id];
702 m_StringCache[id] = sStr;
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);
716 virtual std::optional<OString>
getLOKPayload(
int nType,
int nViewId)
const override;
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 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
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Represents the style of a paragraph.
SwTextNode is a paragraph in the document model.
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
std::unique_ptr< SwDrawBase > m_pDrawActual
SvxSearchCmd m_eLastSearchCommand
void SetTabColFromDocPos(const Point &rPt)
VclPtr< SwScrollbar > m_pHScrollbar
DECL_DLLPRIVATE_LINK(TimeoutHdl, Timer *, void)
FmFormShell * m_pFormShell
bool m_bWheelScrollInProgress
SotExchangeDest m_nLastPasteDestination
sal_uInt16 m_nRightBorderDistance
static SvxSearchItem * s_pSrchItem
SwWrtShell & GetWrtShell() const
DECL_LINK(AttrChangedNotify, LinkParamNone *, void)
void SetNumRuleNodeFromDoc(SwTextNode *pNumRuleNode)
void SetCachedString(CachedStringID id, const OUString &sStr)
bool IsTabColFromDoc() const
std::unique_ptr< SwGlossaryHdl > m_pGlosHdl
static sal_uInt16 s_nMoveType
std::unique_ptr< SwView_Impl > m_pViewImpl
std::unique_ptr< SwWrtShell > m_pWrtShell
DECL_DLLPRIVATE_LINK(DialogClosedHdl, sfx2::FileDialogHelper *, void)
virtual const FmFormShell * GetFormShell() const override
SelectionType GetSelectionType() const
std::unique_ptr< SwPostItMgr > m_pPostItMgr
VclPtr< SwScrollbar > m_pVScrollbar
tools::Rectangle m_aVisArea
virtual FmFormShell * GetFormShell() override
int GetMaxOutlineLevelShown() const
bool m_bInOuterResizePixel
void ForcePageUpDownOffset(SwTwips nTwips)
Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea.
bool m_bVScrollbarEnabled
VclPtr< SvxRuler > m_pHRuler
void SetMaxOutlineLevelShown(int nLevel)
sal_uInt16 m_nLeftBorderDistance
VclPtr< SvxRuler > m_pVRuler
void SetFormShell(FmFormShell *pSh)
bool IsDrawSelMode() const
const SwPostItMgr * GetPostItMgr() const
tools::Long GetXScroll() const
VclPtr< SwEditWin > m_pEditWin
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
const tools::Rectangle & GetVisArea() const
const SwFrameFormat * GetLastTableFrameFormat() const
static std::unique_ptr< SearchAttrItemList > s_xReplaceList
void SetSelectionType(SelectionType nSet)
bool m_bInInnerResizePixel
DECL_DLLPRIVATE_LINK(OnlineSpellCallback, SpellCallbackInfo &, void)
const Size & GetDocSz() const
OUString m_sOldSectionName
bool m_bOldShellWasPagePreview
DECL_DLLPRIVATE_LINK(HoriScrollHdl, weld::Scrollbar &, void)
SFX_DECL_VIEWFACTORY(SwView)
static std::unique_ptr< SearchAttrItemList > s_xSearchList
SwPostItMgr * GetPostItMgr()
bool m_bPasteSpecialState
SelectCycle m_aSelectCycle
static sal_Int32 s_nActMark
bool IsTabRowFromDoc() const
void SetLastTableFrameFormat(const SwFrameFormat *pSet)
SelectionType m_nSelectionType
DECL_DLLPRIVATE_LINK(VertScrollHdl, weld::Scrollbar &, void)
void SetShell(SfxShell *pS)
SAL_DLLPRIVATE void SpellContext(bool bOn=true)
DECL_DLLPRIVATE_LINK(MoveNavigationHdl, void *, void)
bool m_bMakeSelectionVisible
SwTwips m_nLOKPageUpDownOffset
LibreOfficeKit has to force the page size for PgUp/PgDown functionality based on the user's view,...
SwWrtShell * GetWrtShellPtr() const
SwDrawBase * GetDrawFuncPtr() const
DECL_DLLPRIVATE_LINK(FormControlActivated, LinkParamNone *, void)
DECL_DLLPRIVATE_LINK(WindowChildEventListener, VclWindowEvent &, void)
const OUString & GetCachedString(CachedStringID id)
SwTextNode * m_pNumRuleNodeFromDoc
void SetCursorAtTop(bool bFlag, bool bCenter=false)
const SwEditWin & GetEditWin() const
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
SwDocShell * GetDocShell()
SwView_Impl * GetViewImpl()
bool m_bAttrChgNotifiedWithRegistrations
SdrObjKind m_eFormObjKind
Point m_aTabColFromDocPos
void SetTabRowFromDoc(bool b)
tools::Long GetYScroll() const
DECL_DLLPRIVATE_LINK(ExecRulerClick, Ruler *, void)
bool m_bIsPreviewDoubleClick
bool m_bForceChangesToolbar
const SwFrameFormat * m_pLastTableFormat
bool m_bHScrollbarEnabled
const SwFrameFormat * m_pLastFlyFormat
bool IsDrawRotate() const
void SetTabColFromDoc(bool b)
static SvxSearchItem * GetSearchItem()
static bool s_bJustOpened
Used by the UI to modify the document model.
struct _xmlTextWriter * xmlTextWriterPtr
bool JumpToSwMark(SwViewShell const *pVwSh, std::u16string_view rMark)
#define SFX_DECL_INTERFACE(nId)
SwCharFormat * pCharFormat
SwTextFormatColl * pTextColl
union SwApplyTemplate::@29 aColl
SwFrameFormat * pFrameFormat
SwFormatClipboard * m_pFormatClipboard
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
const tools::Long nScrollX
const tools::Long nLeftOfst
const tools::Long nScrollY