19#ifndef INCLUDED_VCL_TEXTENG_HXX
20#define INCLUDED_VCL_TEXTENG_HXX
30#include <rtl/ustring.hxx>
39#include <com/sun/star/lang/Locale.hpp>
40#include <com/sun/star/uno/Reference.hxx>
62 class XExtendedInputSequenceChecker;
98 css::uno::Reference < css::i18n::XExtendedInputSequenceChecker >
mxISC;
126 void CursorMoved( sal_uInt32 nNode );
130 void ImpRemoveText();
136 void ImpRemoveChars(
const TextPaM& rPaM, sal_Int32 nChars );
137 TextPaM ImpConnectParagraphs( sal_uInt32 nLeft, sal_uInt32 nRight );
138 void ImpRemoveParagraph( sal_uInt32 nPara );
139 void ImpInitWritingDirections( sal_uInt32 nPara );
147 SAL_DLLPRIVATE css::uno::Reference< css::i18n::XExtendedInputSequenceChecker >
const & GetInputSequenceChecker();
151 void ImpParagraphInserted( sal_uInt32 nPara );
152 void ImpParagraphRemoved( sal_uInt32 nPara );
153 void ImpCharsRemoved( sal_uInt32 nPara, sal_Int32 nPos, sal_Int32 nChars );
154 void ImpCharsInserted( sal_uInt32 nPara, sal_Int32 nPos, sal_Int32 nChars );
157 void CheckIdleFormatter();
158 void IdleFormatAndUpdate(
TextView* pCurView, sal_uInt16 nMaxTimerRestarts = 5 );
160 bool CreateLines( sal_uInt32 nPara );
161 void CreateAndInsertEmptyLine( sal_uInt32 nPara );
162 void ImpBreakLine( sal_uInt32 nPara,
TextLine* pLine, sal_Int32 nPortionStart,
tools::Long nRemainingWidth );
163 std::size_t SplitTextPortion( sal_uInt32 nPara, sal_Int32 nPos );
164 void CreateTextPortions( sal_uInt32 nPara, sal_Int32 nStartPos );
165 void RecalcTextPortion( sal_uInt32 nPara, sal_Int32 nStartPos, sal_Int32 nNewChars );
169 void FormatFullDoc();
170 void FormatAndUpdate(
TextView* pCurView =
nullptr );
172 void UpdateViews(
TextView* pCurView =
nullptr );
178 sal_Int32 GetCharPos( sal_uInt32 nPara, std::vector<TextLine>::size_type nLine,
tools::Long nDocPosX );
180 sal_Int32 ImpFindIndex( sal_uInt32 nPortion,
const Point& rPosInPara );
181 tools::Long ImpGetPortionXOffset( sal_uInt32 nPara,
TextLine const * pLine, std::size_t nTextPortion );
182 tools::Long ImpGetXPos( sal_uInt32 nPara,
TextLine* pLine, sal_Int32 nIndex,
bool bPreferPortionStart =
false );
183 tools::Long ImpGetOutputOffset( sal_uInt32 nPara,
TextLine* pLine, sal_Int32 nIndex, sal_Int32 nIndex2 );
184 bool ImpGetRightToLeft( sal_uInt32 nPara, sal_Int32 nPos );
189 tools::Long CalcParaHeight( sal_uInt32 nParagraph )
const;
191 tools::Long CalcTextWidth( sal_uInt32 nPara, sal_Int32 nPortionStart, sal_Int32 nPortionLen);
192 Range GetInvalidYOffsets( sal_uInt32 nPortion );
195 void InsertContent( std::unique_ptr<TextNode> pNode, sal_uInt32 nPara );
196 TextPaM SplitContent( sal_uInt32 nNode, sal_Int32 nSepPos );
197 TextPaM ConnectContents( sal_uInt32 nLeftNode );
201 void ValidatePaM(
TextPaM& rPaM )
const;
209 void SetText(
const OUString& rStr );
210 OUString GetText(
LineEnd aSeparator = LINEEND_LF )
const;
212 OUString GetTextLines(
LineEnd aSeparator = LINEEND_LF )
const;
213 void ReplaceText(
const TextSelection& rSel,
const OUString& rText);
215 sal_Int32 GetTextLen()
const;
221 void SetLeftMargin( sal_uInt16 n );
223 void SetUpdateMode(
bool bUpdate );
226 sal_uInt16 GetViewCount()
const;
228 void InsertView(
TextView* pTextView );
229 void RemoveView(
TextView* pTextView );
231 void SetActiveView(
TextView* pView );
233 void SetMaxTextLen( sal_Int32 nLen );
243 sal_uInt32 GetParagraphCount()
const;
244 OUString GetText( sal_uInt32 nParagraph )
const;
245 sal_Int32 GetTextLen( sal_uInt32 nParagraph )
const;
246 tools::Long GetTextHeight( sal_uInt32 nParagraph )
const;
248 void GetTextPortionRange(
const TextPaM& rPaM, sal_Int32& nStart, sal_Int32& nEnd);
250 sal_uInt16 GetLineCount( sal_uInt32 nParagraph )
const;
251 sal_Int32 GetLineLen( sal_uInt32 nParagraph, sal_uInt16 nLine )
const;
253 void SetRightToLeft(
bool bR2L );
258 void UndoActionStart( sal_uInt16 nId = 0 );
259 void UndoActionEnd();
260 void InsertUndo( std::unique_ptr<TextUndo> pUndo,
bool bTryMerge =
false );
265 void EnableUndo(
bool bEnable );
282 void RemoveAttribs( sal_uInt32 nPara );
283 void SetAttrib(
const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32 nStart, sal_Int32 nEnd );
286 void SetTextAlign(
TxtAlign eAlign );
290 void SetLocale(
const css::lang::Locale& rLocale );
291 css::lang::Locale
const & GetLocale();
292 css::uno::Reference< css::i18n::XBreakIterator >
const & GetBreakIterator();
294 static bool DoesKeyChangeText(
const KeyEvent& rKeyEvent );
295 static bool IsSimpleCharInput(
const KeyEvent& rKeyEvent );
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
std::unique_ptr< TextDoc > mpDoc
bool GetUpdateMode() const
DECL_DLLPRIVATE_LINK(IdleFormatHdl, Timer *, void)
css::lang::Locale maLocale
TextView * GetActiveView() const
css::uno::Reference< css::i18n::XExtendedInputSequenceChecker > mxISC
bool HasUndoManager() const
std::unique_ptr< TextViews > mpViews
tools::Rectangle maInvalidRect
void SetIsInUndo(bool bInUndo)
void SetModified(bool bModified)
tools::Long mnCurTextWidth
VclPtr< OutputDevice > mpRefDev
tools::Long mnCurTextHeight
tools::Long GetMaxTextWidth() const
std::unique_ptr< LocaleDataWrapper > mpLocaleDataWrapper
std::unique_ptr< TEParaPortions > mpTEParaPortions
sal_Int32 GetMaxTextLen() const
bool IsRightToLeft() const
TxtAlign GetTextAlign() const
bool IsUndoEnabled() const
std::unique_ptr< TEIMEInfos > mpIMEInfos
tools::Long GetCharHeight() const
const Color & GetTextColor() const
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator
TextEngine & operator=(const TextEngine &)=delete
const vcl::Font & GetFont() const
tools::Long mnMaxTextWidth
std::unique_ptr< TextUndoManager > mpUndoManager
std::unique_ptr< IdleFormatter > mpIdleFormatter
TextEngine(const TextEngine &)=delete
bool IsFormatting() const
TextView * GetView() const
virtual OUString GetWord() override
virtual void SetText(const OUString &rStr) override
std::vector< TextView * > TextViews