Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / editeng / editeng.hxx
blob85accc9d36e32748d1506096b8a504b562748d79
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_EDITENG_EDITENG_HXX
21 #define INCLUDED_EDITENG_EDITENG_HXX
23 #include <memory>
24 #include <vector>
26 #include <optional>
28 #include <com/sun/star/uno/Reference.h>
29 #include <com/sun/star/i18n/WordType.hpp>
30 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
32 #include <o3tl/span.hxx>
33 #include <svl/typedwhich.hxx>
34 #include <editeng/editdata.hxx>
35 #include <editeng/editstat.hxx>
36 #include <editeng/editobj.hxx>
37 #include <editeng/editengdllapi.h>
38 #include <i18nlangtag/lang.h>
40 #include <tools/lineend.hxx>
41 #include <tools/degree.hxx>
42 #include <tools/long.hxx>
43 #include <tools/fontenum.hxx>
44 #include <basegfx/tuple/b2dtuple.hxx>
46 #include <editeng/eedata.hxx>
47 #include <o3tl/typed_flags_set.hxx>
48 #include <svl/languageoptions.hxx>
49 #include <comphelper/errcode.hxx>
50 #include <functional>
52 template <typename Arg, typename Ret> class Link;
54 namespace com::sun::star {
55 namespace linguistic2 {
56 class XSpellChecker1;
57 class XHyphenator;
59 namespace datatransfer {
60 class XTransferable;
62 namespace lang {
63 struct Locale;
67 namespace svx {
68 struct SpellPortion;
69 typedef std::vector<SpellPortion> SpellPortions;
72 class SfxUndoManager;
73 namespace basegfx { class B2DPolyPolygon; }
74 namespace editeng {
75 struct MisspellRanges;
78 class ImpEditEngine;
79 class EditView;
80 class OutputDevice;
81 class SvxFont;
82 class SfxItemPool;
83 class SfxStyleSheet;
84 class SfxStyleSheetPool;
85 class SvxSearchItem;
86 class SvxFieldItem;
87 class MapMode;
88 class Color;
89 namespace vcl { class Font; }
90 class KeyEvent;
91 class Size;
92 class Point;
93 namespace tools { class Rectangle; }
94 class SvStream;
95 namespace vcl { class Window; }
96 class SvKeyValueIterator;
97 class SvxForbiddenCharactersTable;
98 class SvxNumberFormat;
99 class SvxFieldData;
100 class ContentNode;
101 class ParaPortion;
102 class EditSelection;
103 class EditPaM;
104 class EditLine;
105 class InternalEditStatus;
106 class EditSelectionEngine;
107 class EditDoc;
108 class Range;
109 struct EPaM;
110 class DeletedNodeInfo;
111 class ParaPortionList;
112 enum class CharCompressType;
113 enum class TransliterationFlags;
114 class LinkParamNone;
116 /** values for:
117 SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All );
119 enum class EditEngineAttribs {
120 All, /// returns all attributes even when they are not set
121 OnlyHard /// returns only attributes hard set on portions
124 /** values for:
125 SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags = 0xFF ) const;
127 enum class GetAttribsFlags
129 NONE = 0x00,
130 STYLESHEET = 0x01,
131 PARAATTRIBS = 0x02,
132 CHARATTRIBS = 0x04,
133 ALL = 0x07,
135 namespace o3tl
137 template<> struct typed_flags<GetAttribsFlags> : is_typed_flags<GetAttribsFlags, 0x07> {};
140 enum class SetAttribsMode {
141 NONE, WholeWord, Edge
144 class EDITENG_DLLPUBLIC EditEngine
146 friend class EditView;
147 friend class ImpEditView;
148 friend class Outliner;
149 friend class TextChainingUtils;
152 public:
153 typedef std::vector<EditView*> ViewsType;
155 EditSelection InsertText(
156 css::uno::Reference<css::datatransfer::XTransferable > const & rxDataObj,
157 const OUString& rBaseURL, const EditPaM& rPaM, bool bUseSpecial);
159 private:
160 std::unique_ptr<ImpEditEngine> pImpEditEngine;
162 EditEngine( const EditEngine& ) = delete;
163 EditEngine& operator=( const EditEngine& ) = delete;
164 EDITENG_DLLPRIVATE bool PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pView, vcl::Window const * pFrameWin );
166 EDITENG_DLLPRIVATE void CursorMoved(const ContentNode* pPrevNode);
167 EDITENG_DLLPRIVATE void CheckIdleFormatter();
168 EDITENG_DLLPRIVATE bool IsIdleFormatterActive() const;
169 EDITENG_DLLPRIVATE ParaPortion* FindParaPortion(ContentNode const * pNode);
170 EDITENG_DLLPRIVATE const ParaPortion* FindParaPortion(ContentNode const * pNode) const;
171 EDITENG_DLLPRIVATE const ParaPortion* GetPrevVisPortion(const ParaPortion* pCurPortion) const;
173 EDITENG_DLLPRIVATE css::uno::Reference<
174 css::datatransfer::XTransferable>
175 CreateTransferable(const EditSelection& rSelection);
177 EDITENG_DLLPRIVATE EditPaM EndOfWord(const EditPaM& rPaM);
179 EDITENG_DLLPRIVATE EditPaM GetPaM(const Point& aDocPos, bool bSmart = true);
181 EDITENG_DLLPRIVATE EditSelection SelectWord(
182 const EditSelection& rCurSelection,
183 sal_Int16 nWordType = css::i18n::WordType::ANYWORD_IGNOREWHITESPACES);
185 EDITENG_DLLPRIVATE tools::Long GetXPos(
186 const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart = false) const;
188 EDITENG_DLLPRIVATE Range GetLineXPosStartEnd(
189 const ParaPortion* pParaPortion, const EditLine* pLine) const;
191 EDITENG_DLLPRIVATE InternalEditStatus& GetInternalEditStatus();
193 EDITENG_DLLPRIVATE void HandleBeginPasteOrDrop(PasteOrDropInfos& rInfos);
194 EDITENG_DLLPRIVATE void HandleEndPasteOrDrop(PasteOrDropInfos& rInfos);
195 EDITENG_DLLPRIVATE bool HasText() const;
196 EDITENG_DLLPRIVATE const EditSelectionEngine& GetSelectionEngine() const;
197 EDITENG_DLLPRIVATE void SetInSelectionMode(bool b);
199 protected:
202 public:
203 EditEngine( SfxItemPool* pItemPool );
204 virtual ~EditEngine();
206 const SfxItemSet& GetEmptyItemSet() const;
208 void SetDefTab( sal_uInt16 nDefTab );
210 void SetRefDevice( OutputDevice* pRefDef );
211 OutputDevice* GetRefDevice() const;
213 void SetRefMapMode( const MapMode& rMapMode );
214 MapMode const & GetRefMapMode() const;
216 /// Change the update mode per bUpdate and potentially trigger FormatAndUpdate.
217 /// bRestoring is used for LOK to update cursor visibility, specifically,
218 /// when true, it means we are restoring the update mode after internally
219 /// disabling it (f.e. during SetText to set/delete default text in Impress).
220 /// @return previous value of update
221 bool SetUpdateLayout(bool bUpdate, bool bRestoring = false);
222 bool IsUpdateLayout() const;
224 void SetBackgroundColor( const Color& rColor );
225 Color const & GetBackgroundColor() const;
226 Color GetAutoColor() const;
227 void EnableAutoColor( bool b );
228 void ForceAutoColor( bool b );
229 bool IsForceAutoColor() const;
231 void InsertView(EditView* pEditView, size_t nIndex = EE_APPEND);
232 EditView* RemoveView( EditView* pEditView );
233 void RemoveView(size_t nIndex);
234 EditView* GetView(size_t nIndex = 0) const;
235 size_t GetViewCount() const;
236 bool HasView( EditView* pView ) const;
237 EditView* GetActiveView() const;
238 void SetActiveView(EditView* pView);
240 void SetPaperSize( const Size& rSize );
241 const Size& GetPaperSize() const;
243 void SetVertical( bool bVertical );
244 bool IsEffectivelyVertical() const;
245 bool IsTopToBottom() const;
246 bool GetVertical() const;
247 void SetRotation(TextRotation nRotation);
248 TextRotation GetRotation() const;
250 void SetTextColumns(sal_Int16 nColumns, sal_Int32 nSpacing);
252 void SetFixedCellHeight( bool bUseFixedCellHeight );
254 void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir );
255 EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const;
257 SvtScriptType GetScriptType( const ESelection& rSelection ) const;
258 editeng::LanguageSpan GetLanguage(const EditPaM& rPaM) const;
259 editeng::LanguageSpan GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const;
261 void TransliterateText( const ESelection& rSelection, TransliterationFlags nTransliterationMode );
262 EditSelection TransliterateText( const EditSelection& rSelection, TransliterationFlags nTransliterationMode );
264 void SetAsianCompressionMode( CharCompressType nCompression );
266 void SetKernAsianPunctuation( bool bEnabled );
268 void SetAddExtLeading( bool b );
270 void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon );
271 void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon);
272 void ClearPolygon();
274 const Size& GetMinAutoPaperSize() const;
275 void SetMinAutoPaperSize( const Size& rSz );
277 const Size& GetMaxAutoPaperSize() const;
278 void SetMaxAutoPaperSize( const Size& rSz );
280 void SetMinColumnWrapHeight(tools::Long nVal);
282 OUString GetText( LineEnd eEnd = LINEEND_LF ) const;
283 OUString GetText( const ESelection& rSelection ) const;
284 sal_Int32 GetTextLen() const;
285 sal_uInt32 GetTextHeight() const;
286 sal_uInt32 GetTextHeightNTP() const;
287 sal_uInt32 CalcTextWidth();
289 OUString GetText( sal_Int32 nParagraph ) const;
290 sal_Int32 GetTextLen( sal_Int32 nParagraph ) const;
291 sal_uInt32 GetTextHeight( sal_Int32 nParagraph ) const;
293 sal_Int32 GetParagraphCount() const;
295 sal_Int32 GetLineCount( sal_Int32 nParagraph ) const;
296 sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const;
297 void GetLineBoundaries( /*out*/sal_Int32& rStart, /*out*/sal_Int32& rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const;
298 sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const;
299 sal_uInt32 GetLineHeight( sal_Int32 nParagraph );
300 tools::Rectangle GetParaBounds( sal_Int32 nPara );
301 ParagraphInfos GetParagraphInfos( sal_Int32 nPara );
302 sal_Int32 FindParagraph( tools::Long nDocPosY );
303 EPosition FindDocPosition( const Point& rDocPos ) const;
304 tools::Rectangle GetCharacterBounds( const EPosition& rPos ) const;
306 OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex);
308 ESelection GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const;
310 void Clear();
311 void SetText( const OUString& rStr );
313 std::unique_ptr<EditTextObject> CreateTextObject();
314 std::unique_ptr<EditTextObject> GetEmptyTextObject() const;
315 std::unique_ptr<EditTextObject> CreateTextObject( sal_Int32 nPara, sal_Int32 nParas = 1 );
316 std::unique_ptr<EditTextObject> CreateTextObject( const ESelection& rESelection );
317 void SetText( const EditTextObject& rTextObject );
319 void RemoveParagraph(sal_Int32 nPara);
320 void InsertParagraph(sal_Int32 nPara, const EditTextObject& rTxtObj, const bool bAppend = false);
321 void InsertParagraph(sal_Int32 nPara, const OUString& rText);
323 void SetText(sal_Int32 nPara, const OUString& rText);
325 virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
326 const SfxItemSet& GetParaAttribs( sal_Int32 nPara ) const;
328 /// Set attributes from rSet an all characters of nPara.
329 void SetCharAttribs(sal_Int32 nPara, const SfxItemSet& rSet);
330 void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
332 SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags = GetAttribsFlags::ALL ) const;
333 SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All );
335 bool HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
336 const SfxPoolItem& GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
337 template<class T>
338 const T& GetParaAttrib( sal_Int32 nPara, TypedWhichId<T> nWhich ) const
340 return static_cast<const T&>(GetParaAttrib(nPara, sal_uInt16(nWhich)));
343 vcl::Font GetStandardFont( sal_Int32 nPara );
344 SvxFont GetStandardSvxFont( sal_Int32 nPara );
346 void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich );
348 void ShowParagraph( sal_Int32 nParagraph, bool bShow );
350 SfxUndoManager& GetUndoManager();
351 SfxUndoManager* SetUndoManager(SfxUndoManager* pNew);
352 void UndoActionStart( sal_uInt16 nId );
353 void UndoActionStart(sal_uInt16 nId, const ESelection& rSel);
354 void UndoActionEnd();
355 bool IsInUndo() const;
357 void EnableUndo( bool bEnable );
358 bool IsUndoEnabled() const;
360 /** returns the value last used for bTryMerge while calling ImpEditEngine::InsertUndo
361 This is currently used in a bad but needed hack to get undo actions merged in the
362 OutlineView in impress. Do not use it unless you want to sell your soul too! */
363 bool HasTriedMergeOnLastAddUndo() const;
365 void ClearModifyFlag();
366 void SetModified();
367 bool IsModified() const;
369 void SetModifyHdl( const Link<LinkParamNone*,void>& rLink );
370 Link<LinkParamNone*,void> const & GetModifyHdl() const;
372 bool IsInSelectionMode() const;
374 void StripPortions();
375 void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList );
377 tools::Long GetFirstLineStartX( sal_Int32 nParagraph );
378 Point GetDocPosTopLeft( sal_Int32 nParagraph );
379 Point GetDocPos( const Point& rPaperPos ) const;
380 bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder );
382 // StartDocPos corresponds to VisArea.TopLeft().
383 void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect );
384 void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos );
385 void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip );
386 void Draw( OutputDevice& rOutDev, const Point& rStartPos, Degree10 nOrientation = 0_deg10 );
388 ErrCode Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr );
389 void Write( SvStream& rOutput, EETextFormat );
391 void SetStatusEventHdl( const Link<EditStatus&,void>& rLink );
392 Link<EditStatus&,void> const & GetStatusEventHdl() const;
394 void SetNotifyHdl( const Link<EENotify&,void>& rLink );
395 Link<EENotify&,void> const & GetNotifyHdl() const;
397 void SetRtfImportHdl( const Link<RtfImportInfo&,void>& rLink );
398 const Link<RtfImportInfo&,void>& GetRtfImportHdl() const;
400 void SetHtmlImportHdl( const Link<HtmlImportInfo&,void>& rLink );
401 const Link<HtmlImportInfo&,void>& GetHtmlImportHdl() const;
403 // Do not evaluate font formatting => For Outliner
404 bool IsFlatMode() const;
405 void SetFlatMode( bool bFlat );
407 void SetSingleLine( bool bValue );
409 void SetControlWord( EEControlBits nWord );
410 EEControlBits GetControlWord() const;
412 void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
413 void QuickMarkInvalid( const ESelection& rSel );
414 void QuickFormatDoc( bool bFull = false );
415 void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
416 void QuickInsertLineBreak( const ESelection& rSel );
417 void QuickInsertText(const OUString& rText, const ESelection& rSel);
418 void QuickDelete( const ESelection& rSel );
419 void QuickMarkToBeRepainted( sal_Int32 nPara );
421 void setGlobalScale(double fFontScaleX, double fFontScaleY, double fSpacingScaleX, double fSpacingScaleY);
423 void getGlobalSpacingScale(double& rX, double& rY) const;
424 basegfx::B2DTuple getGlobalSpacingScale() const;
425 void getGlobalFontScale(double& rX, double& rY) const;
426 basegfx::B2DTuple getGlobalFontScale() const;
428 void setRoundFontSizeToPt(bool bRound) const;
430 void SetEditTextObjectPool( SfxItemPool* pPool );
431 SfxItemPool* GetEditTextObjectPool() const;
433 void SetStyleSheetPool( SfxStyleSheetPool* pSPool );
434 SfxStyleSheetPool* GetStyleSheetPool();
436 void SetStyleSheet(const EditSelection& aSel, SfxStyleSheet* pStyle);
437 void SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle );
438 const SfxStyleSheet* GetStyleSheet( sal_Int32 nPara ) const;
439 SfxStyleSheet* GetStyleSheet( sal_Int32 nPara );
441 void SetWordDelimiters( const OUString& rDelimiters );
442 const OUString& GetWordDelimiters() const;
444 void EraseVirtualDevice();
446 void SetSpeller( css::uno::Reference<
447 css::linguistic2::XSpellChecker1 > const &xSpeller );
448 css::uno::Reference<
449 css::linguistic2::XSpellChecker1 > const &
450 GetSpeller();
451 void SetHyphenator( css::uno::Reference<
452 css::linguistic2::XHyphenator > const & xHyph );
454 void GetAllMisspellRanges( std::vector<editeng::MisspellRanges>& rRanges ) const;
455 void SetAllMisspellRanges( const std::vector<editeng::MisspellRanges>& rRanges );
457 static void SetForbiddenCharsTable(const std::shared_ptr<SvxForbiddenCharactersTable>& xForbiddenChars);
459 void SetDefaultLanguage( LanguageType eLang );
460 LanguageType GetDefaultLanguage() const;
462 bool HasOnlineSpellErrors() const;
463 void CompleteOnlineSpelling();
465 bool ShouldCreateBigTextObject() const;
467 // For fast Pre-Test without view:
468 EESpellState HasSpellErrors();
469 void ClearSpellErrors();
470 bool HasText( const SvxSearchItem& rSearchItem );
472 //spell and return a sentence
473 bool SpellSentence(EditView const & rEditView, svx::SpellPortions& rToFill );
474 // put spell position to start of current sentence
475 void PutSpellingToSentenceStart( EditView const & rEditView );
476 //applies a changed sentence
477 void ApplyChangedSentence(EditView const & rEditView, const svx::SpellPortions& rNewPortions, bool bRecheck );
479 // for text conversion (see also HasSpellErrors)
480 bool HasConvertibleTextPortion( LanguageType nLang );
481 virtual bool ConvertNextDocument();
483 bool UpdateFields();
484 bool UpdateFieldsOnly();
485 void RemoveFields( const std::function<bool ( const SvxFieldData* )>& isFieldData = [] (const SvxFieldData* ){return true;} );
487 sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
488 EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
490 bool IsRightToLeft( sal_Int32 nPara ) const;
492 css::uno::Reference< css::datatransfer::XTransferable >
493 CreateTransferable( const ESelection& rSelection ) const;
495 // MT: Can't create new virtual functions like for ParagraphInserted/Deleted, must be compatible in SRC638, change later...
496 void SetBeginMovingParagraphsHdl( const Link<MoveParagraphsInfo&,void>& rLink );
497 void SetEndMovingParagraphsHdl( const Link<MoveParagraphsInfo&,void>& rLink );
498 void SetBeginPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
499 void SetEndPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
501 virtual void PaintingFirstLine(sal_Int32 nPara, const Point& rStartPos, const Point& rOrigin, Degree10 nOrientation, OutputDevice& rOutDev);
502 virtual void ParagraphInserted( sal_Int32 nNewParagraph );
503 virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
504 virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
505 virtual void ParaAttribsChanged( sal_Int32 nParagraph );
506 virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
507 void ParagraphHeightChanged( sal_Int32 nPara );
509 virtual void DrawingText( const Point& rStartPos, const OUString& rText,
510 sal_Int32 nTextStart, sal_Int32 nTextLen,
511 o3tl::span<const sal_Int32> pDXArray,
512 o3tl::span<const sal_Bool> pKashidaArray,
513 const SvxFont& rFont,
514 sal_Int32 nPara, sal_uInt8 nRightToLeft,
515 const EEngineData::WrongSpellVector* pWrongSpellVector,
516 const SvxFieldData* pFieldData,
517 bool bEndOfLine,
518 bool bEndOfParagraph,
519 const css::lang::Locale* pLocale,
520 const Color& rOverlineColor,
521 const Color& rTextLineColor);
523 virtual void DrawingTab( const Point& rStartPos, tools::Long nWidth, const OUString& rChar,
524 const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
525 bool bEndOfLine,
526 bool bEndOfParagraph,
527 const Color& rOverlineColor,
528 const Color& rTextLineColor);
529 virtual OUString GetUndoComment( sal_uInt16 nUndoId ) const;
530 virtual bool SpellNextDocument();
531 /** @return true, when click was consumed. false otherwise. */
532 virtual bool FieldClicked( const SvxFieldItem& rField );
533 virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rTxtColor, std::optional<Color>& rFldColor, std::optional<FontLineStyle>& rFldLineStyle );
535 // override this if access to bullet information needs to be provided
536 virtual const SvxNumberFormat * GetNumberFormat( sal_Int32 nPara ) const;
538 virtual tools::Rectangle GetBulletArea( sal_Int32 nPara );
540 static rtl::Reference<SfxItemPool> CreatePool();
541 static SfxItemPool& GetGlobalItemPool();
542 static bool DoesKeyChangeText( const KeyEvent& rKeyEvent );
543 static bool DoesKeyMoveCursor( const KeyEvent& rKeyEvent );
544 static bool IsSimpleCharInput( const KeyEvent& rKeyEvent );
545 static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const vcl::Font& rFont );
546 static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const SvxFont& rFont );
547 static vcl::Font CreateFontFromItemSet( const SfxItemSet& rItemSet, SvtScriptType nScriptType );
548 static SvxFont CreateSvxFontFromItemSet( const SfxItemSet& rItemSet );
549 static bool IsPrintable( sal_Unicode c ) { return ( ( c >= 32 ) && ( c != 127 ) ); }
550 static bool HasValidData( const css::uno::Reference< css::datatransfer::XTransferable >& rTransferable );
551 /** sets a link that is called at the beginning of a drag operation at an edit view */
552 void SetBeginDropHdl( const Link<EditView*,void>& rLink );
553 Link<EditView*,void> const & GetBeginDropHdl() const;
555 /** sets a link that is called at the end of a drag operation at an edit view */
556 void SetEndDropHdl( const Link<EditView*,void>& rLink );
557 Link<EditView*,void> const & GetEndDropHdl() const;
559 /// specifies if auto-correction should capitalize the first word or not (default is on)
560 void SetFirstWordCapitalization( bool bCapitalize );
562 /** specifies if auto-correction should replace a leading single quotation
563 mark (apostrophe) or not (default is on) */
564 void SetReplaceLeadingSingleQuotationMark( bool bReplace );
566 EditDoc& GetEditDoc();
567 const EditDoc& GetEditDoc() const;
568 void dumpAsXmlEditDoc(xmlTextWriterPtr pWriter) const;
570 ParaPortionList& GetParaPortions();
571 const ParaPortionList& GetParaPortions() const;
573 bool IsFormatted() const;
574 bool IsHtmlImportHandlerSet() const;
575 bool IsRtfImportHandlerSet() const;
576 bool IsImportRTFStyleSheetsSet() const;
578 void CallRtfImportHandler(RtfImportInfo& rInfo);
579 void CallHtmlImportHandler(HtmlImportInfo& rInfo);
581 void ParaAttribsToCharAttribs(ContentNode* pNode);
583 EditPaM CreateEditPaM(const EPaM& rEPaM);
584 EditPaM ConnectParagraphs(
585 ContentNode* pLeft, ContentNode* pRight, bool bBackward);
587 EditPaM InsertField(const EditSelection& rEditSelection, const SvxFieldItem& rFld);
588 EditPaM InsertText(const EditSelection& aCurEditSelection, const OUString& rStr);
589 EditSelection InsertText(const EditTextObject& rTextObject, const EditSelection& rSel);
590 EditPaM InsertParaBreak(const EditSelection& rEditSelection);
591 EditPaM InsertLineBreak(const EditSelection& rEditSelection);
593 EditPaM CursorLeft(
594 const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = css::i18n::CharacterIteratorMode::SKIPCELL);
595 EditPaM CursorRight(
596 const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = css::i18n::CharacterIteratorMode::SKIPCELL);
598 void SeekCursor(ContentNode* pNode, sal_Int32 nPos, SvxFont& rFont);
600 EditPaM DeleteSelection(const EditSelection& rSel);
602 ESelection CreateESelection(const EditSelection& rSel) const;
603 EditSelection CreateSelection(const ESelection& rSel);
605 const SfxItemSet& GetBaseParaAttribs(sal_Int32 nPara) const;
606 void SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet& rSet);
607 void SetAttribs(const EditSelection& rSel, const SfxItemSet& rSet, SetAttribsMode nSpecial = SetAttribsMode::NONE);
609 OUString GetSelected(const EditSelection& rSel) const;
610 EditPaM DeleteSelected(const EditSelection& rSel);
612 SvtScriptType GetScriptType(const EditSelection& rSel) const;
614 void RemoveParaPortion(sal_Int32 nNode);
616 void SetCallParaInsertedOrDeleted(bool b);
617 bool IsCallParaInsertedOrDeleted() const;
619 void AppendDeletedNodeInfo(DeletedNodeInfo* pInfo);
620 void UpdateSelections();
622 void InsertContent(ContentNode* pNode, sal_Int32 nPos);
623 EditPaM SplitContent(sal_Int32 nNode, sal_Int32 nSepPos);
624 EditPaM ConnectContents(sal_Int32 nLeftNode, bool bBackward);
626 void InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem);
628 EditSelection MoveParagraphs(const Range& rParagraphs, sal_Int32 nNewPos);
630 void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false);
631 void RemoveCharAttribs(const EditSelection& rSel, bool bRemoveParaAttribs, sal_uInt16 nWhich);
632 void RemoveCharAttribs(const EditSelection& rSel, EERemoveParaAttribsMode eMode, sal_uInt16 nWhich);
634 ViewsType& GetEditViews();
635 const ViewsType& GetEditViews() const;
637 void SetUndoMode(bool b);
638 void FormatAndLayout(EditView* pCurView, bool bCalledFromUndo = false);
640 void Undo(EditView* pView);
641 void Redo(EditView* pView);
643 sal_Int32 GetOverflowingParaNum() const;
644 sal_Int32 GetOverflowingLineNum() const;
645 void ClearOverflowingParaNum();
646 bool IsPageOverflow();
648 // tdf#132288 By default inserting an attribute beside another that is of
649 // the same type expands the original instead of inserting another. But the
650 // spell check dialog doesn't want that behaviour
651 void DisableAttributeExpanding();
653 // Optimization, if set, formatting will be done only for text lines that fit
654 // in given paper size and exceeding lines will be ignored.
655 void EnableSkipOutsideFormat(bool set);
657 void SetLOKSpecialPaperSize(const Size& rSize);
658 const Size& GetLOKSpecialPaperSize() const;
660 #ifdef DBG_UTIL
661 static void DumpData(const EditEngine* pEE, bool bInfoBox);
662 #endif
665 #endif // INCLUDED_EDITENG_EDITENG_HXX
667 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */