20#ifndef INCLUDED_SW_SOURCE_CORE_INC_SCRIPTINFO_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_SCRIPTINFO_HXX
25#include <unordered_set>
26#include <rtl/ustrbuf.hxx>
38namespace sw {
struct MergedPara; }
39namespace sw::mark {
class IBookmark; }
41#define SPACING_PRECISION_FACTOR 100
75 std::vector<std::tuple<TextFrameIndex, MarkKind, Color, OUString>>
m_Bookmarks;
98 bool bMark, sal_Int32 nMarkCount);
188 std::vector<std::tuple<MarkKind, Color, OUString>>
192 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> * pBookmarks);
195 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> * pBookmarks);
207 const sal_uInt8* pLevel =
nullptr)
const;
237 sal_Int32& rnStartPos, sal_Int32& rnEndPos,
238 std::vector<sal_Int32>* pList =
nullptr );
259 const SwTextNode& rNode, OUStringBuffer& rText,
260 const sal_Int32 nStt,
const sal_Int32 nEnd,
276 const sal_uInt16 nCompress,
const sal_uInt16 nFontHeight,
277 const bool bCentered,
278 Point* pPoint =
nullptr )
const;
324 std::vector<TextFrameIndex>& rKashidaPosition);
383 bool bAllowInvalid =
false);
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...
std::unordered_set< size_t > m_KashidaInvalid
indexes into m_Kashida
TextFrameIndex m_nInvalidityPos
static void DeleteHiddenRanges(SwTextNode &rNode)
Hidden text attribute handling.
sal_Int16 ScriptType(const TextFrameIndex nPos) const
void ClearNoKashidaLine(TextFrameIndex nStt, TextFrameIndex nLen)
Clear forced blank justification for a given line.
CompType GetCompType(const size_t nCnt) const
void MarkKashidasInvalid(sal_Int32 nCnt, const TextFrameIndex *pKashidaPositions)
Marks nCnt kashida positions as invalid pKashidaPositions: array of char indices relative to the para...
TextFrameIndex GetCompStart(const size_t nCnt) const
std::deque< TextFrameIndex > m_NoKashidaLineEnd
static void selectHiddenTextProperty(const SwTextNode &rNode, MultiSelection &rHiddenMulti, std::vector< std::pair< sw::mark::IBookmark const *, MarkKind > > *pBookmarks)
TextFrameIndex GetCompLen(const size_t nCnt) const
TextFrameIndex NextDirChg(const TextFrameIndex nPos, const sal_uInt8 *pLevel=nullptr) const
tools::Long Compress(KernArray &rKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, const sal_uInt16 nCompress, const sal_uInt16 nFontHeight, const bool bCentered, Point *pPoint=nullptr) const
static bool GetBoundsOfHiddenRange(const SwTextNode &rNode, sal_Int32 nPos, sal_Int32 &rnStartPos, sal_Int32 &rnEndPos, std::vector< sal_Int32 > *pList=nullptr)
Hidden text range information - static and non-version.
std::deque< TextFrameIndex > m_Kashida
TextFrameIndex GetHiddenChg(const size_t nCnt) const
SwFontScript WhichFont(TextFrameIndex nIdx) const
std::vector< ScriptChangeInfo > m_ScriptChanges
sal_Int32 KashidaJustify(KernArray *pKernArray, sal_Bool *pKashidaArray, TextFrameIndex nStt, TextFrameIndex nLen, tools::Long nSpaceAdd=0) const
Performs a kashida justification on the kerning array.
std::vector< std::tuple< MarkKind, Color, OUString > > GetBookmarks(TextFrameIndex const nPos)
void UpdateBidiInfo(const OUString &rText)
sal_uInt8 GetDefaultDir() const
std::vector< DirectionChangeInfo > m_DirectionChanges
static bool IsInHiddenRange(const SwTextNode &rNode, sal_Int32 nPos)
sal_uInt8 DirType(const TextFrameIndex nPos) const
CompType DbgCompType(const TextFrameIndex nPos) const
static void CJKJustify(const OUString &rText, KernArray &rKernArray, TextFrameIndex nStt, TextFrameIndex nLen, LanguageType aLang, tools::Long nSpaceAdd, bool bIsSpaceStop)
bool MarkOrClearKashidaInvalid(TextFrameIndex nStt, TextFrameIndex nLen, bool bMark, sal_Int32 nMarkCount)
size_t CountScriptChg() const
static sal_Int32 MaskHiddenRanges(const SwTextNode &rNode, OUStringBuffer &rText, const sal_Int32 nStt, const sal_Int32 nEnd, const sal_Unicode cChar)
Hidden text attribute handling.
static TextFrameIndex CountCJKCharacters(const OUString &rText, TextFrameIndex nPos, TextFrameIndex nEnd, LanguageType aLang)
static TextFrameIndex ThaiJustify(std::u16string_view aText, KernArray *pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, TextFrameIndex nNumberOfBlanks=TextFrameIndex(0), tools::Long nSpaceAdd=0)
Performs a thai justification on the kerning array.
bool IsKashidaLine(TextFrameIndex nCharIdx) const
TextFrameIndex GetInvalidityA() const
void ClearKashidaInvalid(size_t nKashPos)
void GetKashidaPositions(TextFrameIndex nStt, TextFrameIndex nLen, std::vector< TextFrameIndex > &rKashidaPosition)
retrieves kashida opportunities for a given text range.
TextFrameIndex GetScriptChg(const size_t nCnt) const
bool IsKashidaValid(size_t nKashPos) const
sal_uInt8 GetScriptType(const size_t nCnt) const
TextFrameIndex NextHiddenChg(TextFrameIndex nPos) const
size_t CountKashida() const
bool MarkKashidaInvalid(size_t nKashPos)
static bool IsArabicText(const OUString &rText, TextFrameIndex nStt, TextFrameIndex nLen)
Checks if text is Arabic text.
void ClearKashidaInvalid(TextFrameIndex const nStt, TextFrameIndex const nLen)
Clears array of kashidas marked as invalid.
static SwScriptInfo * GetScriptInfo(const SwTextNode &rNode, SwTextFrame const **o_pFrame=nullptr, bool bAllowInvalid=false)
return a frame for the node, ScriptInfo is its member... (many clients need both frame and SI,...
void SetNoKashidaLine(TextFrameIndex nStt, TextFrameIndex nLen)
Use regular blank justification instead of kashdida justification for the given line of text.
size_t CountDirChg() const
static void CalcHiddenRanges(const SwTextNode &rNode, MultiSelection &rHiddenMulti, std::vector< std::pair< sw::mark::IBookmark const *, MarkKind > > *pBookmarks)
TextFrameIndex GetDirChg(const size_t nCnt) const
TextFrameIndex NextScriptChg(TextFrameIndex nPos) const
size_t CountCompChg() const
size_t CountHiddenChg() const
std::deque< TextFrameIndex > m_NoKashidaLine
TextFrameIndex NextBookmark(TextFrameIndex nPos) const
bool MarkKashidasInvalid(sal_Int32 const nCnt, TextFrameIndex const nStt, TextFrameIndex const nLen)
Marks nCnt kashida positions as invalid in the given text range.
std::vector< TextFrameIndex > m_HiddenChg
static void selectRedLineDeleted(const SwTextNode &rNode, MultiSelection &rHiddenMulti, bool bSelect=true)
size_t HasKana(TextFrameIndex nStart, TextFrameIndex nEnd) const
std::vector< CompressionChangeInfo > m_CompressionChanges
void InitScriptInfo(const SwTextNode &rNode, sw::MergedPara const *pMerged, bool bRTL)
std::vector< std::tuple< TextFrameIndex, MarkKind, Color, OUString > > m_Bookmarks
sal_uInt8 GetDirType(const size_t nCnt) const
TextFrameIndex GetKashida(const size_t nCnt) const
void SetInvalidityA(const TextFrameIndex nPos)
Represents the visualization of a paragraph.
SwTextNode is a paragraph in the document model.
Dialog to specify the properties of date form field.
Records a single change in compression.
TextFrameIndex position
Character position where the change occurs.
CompressionChangeInfo(TextFrameIndex pos, TextFrameIndex len, CompType typ)
CompType type
Type of compression that we change to.
TextFrameIndex length
Length of the segment.
Records a single change in direction.
sal_uInt8 type
Direction that we change to.
DirectionChangeInfo(TextFrameIndex pos, sal_uInt8 typ)
TextFrameIndex position
Character position at which we change direction.
Records a single change in script type.
TextFrameIndex position
Character position at which we change script.
ScriptChangeInfo(TextFrameIndex pos, sal_uInt8 typ)
sal_uInt8 type
Script type (Latin/Asian/Complex) that we change to.
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...