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>
37 namespace sw {
struct MergedPara; }
38 namespace sw::mark {
class IBookmark; }
40 #define SPACING_PRECISION_FACTOR 100
97 bool bMark, sal_Int32 nMarkCount);
115 if (nPos < m_nInvalidityPos)
116 m_nInvalidityPos = nPos;
130 assert(nCnt < m_ScriptChanges.size());
131 return m_ScriptChanges[nCnt].position;
135 assert( nCnt < m_ScriptChanges.size());
136 return m_ScriptChanges[nCnt].type;
142 assert(nCnt < m_DirectionChanges.size());
143 return m_DirectionChanges[ nCnt ].position;
147 assert(nCnt < m_DirectionChanges.size());
148 return m_DirectionChanges[ nCnt ].type;
153 return m_Kashida.size();
158 assert(nCnt < m_Kashida.size());
159 return m_Kashida[nCnt];
165 assert(nCnt < m_CompressionChanges.size());
166 return m_CompressionChanges[ nCnt ].position;
170 assert(nCnt < m_CompressionChanges.size());
171 return m_CompressionChanges[ nCnt ].length;
175 assert(nCnt < m_CompressionChanges.size());
176 return m_CompressionChanges[ nCnt ].type;
182 assert(nCnt < m_HiddenChg.size());
183 return m_HiddenChg[ nCnt ];
190 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> * pBookmarks);
193 std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> * pBookmarks);
205 const sal_uInt8* pLevel =
nullptr)
const;
235 sal_Int32& rnStartPos, sal_Int32& rnEndPos,
236 std::vector<sal_Int32>* pList =
nullptr );
257 const SwTextNode& rNode, OUStringBuffer& rText,
258 const sal_Int32 nStt,
const sal_Int32 nEnd,
274 const sal_uInt16 nCompress,
const sal_uInt16 nFontHeight,
275 const bool bCentered,
276 Point* pPoint =
nullptr )
const;
322 std::vector<TextFrameIndex>& rKashidaPosition);
372 static void CJKJustify(
const OUString& rText, sal_Int32* pKernArray,
381 bool bAllowInvalid =
false);
Represents the visualization of a paragraph.
SwFontScript WhichFont(TextFrameIndex nIdx) const
Records a single change in compression.
TextFrameIndex length
Length of the segment.
TextFrameIndex GetInvalidityA() const
TextFrameIndex NextScriptChg(TextFrameIndex nPos) const
TextFrameIndex position
Character position at which we change direction.
sal_uInt8 GetDirType(const size_t nCnt) const
sal_uInt8 type
Script type (Latin/Asian/Complex) that we change to.
TextFrameIndex NextHiddenChg(TextFrameIndex nPos) const
void SetInvalidityA(const TextFrameIndex nPos)
sal_uInt8 type
Direction that we change to.
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...
static SwScriptInfo * GetScriptInfo(const SwTextNode &rNode, SwTextFrame const **o_pFrame=nullptr, bool bAllowInvalid=false)
return a frame for the node, ScriptInfo is its member...
std::vector< CompressionChangeInfo > m_CompressionChanges
std::deque< TextFrameIndex > m_NoKashidaLine
bool IsKashidaLine(TextFrameIndex nCharIdx) const
std::vector< ScriptChangeInfo > m_ScriptChanges
Dialog to specify the properties of date form field.
sal_Int32 KashidaJustify(sal_Int32 *pKernArray, TextFrameIndex nStt, TextFrameIndex nLen, tools::Long nSpaceAdd=0) const
Performs a kashida justification on the kerning array.
static TextFrameIndex ThaiJustify(const OUString &rText, sal_Int32 *pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, TextFrameIndex nNumberOfBlanks=TextFrameIndex(0), tools::Long nSpaceAdd=0)
Performs a thai justification on the kerning array.
sal_uInt8 DirType(const TextFrameIndex nPos) const
Records a single change in direction.
size_t CountCompChg() const
void SetNoKashidaLine(TextFrameIndex nStt, TextFrameIndex nLen)
Use regular blank justification instead of kashdida justification for the given line of text...
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 void selectHiddenTextProperty(const SwTextNode &rNode, MultiSelection &rHiddenMulti, std::vector< std::pair< sw::mark::IBookmark const *, MarkKind >> *pBookmarks)
std::vector< DirectionChangeInfo > m_DirectionChanges
TextFrameIndex GetKashida(const size_t nCnt) const
bool MarkOrClearKashidaInvalid(TextFrameIndex nStt, TextFrameIndex nLen, bool bMark, sal_Int32 nMarkCount)
void UpdateBidiInfo(const OUString &rText)
void InitScriptInfo(const SwTextNode &rNode, sw::MergedPara const *pMerged, bool bRTL)
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
MarkKind GetBookmark(TextFrameIndex nPos) const
static bool IsArabicText(const OUString &rText, TextFrameIndex nStt, TextFrameIndex nLen)
Checks if text is Arabic text.
tools::Long Compress(sal_Int32 *pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, const sal_uInt16 nCompress, const sal_uInt16 nFontHeight, const bool bCentered, Point *pPoint=nullptr) const
TextFrameIndex NextDirChg(const TextFrameIndex nPos, const sal_uInt8 *pLevel=nullptr) const
static void CalcHiddenRanges(const SwTextNode &rNode, MultiSelection &rHiddenMulti, std::vector< std::pair< sw::mark::IBookmark const *, MarkKind >> *pBookmarks)
static void selectRedLineDeleted(const SwTextNode &rNode, MultiSelection &rHiddenMulti, bool bSelect=true)
size_t CountHiddenChg() const
CompType type
Type of compression that we change to.
Records a single change in script type.
bool IsKashidaValid(size_t nKashPos) const
size_t HasKana(TextFrameIndex nStart, TextFrameIndex nEnd) const
CompressionChangeInfo(TextFrameIndex pos, TextFrameIndex len, CompType typ)
TextFrameIndex GetCompLen(const size_t nCnt) const
std::deque< TextFrameIndex > m_NoKashidaLineEnd
CompType DbgCompType(const TextFrameIndex nPos) const
TextFrameIndex GetDirChg(const size_t nCnt) const
SwTextNode is a paragraph in the document model.
void ClearNoKashidaLine(TextFrameIndex nStt, TextFrameIndex nLen)
Clear forced blank justification for a given line.
std::vector< TextFrameIndex > m_HiddenChg
sal_Int16 ScriptType(const TextFrameIndex nPos) const
TextFrameIndex GetHiddenChg(const size_t nCnt) const
size_t CountDirChg() const
TextFrameIndex m_nInvalidityPos
sal_uInt8 GetScriptType(const size_t nCnt) const
void ClearKashidaInvalid(TextFrameIndex const nStt, TextFrameIndex const nLen)
Clears array of kashidas marked as invalid.
TextFrameIndex NextBookmark(TextFrameIndex nPos) const
std::unordered_set< size_t > m_KashidaInvalid
indexes into m_Kashida
bool MarkKashidasInvalid(sal_Int32 const nCnt, TextFrameIndex const nStt, TextFrameIndex const nLen)
Marks nCnt kashida positions as invalid in the given text range.
void ClearKashidaInvalid(size_t nKashPos)
std::vector< std::pair< TextFrameIndex, MarkKind > > m_Bookmarks
static void DeleteHiddenRanges(SwTextNode &rNode)
Hidden text attribute handling.
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.
size_t CountKashida() const
TextFrameIndex GetCompStart(const size_t nCnt) const
static void CJKJustify(const OUString &rText, sal_Int32 *pKernArray, TextFrameIndex nStt, TextFrameIndex nLen, LanguageType aLang, tools::Long nSpaceAdd, bool bIsSpaceStop)
static bool IsInHiddenRange(const SwTextNode &rNode, sal_Int32 nPos)
TextFrameIndex GetScriptChg(const size_t nCnt) const
size_t CountScriptChg() const
sal_uInt8 GetDefaultDir() const
void GetKashidaPositions(TextFrameIndex nStt, TextFrameIndex nLen, std::vector< TextFrameIndex > &rKashidaPosition)
retrieves kashida opportunities for a given text range.
static TextFrameIndex CountCJKCharacters(const OUString &rText, TextFrameIndex nPos, TextFrameIndex nEnd, LanguageType aLang)
bool MarkKashidaInvalid(size_t nKashPos)
TextFrameIndex position
Character position where the change occurs.
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...
TextFrameIndex position
Character position at which we change script.
ScriptChangeInfo(TextFrameIndex pos, sal_uInt8 typ)
std::deque< TextFrameIndex > m_Kashida
DirectionChangeInfo(TextFrameIndex pos, sal_uInt8 typ)