22#include <com/sun/star/i18n/ScriptType.hpp>
25#include <osl/diagnose.h>
40 :
SwPaM( *rPam.GetPoint(), static_cast<
SwPaM*>(pRing) ),
59 if( nEndCnt == nSttCnt )
70 if( nEndCnt < nSttCnt )
72 std::swap(nSttCnt, nEndCnt);
78 const OUString sText( pTNd->
GetText().copy(nSttCnt, nEndCnt - nSttCnt));
81 const sal_Int32 nLen = sText.getLength();
115 sal_Int32 nLenghtOfOldString = nEndCnt - nSttCnt;
123 pTNd->
EraseText( rPtPos, nLenghtOfOldString );
136 case i18n::ScriptType::ASIAN:
138 case i18n::ScriptType::COMPLEX:
161 const OUString& rNewStr = rData.
GetText();
165 sal_Int32 nReplace = nEndCnt - nSttCnt;
166 const sal_Int32 nNewLen = rNewStr.getLength();
167 if( nNewLen < nReplace )
180 if( nOWLen < nReplace )
183 pTNd->
EraseText( aIdx, nReplace-nOWLen );
189 nReplace =
std::min(nOWLen, nNewLen);
200 if( nSttCnt < nEndCnt )
202 pTNd->
EraseText( aIdx, nEndCnt - nSttCnt );
244 nPos = std::max(nInPos, nBrkPos);
276 sal_Int32 nContentPos )
const
289 if( nStartNode <= nNdIdx && nNdIdx <= nEndNode &&
291 ( nStartCnt <= nContentPos && nContentPos <= nEndCnt )))
305 "more than one InputEngine available" );
const OUString & GetText() const
const ExtTextInputAttr * GetTextAttr() const
virtual bool Overwrite(const SwPaM &rRg, const OUString &rStr)=0
Overwrite string in an existing text node.
virtual bool GetIME() const =0
Did the last inserted string come from IME?
virtual void SetIME(bool bIME)=0
States that the last inserted string came from IME.
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
Marks a character position inside a document model content node (SwContentNode)
sal_Int32 GetIndex() const
const SwContentNode * GetContentNode() const
void DeleteExtTextInput(SwExtTextInput *pDel)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
SwExtTextInput * mpExtInputRing
SwExtTextInput * GetExtTextInput() const
SwExtTextInput * CreateExtTextInput(const SwPaM &rPam)
bool m_bIsOverwriteCursor
LanguageType m_eInputLanguage
void SetInputData(const CommandExtTextInputData &rData)
void SetOverwriteCursor(bool bFlag)
SwExtTextInput(const SwPaM &rPam, Ring *pRing)
OUString m_sOverwriteText
virtual ~SwExtTextInput() override
SwExtTextInput * GetNext()
std::vector< ExtTextInputAttr > m_aAttrs
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool IsMultiSelection() const
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
SwTextNode is a paragraph in the document model.
void EraseText(const SwContentIndex &rIdx, const sal_Int32 nCount=SAL_MAX_INT32, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
delete text content ATTENTION: must not be called with a range that overlaps the start of an attribut...
OUString InsertText(const OUString &rStr, const SwContentIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
void ReplaceText(const SwContentIndex &rStart, const sal_Int32 nDelLen, const OUString &rText)
replace nDelLen characters at rStart with rText in case the replacement does not fit,...
const OUString & GetText() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
#define CH_TXTATR_BREAKWORD
#define LANGUAGE_DONTKNOW
sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.