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 static constexpr sal_uInt16 MAX_ZOOM_PERCENT = 600;
274 static constexpr sal_uInt16 MIN_ZOOM_PERCENT = 20;
278 SAL_DLLPRIVATE
bool SearchAndWrap(
bool bApi);
279 SAL_DLLPRIVATE sal_uInt16 SearchAll();
283 bool IsDocumentBorder();
285 SAL_DLLPRIVATE
bool IsTextTool()
const;
291 SAL_DLLPRIVATE
Point AlignToPixel(
const Point& rPt)
const;
296 SAL_DLLPRIVATE
bool GetPageScrollUpOffset(
SwTwips& rOff)
const;
297 SAL_DLLPRIVATE
bool GetPageScrollDownOffset(
SwTwips& rOff)
const;
300 SAL_DLLPRIVATE
bool PageUp();
302 SAL_DLLPRIVATE
bool PageUpCursor(
bool bSelect);
303 SAL_DLLPRIVATE
bool PageDownCursor(
bool bSelect);
304 SAL_DLLPRIVATE
void PhyPageUp();
305 SAL_DLLPRIVATE
void PhyPageDown();
307 SAL_DLLPRIVATE
void CreateScrollbar(
bool bHori );
310 SAL_DLLPRIVATE
void EndScrollHdl(
weld::Scrollbar& rScrollbar,
bool bHorizontal);
311 SAL_DLLPRIVATE
bool UpdateScrollbars();
313 SAL_DLLPRIVATE
void CalcVisArea(
const Size &rPixelSz );
316 SAL_DLLPRIVATE
void HyphenateDocument();
317 SAL_DLLPRIVATE
bool IsDrawTextHyphenate();
318 SAL_DLLPRIVATE
void HyphenateDrawText();
319 SAL_DLLPRIVATE
void StartThesaurus();
322 SAL_DLLPRIVATE
void StartTextConversion(
LanguageType nSourceLang,
LanguageType nTargetLang,
const vcl::Font *pTargetFont, sal_Int32 nOptions,
bool bIsInteractive );
325 SAL_DLLPRIVATE
void SpellStart(
SvxSpellArea eSpell,
bool bStartDone,
331 { m_bCenterCursor = bOn; }
335 SAL_DLLPRIVATE
void CheckReadonlyState();
336 SAL_DLLPRIVATE
void CheckReadonlySelection();
341 SAL_DLLPRIVATE
void SetZoom_(
const Size &rEditSz,
345 SAL_DLLPRIVATE
void CalcAndSetBorderPixel(
SvBorder &rToFill );
347 SAL_DLLPRIVATE
void ShowAtResize();
349 SAL_DLLPRIVATE
virtual void Move()
override;
352 SAL_DLLPRIVATE
bool InsertGraphicDlg(
SfxRequest& );
367 virtual void SelectShell();
369 virtual void Activate(
bool)
override;
371 virtual void InnerResizePixel(
const Point &rOfs,
const Size &rSize,
bool inplaceEditModeChange )
override;
378 void GenerateFormLetter(
bool bUseCurrentDocument);
393 void GotFocus()
const;
396 virtual void ShowCursor(
bool bOn =
true )
override;
403 css::view::XSelectionSupplier* GetUNOObject();
405 OUString GetSelectionTextParam(
bool bCompleteWords,
407 virtual bool HasSelection(
bool bText =
true )
const override;
408 virtual OUString
GetSelectionText(
bool bCompleteWords =
false,
bool bOnlyASample =
false )
override;
414 void InsertThesaurusSynonym(
const OUString &rSynonmText,
const OUString &rLookUpText,
bool bValidSelection );
415 bool IsValidSelectionForThesaurus()
const;
416 OUString GetThesaurusLookUpText(
bool bSelection )
const;
419 void StopShellTimer();
427#if defined(_WIN32) || defined UNX
428 void ScannerEventHdl();
438 sal_uInt16 nRangeX = USHRT_MAX,
439 sal_uInt16 nRangeY = USHRT_MAX);
445 bool ExecSpellPopup(
const Point& rPt );
446 void ExecSmartTagPopup(
const Point& rPt );
449 bool ExecDrwTextSpellPopup(
const Point& rPt);
458 { m_pNumRuleNodeFromDoc = pNumRuleNode; }
460 void DocSzChgd(
const Size& rNewSize );
463 void SetVisArea(
const Point&,
bool bUpdateScrollbar =
true);
466 void RecheckBrowseMode();
469 static sal_uInt16 GetMoveType();
470 static void SetMoveType(sal_uInt16 nSet);
472 static void SetActMark(sal_Int32 nSet);
478 void InsFrameMode(sal_uInt16 nCols);
480 void SetZoom(
SvxZoomType eZoomType,
short nFactor = 100,
bool bViewOnly =
false);
483 void SetViewLayout( sal_uInt16 nColumns,
bool bBookMode,
bool bViewOnly =
false );
485 void ShowHScrollbar(
bool bShow);
486 bool IsHScrollbarVisible()
const;
488 void ShowVScrollbar(
bool bShow);
489 bool IsVScrollbarVisible()
const;
491 void EnableHScrollbar(
bool bEnable);
492 void EnableVScrollbar(
bool bEnable);
500 void ChangeVRulerMetric(
FieldUnit eUnit);
501 void GetVRulerMetric(
FieldUnit& rToFill)
const;
505 void InvalidateRulerPos();
507 void GetHRulerMetric(
FieldUnit& rToFill)
const;
529 void UpdateWordCount(
SfxShell*, sal_uInt16);
530 void ExecFormatFootnote();
534 void SetDrawFuncPtr(std::unique_ptr<SwDrawBase> pFuncPtr);
541 void SetSelDrawSlot();
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;
554 vcl::Window* pWin=
nullptr,
bool bIsNewObj=
false,
bool bSetSelectionToStart=
false );
555 bool isSignatureLineSelected()
const;
556 bool isSignatureLineSigned()
const;
557 bool isQRCodeSelected()
const;
569 void AutoCaption(
const sal_uInt16 nType,
const SvGlobalName *pOleId =
nullptr);
573 void UpdatePageNums();
575 OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum,
const OUString& rPgStr);
580 m_nLOKPageUpDownOffset = nTwips;
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;
599 { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
603 tools::Long InsertDoc( sal_uInt16 nSlotId,
const OUString& rFileName,
604 const OUString& rFilterName, sal_Int16 nVersion = 0 );
607 tools::Long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
612 bool IsPasteAllowed();
613 bool IsPasteSpecialAllowed();
614 bool IsPasteSpreadsheet(
bool bHasOwnTableCopied);
617 void EnableMailMerge();
624 void NotifyDBChanged();
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);
636 OUString GetDataSourceName()
const;
637 static bool IsDataSourceAvailable(
const OUString sDataSourceName);
639 void ExecFormatPaintbrush(
SfxRequest const &);
643 ErrCode InsertGraphic(
const OUString &rPath,
const OUString &rFilter,
652 void SelectShellForDrop();
654 void UpdateDocStats();
669 void SetRedlineAuthor(
const OUString& rAuthor);
670 const OUString& GetRedlineAuthor()
const;
673 void ShowUIElement(
const OUString& sElementURL)
const;
685 OUString m_StringCache[CachedStrings];
689 return m_StringCache[id];
694 m_StringCache[id] = sStr;
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);
708 virtual std::optional<OString>
getLOKPayload(
int nType,
int nViewId)
const override;
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 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
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.
bool JumpToSwMark(SwViewShell const *pVwSh, std::u16string_view rMark)
#define SFX_DECL_INTERFACE(nId)
SwCharFormat * pCharFormat
SwTextFormatColl * pTextColl
SwFrameFormat * pFrameFormat
union SwApplyTemplate::@32 aColl
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