19 #ifndef INCLUDED_SW_INC_VIEW_HXX
20 #define INCLUDED_SW_INC_VIEW_HXX
73 namespace sfx2 {
class FileDialogHelper; }
74 namespace sw::mark {
class IFieldmark; }
124 m_pFormatClipboard(nullptr),
127 aColl.pTextColl =
nullptr;
240 bool m_bCenterCursor : 1,
242 m_bTabColFromDoc : 1,
243 m_bTabRowFromDoc : 1,
244 m_bSetTabColFromDoc : 1 ,
245 m_bSetTabRowFromDoc : 1,
246 m_bAttrChgNotified : 1,
247 m_bAttrChgNotifiedWithRegistrations : 1,
252 m_bInOuterResizePixel : 1,
253 m_bInInnerResizePixel : 1,
255 m_bPasteSpecialState : 1,
258 m_bOldShellWasPagePreview : 1,
259 m_bIsPreviewDoubleClick : 1,
260 m_bMakeSelectionVisible : 1,
261 m_bForceChangesToolbar : 1;
262 bool m_bInitOnceCompleted =
false;
271 SAL_DLLPRIVATE
bool SearchAndWrap(
bool bApi);
272 SAL_DLLPRIVATE
bool SearchAll();
276 bool IsDocumentBorder();
278 SAL_DLLPRIVATE
bool IsTextTool()
const;
284 SAL_DLLPRIVATE
Point AlignToPixel(
const Point& rPt)
const;
289 SAL_DLLPRIVATE
bool GetPageScrollUpOffset(
SwTwips& rOff)
const;
290 SAL_DLLPRIVATE
bool GetPageScrollDownOffset(
SwTwips& rOff)
const;
293 SAL_DLLPRIVATE
bool PageUp();
295 SAL_DLLPRIVATE
bool PageUpCursor(
bool bSelect);
296 SAL_DLLPRIVATE
bool PageDownCursor(
bool bSelect);
297 SAL_DLLPRIVATE
void PhyPageUp();
298 SAL_DLLPRIVATE
void PhyPageDown();
300 SAL_DLLPRIVATE
void CreateScrollbar(
bool bHori );
303 SAL_DLLPRIVATE
bool UpdateScrollbars();
305 SAL_DLLPRIVATE
void CalcVisArea(
const Size &rPixelSz );
308 SAL_DLLPRIVATE
void HyphenateDocument();
309 SAL_DLLPRIVATE
bool IsDrawTextHyphenate();
310 SAL_DLLPRIVATE
void HyphenateDrawText();
311 SAL_DLLPRIVATE
void StartThesaurus();
314 SAL_DLLPRIVATE
void StartTextConversion(
LanguageType nSourceLang,
LanguageType nTargetLang,
const vcl::Font *pTargetFont, sal_Int32 nOptions,
bool bIsInteractive );
317 SAL_DLLPRIVATE
void SpellStart(
SvxSpellArea eSpell,
bool bStartDone,
323 { m_bCenterCursor = bOn; }
327 SAL_DLLPRIVATE
void CheckReadonlyState();
328 SAL_DLLPRIVATE
void CheckReadonlySelection();
333 SAL_DLLPRIVATE
void SetZoom_(
const Size &rEditSz,
337 SAL_DLLPRIVATE
void CalcAndSetBorderPixel(
SvBorder &rToFill );
339 SAL_DLLPRIVATE
void ShowAtResize();
341 SAL_DLLPRIVATE
virtual void Move()
override;
344 SAL_DLLPRIVATE
bool InsertGraphicDlg(
SfxRequest& );
359 virtual void SelectShell();
361 virtual void Activate(
bool)
override;
363 virtual void InnerResizePixel(
const Point &rOfs,
const Size &rSize,
bool inplaceEditModeChange )
override;
370 void GenerateFormLetter(
bool bUseCurrentDocument);
380 static
void InitInterface_Impl();
385 void GotFocus() const;
386 virtual
SdrView* GetDrawView() const override;
388 virtual
void ShowCursor(
bool bOn = true ) override;
389 virtual
ErrCode DoVerb(sal_Int32 nVerb) override;
395 css::view::XSelectionSupplier* GetUNOObject();
397 OUString GetSelectionTextParam(
bool bCompleteWords,
399 virtual
bool HasSelection(
bool bText = true ) const override;
400 virtual OUString GetSelectionText(
bool bCompleteWords = false ) override;
401 virtual
bool PrepareClose(
bool bUI = true ) override;
402 virtual
void MarginChanged() override;
406 void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText,
bool bValidSelection );
407 bool IsValidSelectionForThesaurus() const;
408 OUString GetThesaurusLookUpText(
bool bSelection ) const;
411 void StopShellTimer();
419 #if defined(_WIN32) || defined UNX
420 void ScannerEventHdl();
430 sal_uInt16 nRangeX = USHRT_MAX,
431 sal_uInt16 nRangeY = USHRT_MAX);
437 bool ExecSpellPopup(
const Point& rPt );
438 void ExecSmartTagPopup(
const Point& rPt );
441 bool ExecDrwTextSpellPopup(
const Point& rPt);
450 { m_pNumRuleNodeFromDoc = pNumRuleNode; }
452 void DocSzChgd(
const Size& rNewSize );
455 void SetVisArea(
const Point&,
bool bUpdateScrollbar =
true);
458 void RecheckBrowseMode();
461 static sal_uInt16 GetMoveType();
462 static void SetMoveType(sal_uInt16 nSet);
464 static void SetActMark(sal_Int32 nSet);
469 void InsFrameMode(sal_uInt16 nCols);
471 void SetZoom(
SvxZoomType eZoomType,
short nFactor = 100,
bool bViewOnly =
false);
474 void SetViewLayout( sal_uInt16 nColumns,
bool bBookMode,
bool bViewOnly =
false );
476 void ShowHScrollbar(
bool bShow);
477 bool IsHScrollbarVisible()
const;
479 void ShowVScrollbar(
bool bShow);
480 bool IsVScrollbarVisible()
const;
482 void EnableHScrollbar(
bool bEnable);
483 void EnableVScrollbar(
bool bEnable);
491 void ChangeVRulerMetric(
FieldUnit eUnit);
492 void GetVRulerMetric(
FieldUnit& rToFill)
const;
496 void InvalidateRulerPos();
498 void GetHRulerMetric(
FieldUnit& rToFill)
const;
520 void UpdateWordCount(
SfxShell*, sal_uInt16);
521 void ExecFormatFootnote();
525 void SetDrawFuncPtr(std::unique_ptr<SwDrawBase> pFuncPtr);
532 void SetSelDrawSlot();
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;
545 vcl::Window* pWin=
nullptr,
bool bIsNewObj=
false,
bool bSetSelectionToStart=
false );
546 bool isSignatureLineSelected()
const;
547 bool isSignatureLineSigned()
const;
548 bool isQRCodeSelected()
const;
560 void AutoCaption(
const sal_uInt16 nType,
const SvGlobalName *pOleId =
nullptr);
564 void UpdatePageNums();
566 OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum,
const OUString& rPgStr);
571 m_nLOKPageUpDownOffset = nTwips;
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;
590 { m_bTopCursor = bFlag; m_bCenterCursor = bCenter; }
594 tools::Long InsertDoc( sal_uInt16 nSlotId,
const OUString& rFileName,
595 const OUString& rFilterName, sal_Int16 nVersion = 0 );
598 tools::Long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
603 bool IsPasteAllowed();
604 bool IsPasteSpecialAllowed();
605 bool IsPasteSpreadsheet(
bool bHasOwnTableCopied);
608 void EnableMailMerge();
613 virtual ~
SwView()
override;
615 void NotifyDBChanged();
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);
627 OUString GetDataSourceName()
const;
628 static bool IsDataSourceAvailable(
const OUString sDataSourceName);
630 void ExecFormatPaintbrush(
SfxRequest const &);
634 ErrCode InsertGraphic(
const OUString &rPath,
const OUString &rFilter,
643 void SelectShellForDrop();
645 void UpdateDocStats();
657 void SetRedlineAuthor(
const OUString& rAuthor);
658 const OUString& GetRedlineAuthor()
const;
661 void ShowUIElement(
const OUString& sElementURL)
const;
673 OUString m_StringCache[CachedStrings];
677 return m_StringCache[id];
682 m_StringCache[id] = sStr;
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);
696 virtual OString
getLOKPayload(
int nType,
int nViewId,
bool* ignore)
const override;
sal_uInt16 m_nRightBorderDistance
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
tools::Long GetYScroll() const
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
SdrObjKind m_eFormObjKind
bool IsTabRowFromDoc() const
Represents the style of a paragraph.
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
static sal_Int32 s_nActMark
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual const FmFormShell * GetFormShell() const override
virtual std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions)
void ForcePageUpDownOffset(SwTwips nTwips)
Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea. ...
std::unique_ptr< SwPostItMgr > m_pPostItMgr
std::unique_ptr< SwWrtShell > m_pWrtShell
void SetSelectionType(SelectionType nSet)
static std::unique_ptr< SearchAttrItemList > s_xSearchList
static std::unique_ptr< SearchAttrItemList > s_xReplaceList
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange)
void SetCachedString(CachedStringID id, const OUString &sStr)
const SwFrameFormat * m_pLastTableFormat
void SetTabColFromDocPos(const Point &rPt)
bool JumpToSwMark(SwViewShell const *pVwSh, std::u16string_view rMark)
SwView_Impl * GetViewImpl()
virtual bool HasPrintOptionsPage() const
Used by the UI to modify the document model.
virtual void WriteUserData(OUString &, bool bBrowse=false)
SelectionType m_nSelectionType
SwFormatClipboard * m_pFormatClipboard
virtual int getPart() const
bool m_bVScrollbarEnabled
SwTextNode * m_pNumRuleNodeFromDoc
static bool s_bJustOpened
FmFormShell * m_pFormShell
const tools::Long nScrollY
std::unique_ptr< SwDrawBase > m_pDrawActual
const SwFrameFormat * GetLastTableFrameFormat() const
VclPtr< SwEditWin > m_pEditWin
SotExchangeDest m_nLastPasteDestination
bool IsDrawSelMode() const
const tools::Long nScrollX
void SetTabRowFromDoc(bool b)
#define SFX_DECL_VIEWFACTORY(Class)
sal_uInt16 m_nLeftBorderDistance
virtual FmFormShell * GetFormShell() override
std::unique_ptr< SwGlossaryHdl > m_pGlosHdl
SfxDispatcher * GetDispatcher() const
const SwEditWin & GetEditWin() const
SwTextFormatColl * pTextColl
VclPtr< vcl::Window > m_pScrollFill
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
virtual bool IsConditionalFastCall(const SfxRequest &rReq)
SAL_DLLPRIVATE void SpellContext(bool bOn=true)
void SetShell(SfxShell *pS)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
SwTwips m_nLOKPageUpDownOffset
LibreOfficeKit has to force the page size for PgUp/PgDown functionality based on the user's view...
virtual void flushPendingLOKInvalidateTiles()
virtual OString getLOKPayload(int nType, int nViewId, bool *ignore) const
static SvxSearchItem * GetSearchItem()
virtual void ReadUserData(const OUString &, bool bBrowse=false)
SwFrameFormat * pFrameFormat
const tools::Long nLeftOfst
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize)
const OUString & GetCachedString(CachedStringID id)
bool IsDrawRotate() const
virtual void Activate(bool IsMDIActivate) override
void SetFormShell(FmFormShell *pSh)
void SetPrinter(IDocumentDeviceAccess *, SfxPrinter const *, bool bWeb)
bool m_bWheelScrollInProgress
SwDrawBase * GetDrawFuncPtr() const
const SwPostItMgr * GetPostItMgr() const
VclPtr< SvxRuler > m_pVRuler
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
virtual void Deactivate(bool IsMDIActivate) override
SelectCycle m_aSelectCycle
SwDocShell * GetDocShell()
SwCharFormat * pCharFormat
virtual void NotifyCursor(SfxViewShell *) const
const Size & GetDocSz() const
static sal_uInt16 s_nMoveType
SwTextNode is a paragraph in the document model.
tools::Rectangle m_aVisArea
SwWrtShell * GetWrtShellPtr() const
VclPtr< SwScrollbar > m_pVScrollbar
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &)
void SetCursorAtTop(bool bFlag, bool bCenter=false)
bool IsTabColFromDoc() const
std::unique_ptr< SwView_Impl > m_pViewImpl
virtual tools::Rectangle getLOKVisibleArea() const
void SetLastTableFrameFormat(const SwFrameFormat *pSet)
Point m_aTabColFromDocPos
SwPostItMgr * GetPostItMgr()
SvxSearchCmd m_eLastSearchCommand
virtual SfxPrinter * GetPrinter(bool bCreate=false)
const tools::Rectangle & GetVisArea() const
tools::Long GetXScroll() const
struct _xmlTextWriter * xmlTextWriterPtr
SelectionType GetSelectionType() const
OUString m_sOldSectionName
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
#define DECL_DLLPRIVATE_LINK(Member, ArgType, RetType)
union SwApplyTemplate::@32 aColl
void SetNumRuleNodeFromDoc(SwTextNode *pNumRuleNode)
static SvxSearchItem * s_pSrchItem
bool m_bHScrollbarEnabled
void SetTabColFromDoc(bool b)
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY)
#define SFX_DECL_INTERFACE(nId)