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;
122 pTNd->
EraseText( rIdx, nLenghtOfOldString );
135 case i18n::ScriptType::ASIAN:
137 case i18n::ScriptType::COMPLEX:
160 const OUString& rNewStr = rData.
GetText();
164 sal_Int32 nReplace = nEndCnt - nSttCnt;
165 const sal_Int32 nNewLen = rNewStr.getLength();
166 if( nNewLen < nReplace )
179 if( nOWLen < nReplace )
182 pTNd->
EraseText( aIdx, nReplace-nOWLen );
188 nReplace =
std::min(nOWLen, nNewLen);
199 if( nSttCnt < nEndCnt )
201 pTNd->
EraseText( aIdx, nEndCnt - nSttCnt );
243 nPos = std::max(nInPos, nBrkPos);
275 sal_Int32 nContentPos )
const
288 if( nStartNode <= nNdIdx && nNdIdx <= nEndNode &&
290 ( nStartCnt <= nContentPos && nContentPos <= nEndCnt )))
304 "more than one InputEngine available" );
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
bool IsMultiSelection() const
const OUString & GetText() const
virtual ~SwExtTextInput() override
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
const SwPosition * GetMark() const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
IDocumentUndoRedo & GetIDocumentUndoRedo()
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
OUString m_sOverwriteText
IDocumentContentOperations const & getIDocumentContentOperations() const
SwExtTextInput * GetExtTextInput() const
#define CH_TXTATR_BREAKWORD
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
SwNodeOffset GetIndex() const
virtual void SetIME(bool bIME)=0
States that the last inserted string came from IME.
sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
void SetOverwriteCursor(bool bFlag)
PaM is Point and Mark: a selection of the document model.
virtual bool GetIME() const =0
Did the last inserted string come from IME?
const OUString & GetText() const
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual bool Overwrite(const SwPaM &rRg, const OUString &rStr)=0
Overwrite string in an existing text node.
bool m_bIsOverwriteCursor
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
const SwPosition * GetPoint() const
SwExtTextInput * GetNext()
virtual bool DoesGroupUndo() const =0
Is Group Undo enabled?
SwNodeOffset GetIndex() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Marks a character position inside a document model node.
#define LANGUAGE_DONTKNOW
SwExtTextInput * CreateExtTextInput(const SwPaM &rPam)
const SwPosition * Start() const
virtual void DoGroupUndo(bool const bDoUndo)=0
Enable/Disable Group Undo.
void EraseText(const SwIndex &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 SwIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
virtual size_t GetUndoActionCount(const bool bCurrentLevel=true) const =0
Get the number of Undo actions.
SwTextNode is a paragraph in the document model.
LanguageType m_eInputLanguage
void ReplaceText(const SwIndex &rStart, const sal_Int32 nDelLen, const OUString &rText)
replace nDelLen characters at rStart with rText in case the replacement does not fit, it is partially inserted up to the capacity of the node
void DeleteExtTextInput(SwExtTextInput *pDel)
sal_Int32 GetIndex() const
const SwPosition * End() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
std::vector< ExtTextInputAttr > m_aAttrs
SwExtTextInput(const SwPaM &rPam, Ring *pRing)
void SetInputData(const CommandExtTextInputData &rData)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
SwExtTextInput * mpExtInputRing
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Base class of the Writer document model elements.
const ExtTextInputAttr * GetTextAttr() const