19#ifndef INCLUDED_SW_SOURCE_CORE_INC_TXTFRM_HXX
20#define INCLUDED_SW_SOURCE_CORE_INC_TXTFRM_HXX
22#include <com/sun/star/uno/Sequence.hxx>
57#define NON_PRINTING_CHARACTER_COLOR Color(0x26, 0x8b, 0xd2)
64 css::uno::Reference<css::linguistic2::XHyphenatedWord>
m_xHyphWord;
78 void SetHyphWord(
const css::uno::Reference<css::linguistic2::XHyphenatedWord> &xHW)
118std::pair<SwTextNode *, SwTextNode *>
129 SwTextNode const& rNode, sal_Int32 nIndex, sal_Int32 nLen);
143 std::set<SwNodeOffset> *pSkipped);
216 void CalcLineSpace();
219 void AdjustFrame(
const SwTwips nChgHeight,
bool bHasToFit =
false );
223 void PrepWidows(
const sal_uInt16 nNeed,
bool bNotify );
252 void Lock() { mbLocked =
true; }
254 void SetWidow(
const bool bNew ) { mbWidow = bNew; }
256 void SetEmpty(
const bool bNew ) { mbEmpty = bNew; }
262 bool GetModelPositionForViewPoint_(
SwPosition *pPos,
const Point &rPoint,
264 void FillCursorPos(
SwFillData &rFill )
const;
272 ::std::vector<SwAnchoredObject *> & rIntersectingObjs);
274 const bool bAdjust =
false );
280 virtual void MakePos()
override;
287 SwTwips GetFootnoteFrameHeight_()
const;
290 bool CalcPrepFootnoteAdjust();
293 void ValidateFrame();
294 void ValidateBodyFrame();
296 bool GetDropRect_(
SwRect &rRect )
const;
300 bool IsFootnoteNumFrame_()
const;
303 bool FormatQuick(
bool bForceQuickFormat );
310 bool PaintEmpty(
const SwRect &,
bool bCheck )
const;
315 void CalcBaseOfstForFly();
328 void CalcHeightOfLastLine(
const bool _bUseFont =
false );
333 void UpdateOutlineContentVisibilityButton(
SwWrtShell* pWrtSh)
const;
334 void PaintOutlineContentVisibilityButton()
const;
336 void PaintParagraphStylesHighlighting()
const;
341 std::vector<SwFlyAtContentFrame*> GetSplitFlyDrawObjs()
const;
363 void CollectAutoCmplWrds(
SwTextNode &, sal_Int32);
397 bool GetTopOfLine(
SwTwips& _onTopOfLine,
418 {
return GetModelPositionForViewPoint_( pPos, rPoint,
false ); }
420 void PaintExtraData(
const SwRect & rRect )
const;
423 SwPrintData const*
const pPrintData =
nullptr )
const override;
435 bool bSetInReadOnly )
const override;
437 bool bSetInReadOnly )
const override;
439 bool bSetInReadOnly )
const;
441 bool bSetInReadOnly )
const;
448 bool& bRight,
bool bInsertCursor );
464 void SetMergedPara(std::unique_ptr<sw::MergedPara> p);
469 const OUString& GetText()
const;
470 SwTextNode const* GetTextNodeForParaProps()
const;
471 SwTextNode const* GetTextNodeForFirstText()
const;
476 {
return const_cast<SwDoc &
>(
const_cast<SwTextFrame const*
>(
this)->GetDoc()); }
477 SwDoc const& GetDoc()
const;
490 const void *pVoid =
nullptr,
bool bNotify =
true )
override;
497 virtual bool WouldFit(
SwTwips &nMaxHeight,
bool &bSplit,
bool bTst,
bool bMoveBwd)
override;
518 inline bool HasPara()
const;
519 bool HasPara_()
const;
532 SwTwips GetLowerMarginForFlyIntersect()
const;
544 inline void SetRepaint()
const;
545 inline void ResetRepaint()
const;
547 void SetHasRotatedPortions(
bool bHasRotatedPortions);
550 {
const_cast<SwTextFrame*
>(
this)->mbHasAnimation =
true; }
559 void CalcFootnoteFlag();
563 bool IsHiddenNow()
const;
572 void HideAndShowObjects();
577 inline SwTwips GetFootnoteFrameHeight()
const;
580 {
return const_cast<SwTextFrame *
>(
this)->FindFootnoteRef( pFootnote ); }
592 bool bNoChar =
false)
const;
614 SwTextFrame* GetFormatted(
bool bForceQuickFormat =
false );
624 {
return HasPara() && GetDropRect_( rRect ); }
632 void SetCacheIdx(
const sal_uInt16 nNew ) { mnCacheIndex = nNew; }
637 void RemoveFromCache();
655 void CalcAdditionalFirstLineOffset();
659 return mnAdditionalFirstLineOffset;
667 tools::Long GetLineSpace(
const bool _bNoPropLineSpacing =
false )
const;
670 sal_uInt16 FirstLineHeight()
const;
679 bool FillRegister(
SwTwips& rRegStart, sal_uInt16& rRegDiff );
687 void RecalcAllLines();
699 void SwapWidthAndHeight();
705 void SwitchHorizontalToVertical(
SwRect& rRect )
const;
711 void SwitchHorizontalToVertical(
Point& rPoint )
const;
723 void SwitchVerticalToHorizontal(
SwRect& rRect )
const;
729 void SwitchVerticalToHorizontal(
Point& rPoint )
const;
741 void SwitchLTRtoRTL(
SwRect& rRect )
const;
747 void SwitchLTRtoRTL(
Point& rPoint )
const;
763 return mbFollowFormatAllowed;
768 mbFollowFormatAllowed =
true;
773 mbFollowFormatAllowed =
false;
778 return ( bIgnoreFlysAnchoredAtThisFrame ?
780 mnFlyAnchorOfstNoWrap );
783 SwTwips GetBaseVertOffsetForFly(
bool bIgnoreFlysAnchoredAtThisFrame)
const;
787 return mnHeightOfLastLine;
790 static void repaintTextFrames(
const SwTextNode& rNode );
792 void RegisterToNode(
SwTextNode &,
bool isForceNodeAsFirst =
false);
800 bool HasNonLastSplitFlyDrawObj()
const;
804 bool IsEmptyMasterWithSplitFly()
const;
808 bool IsEmptyWithSplitFly()
const;
860 return Grow( nGrow,
true );
971 void Modify(
bool bChgToRTL );
1038 std::vector<std::pair<SwTextNode const*, SwTextAttr const*>>
m_Hints;
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
virtual bool GetInfo(SfxPoolItem &) const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
virtual bool UnitUp(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
const SwContentFrame * GetFollow() const
virtual void DestroyImpl() override
virtual bool UnitDown(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
virtual bool LeftMargin(SwPaM *) const =0
virtual bool RightMargin(SwPaM *, bool bAPI=false) const =0
virtual bool WouldFit(SwTwips &nMaxHeight, bool &bSplit, bool bTst, bool)
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
LanguageType nOldLanguageType
SwDigitModeModifier(const OutputDevice &rOutp, LanguageType eCurLang)
const OutputDevice & rOut
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Helper class which can be used instead of the macros if a function has too many returns.
SwFrameSwapper(const SwTextFrame *pFrame, bool bSwapIfNotSwapped)
const SwTextFrame * pFrame
Base class of the Writer layout elements.
SwTwips Grow(SwTwips, bool bTst=false, bool bInfo=false)
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true)
SwFrame * GetIndPrev() const
bool IsInFootnote() const
virtual void dumpAsXml(xmlTextWriterPtr writer=nullptr) const =0
virtual void MakePos()
Calculates the frame area position, in case it's invalid.
virtual bool FillSelection(SwSelectionList &rList, const SwRect &rRect) const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr)
Calculates the frame area size and the print area, in case they are invalid.
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
virtual const SvxFormatBreakItem & GetBreakItem() const
virtual css::uno::Sequence< css::style::TabStop > GetTabStopInfo(SwTwips)
virtual void CheckDirection(bool bVert)
virtual const SwFormatPageDesc & GetPageDescItem() const
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
a clone of SwInterHyphInfo, but with TextFrameIndex instead of node index
void SetHyphWord(const css::uno::Reference< css::linguistic2::XHyphenatedWord > &xHW)
TextFrameIndex m_nWordLen
SwInterHyphInfoTextFrame(SwTextFrame const &rFrame, SwTextNode const &rNode, SwInterHyphInfo const &rHyphInfo)
TextFrameIndex m_nStart
input: requested range to hyphenate
css::uno::Reference< css::linguistic2::XHyphenatedWord > m_xHyphWord
output: hyphenated word
void UpdateTextNodeHyphInfo(SwTextFrame const &rFrame, SwTextNode const &rNode, SwInterHyphInfo &o_rHyphInfo)
TextFrameIndex m_nWordStart
output: found word
const OutputDevice & m_rOut
SwLayoutModeModifier(const OutputDevice &rOutp)
void Modify(bool bChgToRTL)
vcl::text::ComplexTextLayoutFlags m_nOldLayoutMode
Marks a node in the document model.
Base class of the Writer document model elements.
PaM is Point and Mark: a selection of the document model.
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
Of course Writer needs its own rectangles.
The root element of a Writer document layout.
This class is used as parameter for creation of a block cursor selection.
SwSwapIfNotSwapped(SwTextFrame *frame)
SwSwapIfSwapped(SwTextFrame *frame)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Represents the visualization of a paragraph.
bool IsFootnoteNumFrame() const
Am I a FootnoteFrame, with a number at the start of the paragraph?
SwTextFrame * GetFrameAtPos(const SwPosition &rPos)
bool GetDropRect(SwRect &rRect) const
DropCaps and selections.
bool FollowFormatAllowed() const
void SetOffset(TextFrameIndex nNewOfst)
SwTextFrame * GetFollow()
TextFrameIndex GetOffset() const
SwTwips mnHeightOfLastLine
sw::MergedPara const * GetMergedPara() const
SwTwips GetAdditionalFirstLineOffset() const
void ResetRepaint() const
bool mbHasRotatedPortions
Contains rotated portions.
SwTwips GetBaseOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const
void SwitchRTLtoLTR(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from RTL to LTR layout.
void SetFootnote(const bool bNew)
Will be moved soon.
sal_Int32 GetAllLines() const
For displaying the line numbers.
void SwitchRTLtoLTR(Point &rPoint) const
Calculates the coordinates of a point when switching from RTL to LTR layout.
bool IsEmptyMaster() const
If there's a Follow and we don't contain text ourselves.
void SetAnimation() const
bool HasAnimation() const
sw::MergedPara * GetMergedPara()
static void SetTextCache(SwCache *pNew)
const SwTextFrame * FindFootnoteRef(const SwTextFootnote *pFootnote) const
void SetWidow(const bool bNew)
void SetCacheIdx(const sal_uInt16 nNew)
SwParaPortion * GetPara()
bool GetKeyCursorOfst(SwPosition *pPos, const Point &rPoint) const
Makes sure that the Frame is not switched (e.g.
bool IsFieldFollow() const
SwTwips mnFlyAnchorOfstNoWrap
bool mbFollowFormatAllowed
bool IsInFootnoteConnect() const
std::unique_ptr< sw::MergedPara > m_pMergedPara
redline merge data
static SwCache * s_pTextCache
SwLineLayout cache: the lines are not actually owned by the SwTextFrame but by this SwCache,...
void SetFieldFollow(const bool bNew)
static SwCache * GetTextCache()
SwTwips mnFlyAnchorVertOfstNoWrap
The y position for wrap-through flys anchored at this paragraph.
void SetJustWidow(const bool bNew)
bool IsInside(TextFrameIndex nPos) const
Respect the Follows.
SwTwips GrowTst(const SwTwips nGrow)
Test grow.
void ForbidFollowFormat()
sal_Int32 GetThisLines() const
sal_uInt16 GetCacheIdx() const
SwTextNode * GetTextNodeFirst()
void SetOffset_(TextFrameIndex nNewOfst)
SwTwips GetHeightOfLastLine() const
void ManipOfst(TextFrameIndex const nNewOfst)
void SwapWidthAndHeight()
Swaps width and height of the text frame.
SwTwips GetFootnoteFrameHeight_() const
Calculates the maximum reachable height for the TextFrame in the Footnote Area.
SwTwips mnAdditionalFirstLineOffset
SwTwips GetFootnoteFrameHeight() const
static tools::Long GetMinPrtLine()
void SetEmpty(const bool bNew)
bool GetHasRotatedPortions() const
SwTextNode is a paragraph in the document model.
Used by the UI to modify the document model.
TemporarySwap(SwTextFrame *frame, bool swap)
TemporarySwap(TemporarySwap const &)=delete
void operator=(TemporarySwap const &)=delete
SwTextFrame * m_pTextFrame
TextFrameLockGuard(SwFrame *pFrame)
iterate SwTextAttr in potentially merged text frame
sw::MergedPara const *const m_pMerged
MergedAttrIterBase(SwTextFrame const &rFrame)
SwTextNode const *const m_pNode
SwTextAttr const * NextAttr(SwTextNode const *&rpNode)
SwTextNode const *const m_pNode
MergedAttrIterByEnd(SwTextFrame const &rFrame)
std::vector< std::pair< SwTextNode const *, SwTextAttr const * > > m_Hints
SwTextAttr const * PrevAttr(SwTextNode const **ppNode=nullptr)
MergedAttrIterReverse(SwTextFrame const &rFrame)
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
MergedAttrIter(SwTextFrame const &rFrame)
struct _xmlTextWriter * xmlTextWriterPtr
bool sw_ChangeOffset(SwTextFrame *pFrame, TextFrameIndex nNew)
ExpandMode
Some helpers for converting model strings to view strings.
void swap(cow_wrapper< T, P > &a, cow_wrapper< T, P > &b)
Dialog to specify the properties of date form field.
void CheckResetRedlineMergeFlag(SwTextNode &rNode, Recreate eRecreateMerged)
if first node is First, its frames may need to be moved, never deleted.
void UpdateFramesForRemoveDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
bool HasNumberingWhichNeedsLayoutUpdate(const SwTextNode &rTextNode)
Decides if rTextNode has a numbering which has layout-level values (e.g.
SwPosition GetParaPropsPos(SwRootFrame const &rLayout, SwPosition const &rPos)
void GotoNextLayoutTextFrame(SwNodeIndex &rIndex, SwRootFrame const *const pLayout)
void GotoPrevLayoutTextFrame(SwNodeIndex &rIndex, SwRootFrame const *const pLayout)
void MoveMergedFlysAndFootnotes(std::vector< SwTextFrame * > const &rFrames, SwTextNode const &rFirstNode, SwTextNode &rSecondNode, bool)
TextFrameIndex UpdateMergedParaForDelete(MergedPara &rMerged, bool isRealDelete, SwTextNode const &rNode, sal_Int32 nIndex, sal_Int32 nLen)
bool FrameContainsNode(SwContentFrame const &rFrame, SwNodeOffset nNodeIndex)
SwTextFrame * MakeTextFrame(SwTextNode &rNode, SwFrame *, sw::FrameMode eMode)
bool IsMarkHidden(SwRootFrame const &rLayout, ::sw::mark::IMark const &rMark)
TextFrameIndex MapModelToView(MergedPara const &, SwTextNode const *pNode, sal_Int32 nIndex)
const SwTwips WIDOW_MAGIC
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNode const &rPos)
SwTextNode const & GetAttrMerged(SfxItemSet &rFormatSet, SwTextNode const &rNode, SwRootFrame const *pLayout)
bool IsParaPropsNode(SwRootFrame const &rLayout, SwTextNode const &rNode)
void UpdateFramesForAddDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
void RecreateStartTextFrames(SwTextNode &rNode)
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(MergedPara const &, TextFrameIndex nIndex)
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
bool IsMarkHintHidden(SwRootFrame const &rLayout, SwTextNode const &rNode, SwTextAttrEnd const &rHint)
InsertText MakeInsertText(SwTextNode &rNode, const sal_Int32 nPos, const sal_Int32 nLen)
void AddRemoveFlysAnchoredToFrameStartingAtNode(SwTextFrame &rFrame, SwTextNode &rTextNode, std::set< SwNodeOffset > *pSkipped)
rTextNode is the first one of the "new" merge - if rTextNode isn't the same as MergedPara::pFirstNode...
void MoveDeletedPrevFrames(const SwTextNode &rDeletedPrev, SwTextNode &rNode)
if first node is deleted & second survives, then the first node's frame will be deleted too; prevent ...
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNode const &rNode)
std::unique_ptr< sw::MergedPara > CheckParaRedlineMerge(SwTextFrame &rFrame, SwTextNode &rTextNode, FrameMode eMode)
Marks a position in the document model.
Describes a part of a single text node, which will be part of a text frame, even when redlines are hi...
Extent(SwTextNode *const p, sal_Int32 const s, sal_Int32 const e)
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
OUString mergedText
note: cannot be const currently to avoid UB because SwTextGuess::Guess const_casts it and modifies it...
sw::WriterMultiListener listener
SwTextNode *const pFirstNode
except break attributes, those are taken from the first node
MergedPara(SwTextFrame &rFrame, std::vector< Extent > &&rExtents, OUString aText, SwTextNode *const pProps, SwTextNode *const pFirst, SwTextNode const *const pLast)
SwTextNode * pParaPropsNode
most paragraph properties are taken from the first non-empty node
SwTextNode const * pLastNode
mainly for sanity checks
std::vector< Extent > extents
constexpr sal_Int32 COMPLETE_STRING