1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 // MyEDITENG, due to exported EditEng
20 #ifndef INCLUDED_EDITENG_EDITENG_HXX
21 #define INCLUDED_EDITENG_EDITENG_HXX
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 <svl/typedwhich.hxx>
33 #include <editeng/editdata.hxx>
34 #include <editeng/editstat.hxx>
35 #include <editeng/editobj.hxx>
36 #include <editeng/editengdllapi.h>
37 #include <i18nlangtag/lang.h>
39 #include <tools/lineend.hxx>
40 #include <tools/degree.hxx>
42 #include <editeng/eedata.hxx>
43 #include <o3tl/typed_flags_set.hxx>
44 #include <svl/languageoptions.hxx>
45 #include <vcl/errcode.hxx>
48 template <typename Arg
, typename Ret
> class Link
;
50 namespace com::sun::star
{
51 namespace linguistic2
{
55 namespace datatransfer
{
65 typedef std::vector
<SpellPortion
> SpellPortions
;
69 namespace basegfx
{ class B2DPolyPolygon
; }
71 struct MisspellRanges
;
80 class SfxStyleSheetPool
;
85 namespace vcl
{ class Font
; }
89 namespace tools
{ class Rectangle
; }
91 namespace vcl
{ class Window
; }
92 class SvKeyValueIterator
;
93 class SvxForbiddenCharactersTable
;
94 class SvxNumberFormat
;
101 class InternalEditStatus
;
102 class EditSelectionEngine
;
106 class DeletedNodeInfo
;
107 class ParaPortionList
;
108 enum class CharCompressType
;
109 enum class TransliterationFlags
;
113 SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All );
115 enum class EditEngineAttribs
{
116 All
, /// returns all attributes even when they are not set
117 OnlyHard
/// returns only attributes hard set on portions
121 SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags = 0xFF ) const;
123 enum class GetAttribsFlags
133 template<> struct typed_flags
<GetAttribsFlags
> : is_typed_flags
<GetAttribsFlags
, 0x07> {};
136 enum class SetAttribsMode
{
137 NONE
, WholeWord
, Edge
140 class EDITENG_DLLPUBLIC EditEngine
142 friend class EditView
;
143 friend class ImpEditView
;
144 friend class Outliner
;
145 friend class TextChainingUtils
;
149 typedef std::vector
<EditView
*> ViewsType
;
151 EditSelection
InsertText(
152 css::uno::Reference
<css::datatransfer::XTransferable
> const & rxDataObj
,
153 const OUString
& rBaseURL
, const EditPaM
& rPaM
, bool bUseSpecial
);
156 std::unique_ptr
<ImpEditEngine
> pImpEditEngine
;
158 EditEngine( const EditEngine
& ) = delete;
159 EditEngine
& operator=( const EditEngine
& ) = delete;
160 EDITENG_DLLPRIVATE
bool PostKeyEvent( const KeyEvent
& rKeyEvent
, EditView
* pView
, vcl::Window
const * pFrameWin
);
162 EDITENG_DLLPRIVATE
void CursorMoved(const ContentNode
* pPrevNode
);
163 EDITENG_DLLPRIVATE
void CheckIdleFormatter();
164 EDITENG_DLLPRIVATE
bool IsIdleFormatterActive() const;
165 EDITENG_DLLPRIVATE ParaPortion
* FindParaPortion(ContentNode
const * pNode
);
166 EDITENG_DLLPRIVATE
const ParaPortion
* FindParaPortion(ContentNode
const * pNode
) const;
167 EDITENG_DLLPRIVATE
const ParaPortion
* GetPrevVisPortion(const ParaPortion
* pCurPortion
) const;
169 EDITENG_DLLPRIVATE
css::uno::Reference
<
170 css::datatransfer::XTransferable
>
171 CreateTransferable(const EditSelection
& rSelection
);
173 EDITENG_DLLPRIVATE EditPaM
EndOfWord(const EditPaM
& rPaM
);
175 EDITENG_DLLPRIVATE EditPaM
GetPaM(const Point
& aDocPos
, bool bSmart
= true);
177 EDITENG_DLLPRIVATE EditSelection
SelectWord(
178 const EditSelection
& rCurSelection
,
179 sal_Int16 nWordType
= css::i18n::WordType::ANYWORD_IGNOREWHITESPACES
);
181 EDITENG_DLLPRIVATE
tools::Long
GetXPos(
182 const ParaPortion
* pParaPortion
, const EditLine
* pLine
, sal_Int32 nIndex
, bool bPreferPortionStart
= false) const;
184 EDITENG_DLLPRIVATE Range
GetLineXPosStartEnd(
185 const ParaPortion
* pParaPortion
, const EditLine
* pLine
) const;
187 EDITENG_DLLPRIVATE InternalEditStatus
& GetInternalEditStatus();
189 EDITENG_DLLPRIVATE
void HandleBeginPasteOrDrop(PasteOrDropInfos
& rInfos
);
190 EDITENG_DLLPRIVATE
void HandleEndPasteOrDrop(PasteOrDropInfos
& rInfos
);
191 EDITENG_DLLPRIVATE
bool HasText() const;
192 EDITENG_DLLPRIVATE
const EditSelectionEngine
& GetSelectionEngine() const;
193 EDITENG_DLLPRIVATE
void SetInSelectionMode(bool b
);
199 EditEngine( SfxItemPool
* pItemPool
);
200 virtual ~EditEngine();
202 const SfxItemSet
& GetEmptyItemSet() const;
204 void SetDefTab( sal_uInt16 nDefTab
);
206 void SetRefDevice( OutputDevice
* pRefDef
);
207 OutputDevice
* GetRefDevice() const;
209 void SetRefMapMode( const MapMode
& rMapMode
);
210 MapMode
const & GetRefMapMode() const;
212 /// Change the update mode per bUpdate and potentially trigger FormatAndUpdate.
213 /// bRestoring is used for LOK to update cursor visibility, specifically,
214 /// when true, it means we are restoring the update mode after internally
215 /// disabling it (f.e. during SetText to set/delete default text in Impress).
216 void SetUpdateMode(bool bUpdate
, bool bRestoring
= false);
217 bool GetUpdateMode() const;
219 void SetBackgroundColor( const Color
& rColor
);
220 Color
const & GetBackgroundColor() const;
221 Color
GetAutoColor() const;
222 void EnableAutoColor( bool b
);
223 void ForceAutoColor( bool b
);
224 bool IsForceAutoColor() const;
226 void InsertView(EditView
* pEditView
, size_t nIndex
= EE_APPEND
);
227 EditView
* RemoveView( EditView
* pEditView
);
228 void RemoveView(size_t nIndex
);
229 EditView
* GetView(size_t nIndex
= 0) const;
230 size_t GetViewCount() const;
231 bool HasView( EditView
* pView
) const;
232 EditView
* GetActiveView() const;
233 void SetActiveView(EditView
* pView
);
235 void SetPaperSize( const Size
& rSize
);
236 const Size
& GetPaperSize() const;
238 void SetVertical( bool bVertical
);
239 bool IsVertical() const;
240 bool IsTopToBottom() const;
241 bool GetDirectVertical() const;
242 void SetRotation(TextRotation nRotation
);
243 TextRotation
GetRotation() const;
245 void SetFixedCellHeight( bool bUseFixedCellHeight
);
247 void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir
);
248 EEHorizontalTextDirection
GetDefaultHorizontalTextDirection() const;
250 SvtScriptType
GetScriptType( const ESelection
& rSelection
) const;
251 LanguageType
GetLanguage(const EditPaM
& rPaM
) const;
252 LanguageType
GetLanguage( sal_Int32 nPara
, sal_Int32 nPos
) const;
254 void TransliterateText( const ESelection
& rSelection
, TransliterationFlags nTransliterationMode
);
255 EditSelection
TransliterateText( const EditSelection
& rSelection
, TransliterationFlags nTransliterationMode
);
257 void SetAsianCompressionMode( CharCompressType nCompression
);
259 void SetKernAsianPunctuation( bool bEnabled
);
261 void SetAddExtLeading( bool b
);
263 void SetPolygon( const basegfx::B2DPolyPolygon
& rPolyPolygon
);
264 void SetPolygon( const basegfx::B2DPolyPolygon
& rPolyPolygon
, const basegfx::B2DPolyPolygon
* pLinePolyPolygon
);
267 const Size
& GetMinAutoPaperSize() const;
268 void SetMinAutoPaperSize( const Size
& rSz
);
270 const Size
& GetMaxAutoPaperSize() const;
271 void SetMaxAutoPaperSize( const Size
& rSz
);
273 OUString
GetText( LineEnd eEnd
= LINEEND_LF
) const;
274 OUString
GetText( const ESelection
& rSelection
) const;
275 sal_uInt32
GetTextLen() const;
276 sal_uInt32
GetTextHeight() const;
277 sal_uInt32
GetTextHeightNTP() const;
278 sal_uInt32
CalcTextWidth();
280 OUString
GetText( sal_Int32 nParagraph
) const;
281 sal_Int32
GetTextLen( sal_Int32 nParagraph
) const;
282 sal_uInt32
GetTextHeight( sal_Int32 nParagraph
) const;
284 sal_Int32
GetParagraphCount() const;
286 sal_Int32
GetLineCount( sal_Int32 nParagraph
) const;
287 sal_Int32
GetLineLen( sal_Int32 nParagraph
, sal_Int32 nLine
) const;
288 void GetLineBoundaries( /*out*/sal_Int32
& rStart
, /*out*/sal_Int32
& rEnd
, sal_Int32 nParagraph
, sal_Int32 nLine
) const;
289 sal_Int32
GetLineNumberAtIndex( sal_Int32 nPara
, sal_Int32 nIndex
) const;
290 sal_uInt32
GetLineHeight( sal_Int32 nParagraph
);
291 tools::Rectangle
GetParaBounds( sal_Int32 nPara
);
292 ParagraphInfos
GetParagraphInfos( sal_Int32 nPara
);
293 sal_Int32
FindParagraph( tools::Long nDocPosY
);
294 EPosition
FindDocPosition( const Point
& rDocPos
) const;
295 tools::Rectangle
GetCharacterBounds( const EPosition
& rPos
) const;
297 OUString
GetWord(sal_Int32 nPara
, sal_Int32 nIndex
);
299 ESelection
GetWord( const ESelection
& rSelection
, sal_uInt16 nWordType
) const;
302 void SetText( const OUString
& rStr
);
304 std::unique_ptr
<EditTextObject
> CreateTextObject();
305 std::unique_ptr
<EditTextObject
> GetEmptyTextObject() const;
306 std::unique_ptr
<EditTextObject
> CreateTextObject( sal_Int32 nPara
, sal_Int32 nParas
= 1 );
307 std::unique_ptr
<EditTextObject
> CreateTextObject( const ESelection
& rESelection
);
308 void SetText( const EditTextObject
& rTextObject
);
310 void RemoveParagraph(sal_Int32 nPara
);
311 void InsertParagraph(sal_Int32 nPara
, const EditTextObject
& rTxtObj
, const bool bAppend
= false);
312 void InsertParagraph(sal_Int32 nPara
, const OUString
& rText
);
314 void SetText(sal_Int32 nPara
, const OUString
& rText
);
316 virtual void SetParaAttribs( sal_Int32 nPara
, const SfxItemSet
& rSet
);
317 const SfxItemSet
& GetParaAttribs( sal_Int32 nPara
) const;
319 /// Set attributes from rSet an all characters of nPara.
320 void SetCharAttribs(sal_Int32 nPara
, const SfxItemSet
& rSet
);
321 void GetCharAttribs( sal_Int32 nPara
, std::vector
<EECharAttrib
>& rLst
) const;
323 SfxItemSet
GetAttribs( sal_Int32 nPara
, sal_Int32 nStart
, sal_Int32 nEnd
, GetAttribsFlags nFlags
= GetAttribsFlags::ALL
) const;
324 SfxItemSet
GetAttribs( const ESelection
& rSel
, EditEngineAttribs nOnlyHardAttrib
= EditEngineAttribs::All
);
326 bool HasParaAttrib( sal_Int32 nPara
, sal_uInt16 nWhich
) const;
327 const SfxPoolItem
& GetParaAttrib( sal_Int32 nPara
, sal_uInt16 nWhich
);
329 const T
& GetParaAttrib( sal_Int32 nPara
, TypedWhichId
<T
> nWhich
)
331 return static_cast<const T
&>(GetParaAttrib(nPara
, sal_uInt16(nWhich
)));
334 vcl::Font
GetStandardFont( sal_Int32 nPara
);
335 SvxFont
GetStandardSvxFont( sal_Int32 nPara
);
337 void RemoveAttribs( const ESelection
& rSelection
, bool bRemoveParaAttribs
, sal_uInt16 nWhich
);
339 void ShowParagraph( sal_Int32 nParagraph
, bool bShow
);
341 SfxUndoManager
& GetUndoManager();
342 SfxUndoManager
* SetUndoManager(SfxUndoManager
* pNew
);
343 void UndoActionStart( sal_uInt16 nId
);
344 void UndoActionStart(sal_uInt16 nId
, const ESelection
& rSel
);
345 void UndoActionEnd();
346 bool IsInUndo() const;
348 void EnableUndo( bool bEnable
);
349 bool IsUndoEnabled() const;
351 /** returns the value last used for bTryMerge while calling ImpEditEngine::InsertUndo
352 This is currently used in a bad but needed hack to get undo actions merged in the
353 OutlineView in impress. Do not use it unless you want to sell your soul too! */
354 bool HasTriedMergeOnLastAddUndo() const;
356 void ClearModifyFlag();
358 bool IsModified() const;
360 void SetModifyHdl( const Link
<LinkParamNone
*,void>& rLink
);
361 Link
<LinkParamNone
*,void> const & GetModifyHdl() const;
363 bool IsInSelectionMode() const;
365 void StripPortions();
366 void GetPortions( sal_Int32 nPara
, std::vector
<sal_Int32
>& rList
);
368 tools::Long
GetFirstLineStartX( sal_Int32 nParagraph
);
369 Point
GetDocPosTopLeft( sal_Int32 nParagraph
);
370 Point
GetDocPos( const Point
& rPaperPos
) const;
371 bool IsTextPos( const Point
& rPaperPos
, sal_uInt16 nBorder
);
373 // StartDocPos corresponds to VisArea.TopLeft().
374 void Draw( OutputDevice
* pOutDev
, const tools::Rectangle
& rOutRect
);
375 void Draw( OutputDevice
* pOutDev
, const tools::Rectangle
& rOutRect
, const Point
& rStartDocPos
);
376 void Draw( OutputDevice
* pOutDev
, const tools::Rectangle
& rOutRect
, const Point
& rStartDocPos
, bool bClip
);
377 void Draw( OutputDevice
* pOutDev
, const Point
& rStartPos
, Degree10 nOrientation
= Degree10(0) );
379 ErrCode
Read( SvStream
& rInput
, const OUString
& rBaseURL
, EETextFormat
, SvKeyValueIterator
* pHTTPHeaderAttrs
= nullptr );
380 void Write( SvStream
& rOutput
, EETextFormat
);
382 void SetStatusEventHdl( const Link
<EditStatus
&,void>& rLink
);
383 Link
<EditStatus
&,void> const & GetStatusEventHdl() const;
385 void SetNotifyHdl( const Link
<EENotify
&,void>& rLink
);
386 Link
<EENotify
&,void> const & GetNotifyHdl() const;
388 void SetRtfImportHdl( const Link
<RtfImportInfo
&,void>& rLink
);
389 const Link
<RtfImportInfo
&,void>& GetRtfImportHdl() const;
391 void SetHtmlImportHdl( const Link
<HtmlImportInfo
&,void>& rLink
);
392 const Link
<HtmlImportInfo
&,void>& GetHtmlImportHdl() const;
394 // Do not evaluate font formatting => For Outliner
395 bool IsFlatMode() const;
396 void SetFlatMode( bool bFlat
);
398 void SetControlWord( EEControlBits nWord
);
399 EEControlBits
GetControlWord() const;
401 void QuickSetAttribs( const SfxItemSet
& rSet
, const ESelection
& rSel
);
402 void QuickMarkInvalid( const ESelection
& rSel
);
403 void QuickFormatDoc( bool bFull
= false );
404 void QuickInsertField( const SvxFieldItem
& rFld
, const ESelection
& rSel
);
405 void QuickInsertLineBreak( const ESelection
& rSel
);
406 void QuickInsertText(const OUString
& rText
, const ESelection
& rSel
);
407 void QuickDelete( const ESelection
& rSel
);
408 void QuickMarkToBeRepainted( sal_Int32 nPara
);
410 void SetGlobalCharStretching( sal_uInt16 nX
, sal_uInt16 nY
);
411 void GetGlobalCharStretching( sal_uInt16
& rX
, sal_uInt16
& rY
) const;
413 void SetEditTextObjectPool( SfxItemPool
* pPool
);
414 SfxItemPool
* GetEditTextObjectPool() const;
416 void SetStyleSheetPool( SfxStyleSheetPool
* pSPool
);
417 SfxStyleSheetPool
* GetStyleSheetPool();
419 void SetStyleSheet(const EditSelection
& aSel
, SfxStyleSheet
* pStyle
);
420 void SetStyleSheet( sal_Int32 nPara
, SfxStyleSheet
* pStyle
);
421 const SfxStyleSheet
* GetStyleSheet( sal_Int32 nPara
) const;
422 SfxStyleSheet
* GetStyleSheet( sal_Int32 nPara
);
424 void SetWordDelimiters( const OUString
& rDelimiters
);
425 const OUString
& GetWordDelimiters() const;
427 void EraseVirtualDevice();
429 void SetSpeller( css::uno::Reference
<
430 css::linguistic2::XSpellChecker1
> const &xSpeller
);
432 css::linguistic2::XSpellChecker1
> const &
434 void SetHyphenator( css::uno::Reference
<
435 css::linguistic2::XHyphenator
> const & xHyph
);
437 void GetAllMisspellRanges( std::vector
<editeng::MisspellRanges
>& rRanges
) const;
438 void SetAllMisspellRanges( const std::vector
<editeng::MisspellRanges
>& rRanges
);
440 static void SetForbiddenCharsTable(const std::shared_ptr
<SvxForbiddenCharactersTable
>& xForbiddenChars
);
442 void SetDefaultLanguage( LanguageType eLang
);
443 LanguageType
GetDefaultLanguage() const;
445 bool HasOnlineSpellErrors() const;
446 void CompleteOnlineSpelling();
448 bool ShouldCreateBigTextObject() const;
450 // For fast Pre-Test without view:
451 EESpellState
HasSpellErrors();
452 void ClearSpellErrors();
453 bool HasText( const SvxSearchItem
& rSearchItem
);
455 //spell and return a sentence
456 bool SpellSentence(EditView
const & rEditView
, svx::SpellPortions
& rToFill
);
457 // put spell position to start of current sentence
458 void PutSpellingToSentenceStart( EditView
const & rEditView
);
459 //applies a changed sentence
460 void ApplyChangedSentence(EditView
const & rEditView
, const svx::SpellPortions
& rNewPortions
, bool bRecheck
);
462 // for text conversion (see also HasSpellErrors)
463 bool HasConvertibleTextPortion( LanguageType nLang
);
464 virtual bool ConvertNextDocument();
467 bool UpdateFieldsOnly();
468 void RemoveFields( const std::function
<bool ( const SvxFieldData
* )>& isFieldData
= [] (const SvxFieldData
* ){return true;} );
470 sal_uInt16
GetFieldCount( sal_Int32 nPara
) const;
471 EFieldInfo
GetFieldInfo( sal_Int32 nPara
, sal_uInt16 nField
) const;
473 bool IsRightToLeft( sal_Int32 nPara
) const;
475 css::uno::Reference
< css::datatransfer::XTransferable
>
476 CreateTransferable( const ESelection
& rSelection
) const;
478 // MT: Can't create new virtual functions like for ParagraphInserted/Deleted, must be compatible in SRC638, change later...
479 void SetBeginMovingParagraphsHdl( const Link
<MoveParagraphsInfo
&,void>& rLink
);
480 void SetEndMovingParagraphsHdl( const Link
<MoveParagraphsInfo
&,void>& rLink
);
481 void SetBeginPasteOrDropHdl( const Link
<PasteOrDropInfos
&,void>& rLink
);
482 void SetEndPasteOrDropHdl( const Link
<PasteOrDropInfos
&,void>& rLink
);
484 virtual void PaintingFirstLine( sal_Int32 nPara
, const Point
& rStartPos
, tools::Long nBaseLineY
, const Point
& rOrigin
, Degree10 nOrientation
, OutputDevice
* pOutDev
);
485 virtual void ParagraphInserted( sal_Int32 nNewParagraph
);
486 virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph
);
487 virtual void ParagraphConnected( sal_Int32 nLeftParagraph
, sal_Int32 nRightParagraph
);
488 virtual void ParaAttribsChanged( sal_Int32 nParagraph
);
489 virtual void StyleSheetChanged( SfxStyleSheet
* pStyle
);
490 void ParagraphHeightChanged( sal_Int32 nPara
);
492 virtual void DrawingText( const Point
& rStartPos
, const OUString
& rText
,
493 sal_Int32 nTextStart
, sal_Int32 nTextLen
,
494 const tools::Long
* pDXArray
, const SvxFont
& rFont
,
495 sal_Int32 nPara
, sal_uInt8 nRightToLeft
,
496 const EEngineData::WrongSpellVector
* pWrongSpellVector
,
497 const SvxFieldData
* pFieldData
,
499 bool bEndOfParagraph
,
500 const css::lang::Locale
* pLocale
,
501 const Color
& rOverlineColor
,
502 const Color
& rTextLineColor
);
504 virtual void DrawingTab( const Point
& rStartPos
, tools::Long nWidth
, const OUString
& rChar
,
505 const SvxFont
& rFont
, sal_Int32 nPara
, sal_uInt8 nRightToLeft
,
507 bool bEndOfParagraph
,
508 const Color
& rOverlineColor
,
509 const Color
& rTextLineColor
);
510 virtual OUString
GetUndoComment( sal_uInt16 nUndoId
) const;
511 virtual bool SpellNextDocument();
512 virtual void FieldClicked( const SvxFieldItem
& rField
);
513 virtual OUString
CalcFieldValue( const SvxFieldItem
& rField
, sal_Int32 nPara
, sal_Int32 nPos
, std::optional
<Color
>& rTxtColor
, std::optional
<Color
>& rFldColor
);
515 // override this if access to bullet information needs to be provided
516 virtual const SvxNumberFormat
* GetNumberFormat( sal_Int32 nPara
) const;
518 virtual tools::Rectangle
GetBulletArea( sal_Int32 nPara
);
520 static SfxItemPool
* CreatePool();
521 static SfxItemPool
& GetGlobalItemPool();
522 static bool DoesKeyChangeText( const KeyEvent
& rKeyEvent
);
523 static bool DoesKeyMoveCursor( const KeyEvent
& rKeyEvent
);
524 static bool IsSimpleCharInput( const KeyEvent
& rKeyEvent
);
525 static void SetFontInfoInItemSet( SfxItemSet
& rItemSet
, const vcl::Font
& rFont
);
526 static void SetFontInfoInItemSet( SfxItemSet
& rItemSet
, const SvxFont
& rFont
);
527 static vcl::Font
CreateFontFromItemSet( const SfxItemSet
& rItemSet
, SvtScriptType nScriptType
);
528 static SvxFont
CreateSvxFontFromItemSet( const SfxItemSet
& rItemSet
);
529 static bool IsPrintable( sal_Unicode c
) { return ( ( c
>= 32 ) && ( c
!= 127 ) ); }
530 static bool HasValidData( const css::uno::Reference
< css::datatransfer::XTransferable
>& rTransferable
);
531 /** sets a link that is called at the beginning of a drag operation at an edit view */
532 void SetBeginDropHdl( const Link
<EditView
*,void>& rLink
);
533 Link
<EditView
*,void> const & GetBeginDropHdl() const;
535 /** sets a link that is called at the end of a drag operation at an edit view */
536 void SetEndDropHdl( const Link
<EditView
*,void>& rLink
);
537 Link
<EditView
*,void> const & GetEndDropHdl() const;
539 /// specifies if auto-correction should capitalize the first word or not (default is on)
540 void SetFirstWordCapitalization( bool bCapitalize
);
542 /** specifies if auto-correction should replace a leading single quotation
543 mark (apostrophe) or not (default is on) */
544 void SetReplaceLeadingSingleQuotationMark( bool bReplace
);
546 EditDoc
& GetEditDoc();
547 const EditDoc
& GetEditDoc() const;
548 void dumpAsXmlEditDoc(xmlTextWriterPtr pWriter
) const;
550 ParaPortionList
& GetParaPortions();
551 const ParaPortionList
& GetParaPortions() const;
553 bool IsFormatted() const;
554 bool IsHtmlImportHandlerSet() const;
555 bool IsRtfImportHandlerSet() const;
556 bool IsImportRTFStyleSheetsSet() const;
558 void CallRtfImportHandler(RtfImportInfo
& rInfo
);
559 void CallHtmlImportHandler(HtmlImportInfo
& rInfo
);
561 void ParaAttribsToCharAttribs(ContentNode
* pNode
);
563 EditPaM
CreateEditPaM(const EPaM
& rEPaM
);
564 EditPaM
ConnectParagraphs(
565 ContentNode
* pLeft
, ContentNode
* pRight
, bool bBackward
);
567 EditPaM
InsertField(const EditSelection
& rEditSelection
, const SvxFieldItem
& rFld
);
568 EditPaM
InsertText(const EditSelection
& aCurEditSelection
, const OUString
& rStr
);
569 EditSelection
InsertText(const EditTextObject
& rTextObject
, const EditSelection
& rSel
);
570 EditPaM
InsertParaBreak(const EditSelection
& rEditSelection
);
571 EditPaM
InsertLineBreak(const EditSelection
& rEditSelection
);
574 const EditPaM
& rPaM
, sal_uInt16 nCharacterIteratorMode
= css::i18n::CharacterIteratorMode::SKIPCELL
);
576 const EditPaM
& rPaM
, sal_uInt16 nCharacterIteratorMode
= css::i18n::CharacterIteratorMode::SKIPCELL
);
578 void SeekCursor(ContentNode
* pNode
, sal_Int32 nPos
, SvxFont
& rFont
);
580 EditPaM
DeleteSelection(const EditSelection
& rSel
);
582 ESelection
CreateESelection(const EditSelection
& rSel
);
583 EditSelection
CreateSelection(const ESelection
& rSel
);
585 const SfxItemSet
& GetBaseParaAttribs(sal_Int32 nPara
) const;
586 void SetParaAttribsOnly(sal_Int32 nPara
, const SfxItemSet
& rSet
);
587 void SetAttribs(const EditSelection
& rSel
, const SfxItemSet
& rSet
, SetAttribsMode nSpecial
= SetAttribsMode::NONE
);
589 OUString
GetSelected(const EditSelection
& rSel
) const;
590 EditPaM
DeleteSelected(const EditSelection
& rSel
);
592 SvtScriptType
GetScriptType(const EditSelection
& rSel
) const;
594 void RemoveParaPortion(sal_Int32 nNode
);
596 void SetCallParaInsertedOrDeleted(bool b
);
597 bool IsCallParaInsertedOrDeleted() const;
599 void AppendDeletedNodeInfo(DeletedNodeInfo
* pInfo
);
600 void UpdateSelections();
602 void InsertContent(ContentNode
* pNode
, sal_Int32 nPos
);
603 EditPaM
SplitContent(sal_Int32 nNode
, sal_Int32 nSepPos
);
604 EditPaM
ConnectContents(sal_Int32 nLeftNode
, bool bBackward
);
606 void InsertFeature(const EditSelection
& rEditSelection
, const SfxPoolItem
& rItem
);
608 EditSelection
MoveParagraphs(const Range
& rParagraphs
, sal_Int32 nNewPos
);
610 void RemoveCharAttribs(sal_Int32 nPara
, sal_uInt16 nWhich
= 0, bool bRemoveFeatures
= false);
611 void RemoveCharAttribs(const EditSelection
& rSel
, bool bRemoveParaAttribs
, sal_uInt16 nWhich
);
612 void RemoveCharAttribs(const EditSelection
& rSel
, EERemoveParaAttribsMode eMode
, sal_uInt16 nWhich
);
614 ViewsType
& GetEditViews();
615 const ViewsType
& GetEditViews() const;
617 void SetUndoMode(bool b
);
618 void FormatAndUpdate(EditView
* pCurView
, bool bCalledFromUndo
= false);
620 void Undo(EditView
* pView
);
621 void Redo(EditView
* pView
);
623 sal_Int32
GetOverflowingParaNum() const;
624 sal_Int32
GetOverflowingLineNum() const;
625 void ClearOverflowingParaNum();
626 bool IsPageOverflow();
628 // tdf#132288 By default inserting an attribute beside another that is of
629 // the same type expands the original instead of inserting another. But the
630 // spell check dialog doesn't want that behaviour
631 void DisableAttributeExpanding();
633 void SetLOKSpecialPaperSize(const Size
& rSize
);
634 const Size
& GetLOKSpecialPaperSize() const;
637 static void DumpData(const EditEngine
* pEE
, bool bInfoBox
);
641 #endif // INCLUDED_EDITENG_EDITENG_HXX
643 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */