19#ifndef INCLUDED_EDITENG_OUTLINER_HXX
20#define INCLUDED_EDITENG_OUTLINER_HXX
26#include <rtl/ustring.hxx>
90namespace basegfx {
class B2DPolyPolygon; }
108#define OLUNDO_DEPTH EDITUNDO_USER
110#define OLUNDO_EXPAND EDITUNDO_USER+2
111#define OLUNDO_COLLAPSE EDITUNDO_USER+3
113#define OLUNDO_ATTR EDITUNDO_USER+5
114#define OLUNDO_INSERT EDITUNDO_USER+6
193 EDITENG_DLLPRIVATE void ImplExpandOrCollaps( sal_Int32 nStartPara, sal_Int32 nEndPara,
bool bExpand );
200 EDITENG_DLLPRIVATE void ImpPasted( sal_Int32 nStart, sal_Int32 nPrevParaCount, sal_Int32 nSize);
220 void ShowCursor(
bool bGotoCursor =
true,
bool bActivate =
false );
221 void HideCursor(
bool bDeactivate =
false );
228 void SetReadOnly(
bool bReadOnly );
236 void CreateSelectionList (std::vector<Paragraph*> &aSelList) ;
240 OUString GetSelected()
const;
241 void SelectRange( sal_Int32 nFirst, sal_Int32 nCount );
243 void Indent(
short nDiff );
244 void AdjustDepth(
short nDX );
250 void InsertText(
const OUString& rNew,
bool bSelect =
false );
267 void Paste(
bool bUseSpecial =
false );
286 sal_Int32 StartSearchAndReplace(
const SvxSearchItem& rSearchItem );
299 void GetSelectionRectangles(std::vector<tools::Rectangle>& rLogicRects)
const;
301 void RemoveAttribs(
bool bRemoveParaAttribs,
bool bKeepLanguages =
false );
302 void RemoveAttribsKeepLanguages(
bool bRemoveParaAttribs );
303 bool HasSelection()
const;
311 void SelectFieldAtCursor();
316 void ToggleBullets();
318 void ToggleBulletsNumbering(
320 const bool bHandleBullets,
336 void ApplyBulletsNumbering(
337 const bool bHandleBullets,
339 const bool bCheckCurrentNumRuleBeforeApplyingNewNumRule,
340 const bool bAtSelection =
false );
348 void SwitchOffBulletsNumbering(
349 const bool bAtSelection =
false );
354 void EnsureNumberingIsOn();
356 bool IsCursorAtWrongSpelledWord();
357 bool IsWrongSpelledWordAtPos(
const Point& rPosPixel );
360 void SetInvalidateMore( sal_uInt16 nPixel );
361 sal_uInt16 GetInvalidateMore()
const;
363 OUString GetSurroundingText()
const;
364 Selection GetSurroundingTextSelection()
const;
365 bool DeleteSurroundingText(
const Selection& rRange);
383 virtual void NotifyOtherViews(
int nType,
const OString& rKey,
const OString& rPayload) = 0;
425 bool IsRTL()
const {
return mnBiDiLevel % 2 == 1; }
438 const css::lang::Locale* pLocale,
439 const Color& rOverlineColor,
440 const Color& rTextLineColor,
445 bool bEndOfParagraph,
449 mnTextStart(nTxtStart),
454 mpKashidaArray(pKashidaArr),
455 mpWrongSpellVector(pWrongSpellVector),
456 mpFieldData(pFieldData),
458 maOverlineColor(rOverlineColor),
459 maTextLineColor(rTextLineColor),
460 mnBiDiLevel(nBiDiLevel),
462 mnWidthToFill( nWidthToFill ),
463 mbEndOfLine(bEndOfLine),
464 mbEndOfParagraph(bEndOfParagraph),
465 mbEndOfBullet(bEndOfBullet)
478 const Point& rBulletPosition,
479 const Size& rBulletSize)
480 : maBulletGraphicObject(rBulletGraphicObject),
481 maBulletPosition(rBulletPosition),
482 maBulletSize(rBulletSize)
493 : mnPara( nPara ), mrStartPos( rStartPos ), mpOutDev( pOutDev )
609 static constexpr sal_Int16 gnMinDepth = -1;
624 void ImplCheckParagraphs( sal_Int32 nStart, sal_Int32 nEnd );
625 bool ImplHasNumberFormat( sal_Int32 nPara )
const;
626 Size ImplGetBulletSize( sal_Int32 nPara );
627 sal_uInt16 ImplGetNumbering( sal_Int32 nPara,
const SvxNumberFormat* pParaFmt );
628 void ImplCalcBulletText( sal_Int32 nPara,
bool bRecalcLevel,
bool bRecalcChildren );
629 OUString ImplGetBulletText( sal_Int32 nPara );
630 void ImplCheckNumBulletItem( sal_Int32 nPara );
631 void ImplInitDepth( sal_Int32 nPara, sal_Int16 nDepth,
bool bCreateUndo );
632 void ImplSetLevelDependentStyleSheet( sal_Int32 nPara );
634 void ImplBlockInsertionCallbacks(
bool b );
636 void ImpFilterIndents( sal_Int32 nFirstPara, sal_Int32 nLastPara );
637 bool ImpConvertEdtToOut( sal_Int32 nPara );
639 void ImpTextPasted( sal_Int32 nStartPara, sal_Int32 nCount );
640 vcl::Font ImpCalcBulletFont( sal_Int32 nPara )
const;
641 tools::Rectangle ImpCalcBulletArea( sal_Int32 nPara,
bool bAdjust,
bool bReturnPaperPos );
642 bool ImpCanIndentSelectedPages(
OutlinerView* pCurView );
643 bool ImpCanDeleteSelectedPages(
OutlinerView* pCurView );
644 bool ImpCanDeleteSelectedPages(
OutlinerView* pCurView, sal_Int32 nFirstPage, sal_Int32 nPages );
646 void ImplCheckDepth( sal_Int16& rnDepth )
const;
649 void ParagraphInserted( sal_Int32 nParagraph );
650 void ParagraphDeleted( sal_Int32 nParagraph );
651 void ParaAttribsChanged( sal_Int32 nParagraph );
655 void InvalidateBullet(sal_Int32 nPara);
656 void PaintBullet(sal_Int32 nPara,
const Point& rStartPos,
673 void SetVertical(
bool bVertical);
675 bool IsVertical()
const;
676 bool IsTopToBottom()
const;
678 void SetTextColumns(sal_Int16 nColumns, sal_Int32 nSpacing);
680 void SetFixedCellHeight(
bool bUseFixedCellHeight );
689 void SetKernAsianPunctuation(
bool bEnabled );
691 void SetAddExtLeading(
bool b );
693 size_t InsertView(
OutlinerView* pView,
size_t nIndex =
size_t(-1) );
695 void RemoveView(
size_t nIndex );
697 size_t GetViewCount()
const;
703 OUString GetText(
Paragraph const * pPara, sal_Int32 nParaCount=1 )
const;
705 void SetToEmptyText();
711 void SetRefMapMode(
const MapMode& );
712 MapMode const & GetRefMapMode()
const;
714 void SetBackgroundColor(
const Color& rColor );
715 Color const & GetBackgroundColor()
const;
717 void SetMaxDepth( sal_Int16 nDepth );
721 bool SetUpdateLayout(
bool bUpdate );
722 bool IsUpdateLayout()
const;
726 void RemoveAttribs(
const ESelection& rSelection,
bool bRemoveParaAttribs, sal_uInt16 nWhich );
728 sal_Int32 GetParagraphCount()
const;
729 Paragraph* GetParagraph( sal_Int32 nAbsPos )
const;
731 bool HasChildren(
Paragraph const * pParagraph )
const;
732 sal_Int32 GetChildCount(
Paragraph const * pParent )
const;
733 bool IsExpanded(
Paragraph const * pPara )
const;
737 sal_Int16 GetDepth( sal_Int32 nPara )
const;
738 void SetDepth(
Paragraph* pParagraph, sal_Int16 nNewDepth );
740 void EnableUndo(
bool bEnable );
741 bool IsUndoEnabled()
const;
742 void UndoActionStart( sal_uInt16 nId );
743 void UndoActionEnd();
744 void InsertUndo( std::unique_ptr<EditUndo> pUndo );
745 bool IsInUndo()
const;
747 void ClearModifyFlag();
748 bool IsModified()
const;
757 std::optional<NonOverflowingText> GetNonOverflowingText()
const;
758 std::optional<OverflowingText> GetOverflowingText()
const;
759 void ClearOverflowingParaNum();
760 bool IsPageOverflow();
768 sal_Int16
GetPrevDepth()
const {
return static_cast<sal_Int16
>(nDepthChangedHdlPrevDepth); }
796 const Size& GetPaperSize()
const;
803 const Size& GetMinAutoPaperSize()
const;
804 void SetMinAutoPaperSize(
const Size& rSz );
806 const Size& GetMaxAutoPaperSize()
const;
807 void SetMaxAutoPaperSize(
const Size& rSz );
811 void SetDefTab( sal_uInt16 nTab );
813 bool IsFlatMode()
const;
814 void SetFlatMode(
bool bFlat );
816 void EnableAutoColor(
bool b );
818 void ForceAutoColor(
bool b );
819 bool IsForceAutoColor()
const;
823 void SetWordDelimiters(
const OUString& rDelimiters );
824 OUString
const & GetWordDelimiters()
const;
825 OUString
GetWord( sal_Int32 nPara, sal_Int32 nIndex );
827 void StripPortions();
829 void DrawingText(
const Point& rStartPos,
const OUString& rText,
830 sal_Int32 nTextStart, sal_Int32 nTextLen,
838 bool bEndOfParagraph,
840 const css::lang::Locale* pLocale,
841 const Color& rOverlineColor,
842 const Color& rTextLineColor);
844 void DrawingTab(
const Point& rStartPos,
tools::Long nWidth,
const OUString& rChar,
847 bool bEndOfParagraph,
848 const Color& rOverlineColor,
849 const Color& rTextLineColor);
852 Size CalcTextSizeNTP();
857 bool IsInSelectionMode()
const;
859 void SetStyleSheet( sal_Int32 nPara,
SfxStyleSheet* pStyle );
862 void SetParaAttribs( sal_Int32 nPara,
const SfxItemSet& );
863 SfxItemSet const & GetParaAttribs( sal_Int32 nPara )
const;
881 sal_uInt32 GetLineCount( sal_Int32 nParagraph )
const;
882 sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine )
const;
883 sal_uInt32 GetLineHeight( sal_Int32 nParagraph );
892 void QuickInsertLineBreak(
const ESelection& rSel );
895 void QuickInsertText(
const OUString& rText,
const ESelection& rSel );
898 void SetCharAttribs(sal_Int32 nPara,
const SfxItemSet& rSet);
899 void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0 );
900 void QuickFormatDoc();
903 void RemoveFields(
const std::function<
bool (
const SvxFieldData* )>& isFieldData = [] (
const SvxFieldData* ){
return true;} );
905 virtual OUString CalcFieldValue(
const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rTxtColor, std::optional<Color>& rFldColor, std::optional<FontLineStyle>& rFldLineStyle );
907 void SetSpeller( css::uno::Reference< css::linguistic2::XSpellChecker1 >
const &xSpeller );
908 css::uno::Reference< css::linguistic2::XSpellChecker1 >
const &
910 void SetHyphenator( css::uno::Reference< css::linguistic2::XHyphenator >
const & xHyph );
912 static void SetForbiddenCharsTable(
const std::shared_ptr<SvxForbiddenCharactersTable>& xForbiddenChars);
917 void CompleteOnlineSpelling();
921 virtual bool SpellNextDocument();
925 virtual bool ConvertNextDocument();
933 sal_uInt32 GetTextHeight()
const;
935 Point GetDocPos(
const Point& rPaperPos )
const;
936 bool IsTextPos(
const Point& rPaperPos, sal_uInt16 nBorder );
937 bool IsTextPos(
const Point& rPaperPos, sal_uInt16 nBorder,
bool* pbBulletPos );
939 void setGlobalScale(
double rFontX = 100.0,
double rFontY = 100.0,
double rSpacingX = 100.0,
double rSpacingY = 100.0);
940 void getGlobalScale(
double& rFontX,
double& rFontY,
double& rSpacingX,
double& rSpacingY)
const;
941 void setRoundFontSizeToPt(
bool bRound)
const;
943 void EraseVirtualDevice();
945 bool ShouldCreateBigTextObject()
const;
950 void SetLevelDependentStyleSheet( sal_Int32 nPara );
957 void PutSpellingToSentenceStart(
EditView const & rEditView );
973 sal_Int16 GetNumberingStartValue( sal_Int32 nPara )
const;
974 void SetNumberingStartValue( sal_Int32 nPara, sal_Int16 nNumberingStartValue );
976 bool IsParaIsNumberingRestart( sal_Int32 nPara )
const;
977 void SetParaIsNumberingRestart( sal_Int32 nPara,
bool bParaIsNumberingRestart );
992 sal_Int32 GetBulletsNumberingStatus(
993 const sal_Int32 nParaStart,
994 const sal_Int32 nParaEnd )
const;
997 sal_Int32 GetBulletsNumberingStatus()
const;
const GraphicObject maBulletGraphicObject
DrawBulletInfo(const GraphicObject &rBulletGraphicObject, const Point &rBulletPosition, const Size &rBulletSize)
o3tl::span< const sal_Bool > mpKashidaArray
const SvxFieldData * mpFieldData
const Color maOverlineColor
const EEngineData::WrongSpellVector * mpWrongSpellVector
const Color maTextLineColor
DrawPortionInfo(const Point &rPos, OUString aTxt, sal_Int32 nTxtStart, sal_Int32 nTxtLen, const SvxFont &rFnt, sal_Int32 nPar, o3tl::span< const sal_Int32 > pDXArr, o3tl::span< const sal_Bool > pKashidaArr, const EEngineData::WrongSpellVector *pWrongSpellVector, const SvxFieldData *pFieldData, const css::lang::Locale *pLocale, const Color &rOverlineColor, const Color &rTextLineColor, sal_uInt8 nBiDiLevel, bool bFilled, tools::Long nWidthToFill, bool bEndOfLine, bool bEndOfParagraph, bool bEndOfBullet)
tools::Long mnWidthToFill
const css::lang::Locale * mpLocale
o3tl::span< const sal_Int32 > mpDXArray
std::optional< Color > const & GetFieldColor() const
void SetSdrPage(SdrPage *pPage)
void SetFieldColor(std::optional< Color > xCol)
std::optional< Color > const & GetTextColor() const
void SetRepresentation(const OUString &rStr)
OUString & GetRepresentation()
std::optional< FontLineStyle > mxFldLineStyle
void SetTextColor(std::optional< Color > xCol)
Outliner * GetOutliner() const
sal_Int32 GetPara() const
std::optional< Color > mxFldColor
EditFieldInfo(const EditFieldInfo &)=delete
const SvxFieldItem & GetField() const
std::optional< FontLineStyle > const & GetFontLineStyle() const
std::optional< Color > mxTxtColor
void SetFontLineStyle(std::optional< FontLineStyle > xLineStyle)
const OUString & GetRepresentation() const
const SvxFieldItem & rFldItem
EditFieldInfo(Outliner *pOutl, const SvxFieldItem &rFItem, sal_Int32 nPa, sal_Int32 nPo)
SdrPage * GetSdrPage() const
Interface class to not depend on SfxViewShell in editeng.
virtual vcl::Window * GetEditWindowForActiveOLEObj() const =0
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const =0
virtual void libreOfficeKitViewAddPendingInvalidateTiles()=0
virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) const =0
virtual void libreOfficeKitViewUpdatedCallback(int nType) const =0
virtual ViewShellId GetViewShellId() const =0
virtual void NotifyOtherViews(int nType, const OString &rKey, const OString &rPayload)=0
Wrapper around SfxLokHelper::notifyOtherViews().
virtual void NotifyOtherView(OutlinerViewShell *pOtherShell, int nType, const OString &rKey, const OString &rPayload)=0
Wrapper around SfxLokHelper::notifyOtherView().
virtual ViewShellDocId GetDocId() const =0
~OutlinerViewShell() noexcept
virtual void libreOfficeKitViewCallbackWithViewId(int nType, const OString &pPayload, int nViewId) const =0
virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle *pRect, int nPart, int nMode) const =0
void SetEndCutPasteLinkHdl(const Link< LinkParamNone *, void > &rLink)
std::unique_ptr< EditView > pEditView
Outliner * GetOutliner() const
Link< LinkParamNone *, void > aEndCutPasteLink
EditView & GetEditView() const
bool Expand(Paragraph const *)
void SetEndMovingHdl(const Link< Outliner *, void > &rLink)
Link< OutlinerView *, bool > aRemovingPagesHdl
OutlinerMode GetOutlinerMode() const
void SetPaintFirstLineHdl(const Link< PaintFirstLineInfo *, void > &rLink)
void SetDrawPortionHdl(const Link< DrawPortionInfo *, void > &rLink)
const Link< DepthChangeHdlParam, void > & GetDepthChangedHdl() const
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
std::unique_ptr< OutlinerEditEng > pEditEngine
const Link< ParagraphHdlParam, void > & GetParaInsertedHdl() const
sal_Int16 GetPrevDepth() const
Link< OutlinerView *, bool > aIndentingPagesHdl
void SetDrawBulletHdl(const Link< DrawBulletInfo *, void > &rLink)
DECL_DLLPRIVATE_LINK(EndPasteOrDropHdl, PasteOrDropInfos &, void)
Link< ParagraphHdlParam, void > aParaRemovingHdl
friend class OutlinerView
EEControlBits GetControlWord() const
Link< Outliner *, void > aEndMovingHdl
const Link< EditFieldInfo *, void > & GetCalcFieldValueHdl() const
bool Collapse(Paragraph const *)
void SetIndentingPagesHdl(const Link< OutlinerView *, bool > &rLink)
DECL_DLLPRIVATE_LINK(BeginMovingParagraphsHdl, MoveParagraphsInfo &, void)
Link< DepthChangeHdlParam, void > aDepthChangedHdl
std::unique_ptr< ParagraphList > pParaList
OutlinerMode nOutlinerMode
Link< ParagraphHdlParam, void > aParaInsertedHdl
void RemoveAttribs(const ESelection &rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich)
sal_Int32 GetSelPageCount() const
DECL_DLLPRIVATE_LINK(BeginPasteOrDropHdl, PasteOrDropInfos &, void)
Link< DrawPortionInfo *, void > aDrawPortionHdl
Link< PasteOrDropInfos *, void > maBeginPasteOrDropHdl
Color const & GetBackgroundColor() const
Link< EditFieldInfo *, void > aCalcFieldValueHdl
void SetControlWord(EEControlBits nWord)
void SetParaInsertedHdl(const Link< ParagraphHdlParam, void > &rLink)
virtual std::optional< bool > GetCompatFlag(SdrCompatibilityFlag) const
sal_Int16 GetMaxDepth() const
Link< Outliner *, void > aBeginMovingHdl
void SetRemovingPagesHdl(const Link< OutlinerView *, bool > &rLink)
void SetParaRemovingHdl(const Link< ParagraphHdlParam, void > &rLink)
DECL_DLLPRIVATE_LINK(ParaVisibleStateChangedHdl, Paragraph &, void)
DECL_DLLPRIVATE_LINK(EditEngineNotifyHdl, EENotify &, void)
sal_Int32 nDepthChangedHdlPrevDepth
void SetCalcFieldValueHdl(const Link< EditFieldInfo *, void > &rLink)
Link< PaintFirstLineInfo *, void > maPaintFirstLineHdl
void SetBeginMovingHdl(const Link< Outliner *, void > &rLink)
ErrCode Read(SvStream &rInput, const OUString &rBaseURL, EETextFormat, SvKeyValueIterator *pHTTPHeaderAttrs=nullptr)
Link< PasteOrDropInfos *, void > maEndPasteOrDropHdl
const Link< ParagraphHdlParam, void > & GetParaRemovingHdl() const
Link< DrawBulletInfo *, void > aDrawBulletHdl
const Link< Outliner *, void > & GetEndMovingHdl() const
void SetBackgroundColor(const Color &rColor)
sal_uInt8 nBlockInsCallback
DECL_DLLPRIVATE_LINK(EndMovingParagraphsHdl, MoveParagraphsInfo &, void)
SfxStyleSheet * GetStyleSheet(sal_Int32 nPara)
void SetDepthChangedHdl(const Link< DepthChangeHdlParam, void > &rLink)
const Link< Outliner *, void > & GetBeginMovingHdl() const
sal_Int16 mnNumberingStartValue
bool mbParaIsNumberingRestart
sal_Int16 GetDepth() const
void SetNumberingStartValue(sal_Int16 nNumberingStartValue)
bool IsParaIsNumberingRestart() const
sal_Int16 GetNumberingStartValue() const
bool HasFlag(ParaFlag nFlag) const
void dumpAsXml(xmlTextWriterPtr pWriter) const
void RemoveFlag(ParaFlag nFlag)
void SetFlag(ParaFlag nFlag)
Paragraph(const Paragraph &)=delete
const OUString & GetText() const
Paragraph & operator=(const Paragraph &rPara)=delete
void SetDepth(sal_Int16 nNewDepth)
void SetText(const OUString &rText)
void SetParaIsNumberingRestart(bool bParaIsNumberingRestart)
void setWidth(tools::Long nWidth)
This item stores a field (SvxFieldData).
Specialise std::optional template for the case where we are wrapping a o3tl::cow_wrapper type,...
virtual OUString GetWord() override
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
virtual void SetText(const OUString &rStr) override
#define EE_PARA_NOT_FOUND
EEHorizontalTextDirection
#define EDITENG_DLLPRIVATE
#define EDITENG_DLLPUBLIC
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
struct _xmlTextWriter * xmlTextWriterPtr
std::vector< WrongSpellClass > WrongSpellVector
void Clear(EHistoryType eHistory)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
std::vector< SpellPortion > SpellPortions
size_t GetAbsPos(const weld::TreeView &rTreeView, const weld::TreeIter &rIter)
bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext(OUString &rStatusVal, LanguageType &rLang, const EditView &rEditView)
::std::vector< OutlinerView * > ViewList
void EDITENG_DLLPUBLIC ReplaceTextWithSynonym(EditView &rEditView, const OUString &rSynonmText)
PaintFirstLineInfo(sal_Int32 nPara, const Point &rStartPos, OutputDevice *pOutDev)
VclPtr< OutputDevice > mpOutDev
ParaRange(sal_Int32 nS, sal_Int32 nE)
void GetSelection(struct ESelection &rSel, SvxTextForwarder const *pForwarder) noexcept