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
25 #include <com/sun/star/uno/Reference.h>
26 #include <com/sun/star/i18n/WordType.hpp>
27 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
29 #include <svl/typedwhich.hxx>
30 #include <editeng/editdata.hxx>
31 #include <editeng/editstat.hxx>
32 #include <editeng/editobj.hxx>
33 #include <editeng/editengdllapi.h>
34 #include <i18nlangtag/lang.h>
36 #include <tools/lineend.hxx>
38 #include <editeng/eedata.hxx>
39 #include <o3tl/typed_flags_set.hxx>
40 #include <svl/languageoptions.hxx>
41 #include <vcl/errcode.hxx>
44 namespace boost
{ template <class T
> class optional
; }
45 template <typename Arg
, typename Ret
> class Link
;
47 namespace com
{ namespace sun
{ namespace star
{
48 namespace linguistic2
{
52 namespace datatransfer
{
62 typedef std::vector
<SpellPortion
> SpellPortions
;
66 namespace basegfx
{ class B2DPolyPolygon
; }
68 struct MisspellRanges
;
77 class SfxStyleSheetPool
;
82 namespace vcl
{ class Font
; }
86 namespace tools
{ class Rectangle
; }
88 namespace vcl
{ class Window
; }
89 class SvKeyValueIterator
;
90 class SvxForbiddenCharactersTable
;
91 class SvxNumberFormat
;
98 class InternalEditStatus
;
99 class EditSelectionEngine
;
103 class DeletedNodeInfo
;
104 class ParaPortionList
;
105 enum class CharCompressType
;
106 enum class TransliterationFlags
;
110 SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All );
112 enum class EditEngineAttribs
{
113 All
, /// returns all attributes even when they are not set
114 OnlyHard
/// returns only attributes hard set on portions
118 SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags = 0xFF ) const;
120 enum class GetAttribsFlags
130 template<> struct typed_flags
<GetAttribsFlags
> : is_typed_flags
<GetAttribsFlags
, 0x07> {};
132 template<class T
> bool checkSvxFieldData(const SvxFieldData
* pData
)
134 return dynamic_cast<const T
*>(pData
) != nullptr;
137 enum class SetAttribsMode
{
138 NONE
, WholeWord
, Edge
141 class EDITENG_DLLPUBLIC EditEngine
143 friend class EditView
;
144 friend class ImpEditView
;
145 friend class EditDbg
;
146 friend class Outliner
;
147 friend class TextChainingUtils
;
151 typedef std::vector
<EditView
*> ViewsType
;
153 EditSelection
InsertText(
154 css::uno::Reference
<css::datatransfer::XTransferable
> const & rxDataObj
,
155 const OUString
& rBaseURL
, const EditPaM
& rPaM
, bool bUseSpecial
);
158 std::unique_ptr
<ImpEditEngine
> pImpEditEngine
;
160 EditEngine( const EditEngine
& ) = delete;
161 EditEngine
& operator=( const EditEngine
& ) = delete;
162 EDITENG_DLLPRIVATE
bool PostKeyEvent( const KeyEvent
& rKeyEvent
, EditView
* pView
, vcl::Window
const * pFrameWin
);
164 EDITENG_DLLPRIVATE
void CursorMoved(const ContentNode
* pPrevNode
);
165 EDITENG_DLLPRIVATE
void CheckIdleFormatter();
166 EDITENG_DLLPRIVATE
bool IsIdleFormatterActive() const;
167 EDITENG_DLLPRIVATE ParaPortion
* FindParaPortion(ContentNode
const * pNode
);
168 EDITENG_DLLPRIVATE
const ParaPortion
* FindParaPortion(ContentNode
const * pNode
) const;
169 EDITENG_DLLPRIVATE
const ParaPortion
* GetPrevVisPortion(const ParaPortion
* pCurPortion
) const;
171 EDITENG_DLLPRIVATE
css::uno::Reference
<
172 css::datatransfer::XTransferable
>
173 CreateTransferable(const EditSelection
& rSelection
);
175 EDITENG_DLLPRIVATE EditPaM
EndOfWord(const EditPaM
& rPaM
);
177 EDITENG_DLLPRIVATE EditPaM
GetPaM(const Point
& aDocPos
, bool bSmart
= true);
179 EDITENG_DLLPRIVATE EditSelection
SelectWord(
180 const EditSelection
& rCurSelection
,
181 sal_Int16 nWordType
= css::i18n::WordType::ANYWORD_IGNOREWHITESPACES
);
183 EDITENG_DLLPRIVATE
long GetXPos(
184 const ParaPortion
* pParaPortion
, const EditLine
* pLine
, sal_Int32 nIndex
, bool bPreferPortionStart
= false) const;
186 EDITENG_DLLPRIVATE Range
GetLineXPosStartEnd(
187 const ParaPortion
* pParaPortion
, const EditLine
* pLine
) const;
189 EDITENG_DLLPRIVATE InternalEditStatus
& GetInternalEditStatus();
191 EDITENG_DLLPRIVATE
void HandleBeginPasteOrDrop(PasteOrDropInfos
& rInfos
);
192 EDITENG_DLLPRIVATE
void HandleEndPasteOrDrop(PasteOrDropInfos
& rInfos
);
193 EDITENG_DLLPRIVATE
bool HasText() const;
194 EDITENG_DLLPRIVATE
const EditSelectionEngine
& GetSelectionEngine() const;
195 EDITENG_DLLPRIVATE
void SetInSelectionMode(bool b
);
201 EditEngine( SfxItemPool
* pItemPool
);
202 virtual ~EditEngine();
204 const SfxItemSet
& GetEmptyItemSet();
206 void SetDefTab( sal_uInt16 nDefTab
);
208 void SetRefDevice( OutputDevice
* pRefDef
);
209 OutputDevice
* GetRefDevice() const;
211 void SetRefMapMode( const MapMode
& rMapMode
);
212 MapMode
const & GetRefMapMode();
214 void SetUpdateMode( bool bUpdate
);
215 bool GetUpdateMode() const;
217 void SetBackgroundColor( const Color
& rColor
);
218 Color
const & GetBackgroundColor() const;
219 Color
GetAutoColor() const;
220 void EnableAutoColor( bool b
);
221 void ForceAutoColor( bool b
);
222 bool IsForceAutoColor() const;
224 void InsertView(EditView
* pEditView
, size_t nIndex
= EE_APPEND
);
225 EditView
* RemoveView( EditView
* pEditView
);
226 void RemoveView(size_t nIndex
);
227 EditView
* GetView(size_t nIndex
= 0) const;
228 size_t GetViewCount() const;
229 bool HasView( EditView
* pView
) const;
230 EditView
* GetActiveView() const;
231 void SetActiveView(EditView
* pView
);
233 void SetPaperSize( const Size
& rSize
);
234 const Size
& GetPaperSize() const;
236 void SetVertical( bool bVertical
, bool bTopToBottom
= true );
237 bool IsVertical() const;
238 bool IsTopToBottom() const;
240 void SetFixedCellHeight( bool bUseFixedCellHeight
);
242 void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir
);
243 EEHorizontalTextDirection
GetDefaultHorizontalTextDirection() const;
245 SvtScriptType
GetScriptType( const ESelection
& rSelection
) const;
246 LanguageType
GetLanguage(const EditPaM
& rPaM
) const;
247 LanguageType
GetLanguage( sal_Int32 nPara
, sal_Int32 nPos
) const;
249 void TransliterateText( const ESelection
& rSelection
, TransliterationFlags nTransliterationMode
);
250 EditSelection
TransliterateText( const EditSelection
& rSelection
, TransliterationFlags nTransliterationMode
);
252 void SetAsianCompressionMode( CharCompressType nCompression
);
254 void SetKernAsianPunctuation( bool bEnabled
);
256 void SetAddExtLeading( bool b
);
258 void SetPolygon( const basegfx::B2DPolyPolygon
& rPolyPolygon
);
259 void SetPolygon( const basegfx::B2DPolyPolygon
& rPolyPolygon
, const basegfx::B2DPolyPolygon
* pLinePolyPolygon
);
262 const Size
& GetMinAutoPaperSize() const;
263 void SetMinAutoPaperSize( const Size
& rSz
);
265 const Size
& GetMaxAutoPaperSize() const;
266 void SetMaxAutoPaperSize( const Size
& rSz
);
268 OUString
GetText( LineEnd eEnd
= LINEEND_LF
) const;
269 OUString
GetText( const ESelection
& rSelection
) const;
270 sal_uInt32
GetTextLen() const;
271 sal_uInt32
GetTextHeight() const;
272 sal_uInt32
GetTextHeightNTP() const;
273 sal_uInt32
CalcTextWidth();
275 OUString
GetText( sal_Int32 nParagraph
) const;
276 sal_Int32
GetTextLen( sal_Int32 nParagraph
) const;
277 sal_uInt32
GetTextHeight( sal_Int32 nParagraph
) const;
279 sal_Int32
GetParagraphCount() const;
281 sal_Int32
GetLineCount( sal_Int32 nParagraph
) const;
282 sal_Int32
GetLineLen( sal_Int32 nParagraph
, sal_Int32 nLine
) const;
283 void GetLineBoundaries( /*out*/sal_Int32
& rStart
, /*out*/sal_Int32
& rEnd
, sal_Int32 nParagraph
, sal_Int32 nLine
) const;
284 sal_Int32
GetLineNumberAtIndex( sal_Int32 nPara
, sal_Int32 nIndex
) const;
285 sal_uInt32
GetLineHeight( sal_Int32 nParagraph
);
286 tools::Rectangle
GetParaBounds( sal_Int32 nPara
);
287 ParagraphInfos
GetParagraphInfos( sal_Int32 nPara
);
288 sal_Int32
FindParagraph( long nDocPosY
);
289 EPosition
FindDocPosition( const Point
& rDocPos
) const;
290 tools::Rectangle
GetCharacterBounds( const EPosition
& rPos
) const;
292 OUString
GetWord(sal_Int32 nPara
, sal_Int32 nIndex
);
294 ESelection
GetWord( const ESelection
& rSelection
, sal_uInt16 nWordType
) const;
297 void SetText( const OUString
& rStr
);
299 std::unique_ptr
<EditTextObject
> CreateTextObject();
300 std::unique_ptr
<EditTextObject
> GetEmptyTextObject() const;
301 std::unique_ptr
<EditTextObject
> CreateTextObject( sal_Int32 nPara
, sal_Int32 nParas
= 1 );
302 std::unique_ptr
<EditTextObject
> CreateTextObject( const ESelection
& rESelection
);
303 void SetText( const EditTextObject
& rTextObject
);
305 void RemoveParagraph(sal_Int32 nPara
);
306 void InsertParagraph(sal_Int32 nPara
, const EditTextObject
& rTxtObj
);
307 void InsertParagraph(sal_Int32 nPara
, const OUString
& rText
);
309 void SetText(sal_Int32 nPara
, const OUString
& rText
);
311 virtual void SetParaAttribs( sal_Int32 nPara
, const SfxItemSet
& rSet
);
312 const SfxItemSet
& GetParaAttribs( sal_Int32 nPara
) const;
314 /// Set attributes from rSet an all characters of nPara.
315 void SetCharAttribs(sal_Int32 nPara
, const SfxItemSet
& rSet
);
316 void GetCharAttribs( sal_Int32 nPara
, std::vector
<EECharAttrib
>& rLst
) const;
318 SfxItemSet
GetAttribs( sal_Int32 nPara
, sal_Int32 nStart
, sal_Int32 nEnd
, GetAttribsFlags nFlags
= GetAttribsFlags::ALL
) const;
319 SfxItemSet
GetAttribs( const ESelection
& rSel
, EditEngineAttribs nOnlyHardAttrib
= EditEngineAttribs::All
);
321 bool HasParaAttrib( sal_Int32 nPara
, sal_uInt16 nWhich
) const;
322 const SfxPoolItem
& GetParaAttrib( sal_Int32 nPara
, sal_uInt16 nWhich
);
324 const T
& GetParaAttrib( sal_Int32 nPara
, TypedWhichId
<T
> nWhich
)
326 return static_cast<const T
&>(GetParaAttrib(nPara
, sal_uInt16(nWhich
)));
329 vcl::Font
GetStandardFont( sal_Int32 nPara
);
330 SvxFont
GetStandardSvxFont( sal_Int32 nPara
);
332 void RemoveAttribs( const ESelection
& rSelection
, bool bRemoveParaAttribs
, sal_uInt16 nWhich
);
334 void ShowParagraph( sal_Int32 nParagraph
, bool bShow
);
336 SfxUndoManager
& GetUndoManager();
337 SfxUndoManager
* SetUndoManager(SfxUndoManager
* pNew
);
338 void UndoActionStart( sal_uInt16 nId
);
339 void UndoActionStart(sal_uInt16 nId
, const ESelection
& rSel
);
340 void UndoActionEnd();
343 void EnableUndo( bool bEnable
);
344 bool IsUndoEnabled();
346 /** returns the value last used for bTryMerge while calling ImpEditEngine::InsertUndo
347 This is currently used in a bad but needed hack to get undo actions merged in the
348 OutlineView in impress. Do not use it unless you want to sell your soul too! */
349 bool HasTriedMergeOnLastAddUndo() const;
351 void ClearModifyFlag();
353 bool IsModified() const;
355 void SetModifyHdl( const Link
<LinkParamNone
*,void>& rLink
);
356 Link
<LinkParamNone
*,void> const & GetModifyHdl() const;
358 bool IsInSelectionMode() const;
360 void StripPortions();
361 void GetPortions( sal_Int32 nPara
, std::vector
<sal_Int32
>& rList
);
363 long GetFirstLineStartX( sal_Int32 nParagraph
);
364 Point
GetDocPosTopLeft( sal_Int32 nParagraph
);
365 Point
GetDocPos( const Point
& rPaperPos
) const;
366 bool IsTextPos( const Point
& rPaperPos
, sal_uInt16 nBorder
);
368 // StartDocPos corresponds to VisArea.TopLeft().
369 void Draw( OutputDevice
* pOutDev
, const tools::Rectangle
& rOutRect
);
370 void Draw( OutputDevice
* pOutDev
, const tools::Rectangle
& rOutRect
, const Point
& rStartDocPos
);
371 void Draw( OutputDevice
* pOutDev
, const tools::Rectangle
& rOutRect
, const Point
& rStartDocPos
, bool bClip
);
372 void Draw( OutputDevice
* pOutDev
, const Point
& rStartPos
, short nOrientation
= 0 );
374 ErrCode
Read( SvStream
& rInput
, const OUString
& rBaseURL
, EETextFormat
, SvKeyValueIterator
* pHTTPHeaderAttrs
= nullptr );
375 void Write( SvStream
& rOutput
, EETextFormat
);
377 void SetStatusEventHdl( const Link
<EditStatus
&,void>& rLink
);
378 Link
<EditStatus
&,void> const & GetStatusEventHdl() const;
380 void SetNotifyHdl( const Link
<EENotify
&,void>& rLink
);
381 Link
<EENotify
&,void> const & GetNotifyHdl() const;
383 void SetRtfImportHdl( const Link
<RtfImportInfo
&,void>& rLink
);
384 const Link
<RtfImportInfo
&,void>& GetRtfImportHdl() const;
386 void SetHtmlImportHdl( const Link
<HtmlImportInfo
&,void>& rLink
);
387 const Link
<HtmlImportInfo
&,void>& GetHtmlImportHdl() const;
389 // Do not evaluate font formatting => For Outliner
390 bool IsFlatMode() const;
391 void SetFlatMode( bool bFlat
);
393 void SetControlWord( EEControlBits nWord
);
394 EEControlBits
GetControlWord() const;
396 void QuickSetAttribs( const SfxItemSet
& rSet
, const ESelection
& rSel
);
397 void QuickMarkInvalid( const ESelection
& rSel
);
398 void QuickFormatDoc( bool bFull
= false );
399 void QuickInsertField( const SvxFieldItem
& rFld
, const ESelection
& rSel
);
400 void QuickInsertLineBreak( const ESelection
& rSel
);
401 void QuickInsertText(const OUString
& rText
, const ESelection
& rSel
);
402 void QuickDelete( const ESelection
& rSel
);
403 void QuickMarkToBeRepainted( sal_Int32 nPara
);
405 void SetGlobalCharStretching( sal_uInt16 nX
, sal_uInt16 nY
);
406 void GetGlobalCharStretching( sal_uInt16
& rX
, sal_uInt16
& rY
) const;
408 void SetEditTextObjectPool( SfxItemPool
* pPool
);
409 SfxItemPool
* GetEditTextObjectPool() const;
411 void SetStyleSheetPool( SfxStyleSheetPool
* pSPool
);
412 SfxStyleSheetPool
* GetStyleSheetPool();
414 void SetStyleSheet(const EditSelection
& aSel
, SfxStyleSheet
* pStyle
);
415 void SetStyleSheet( sal_Int32 nPara
, SfxStyleSheet
* pStyle
);
416 const SfxStyleSheet
* GetStyleSheet( sal_Int32 nPara
) const;
417 SfxStyleSheet
* GetStyleSheet( sal_Int32 nPara
);
419 void SetWordDelimiters( const OUString
& rDelimiters
);
420 const OUString
& GetWordDelimiters() const;
422 void EraseVirtualDevice();
424 void SetSpeller( css::uno::Reference
<
425 css::linguistic2::XSpellChecker1
> const &xSpeller
);
427 css::linguistic2::XSpellChecker1
> const &
429 void SetHyphenator( css::uno::Reference
<
430 css::linguistic2::XHyphenator
> const & xHyph
);
432 void GetAllMisspellRanges( std::vector
<editeng::MisspellRanges
>& rRanges
) const;
433 void SetAllMisspellRanges( const std::vector
<editeng::MisspellRanges
>& rRanges
);
435 static void SetForbiddenCharsTable(const std::shared_ptr
<SvxForbiddenCharactersTable
>& xForbiddenChars
);
437 void SetDefaultLanguage( LanguageType eLang
);
438 LanguageType
GetDefaultLanguage() const;
440 bool HasOnlineSpellErrors() const;
441 void CompleteOnlineSpelling();
443 bool ShouldCreateBigTextObject() const;
445 // For fast Pre-Test without view:
446 EESpellState
HasSpellErrors();
447 void ClearSpellErrors();
448 bool HasText( const SvxSearchItem
& rSearchItem
);
450 //spell and return a sentence
451 bool SpellSentence(EditView
const & rEditView
, svx::SpellPortions
& rToFill
);
452 // put spell position to start of current sentence
453 void PutSpellingToSentenceStart( EditView
const & rEditView
);
454 //applies a changed sentence
455 void ApplyChangedSentence(EditView
const & rEditView
, const svx::SpellPortions
& rNewPortions
, bool bRecheck
);
457 // for text conversion (see also HasSpellErrors)
458 bool HasConvertibleTextPortion( LanguageType nLang
);
459 virtual bool ConvertNextDocument();
462 bool UpdateFieldsOnly();
463 void RemoveFields( const std::function
<bool ( const SvxFieldData
* )>& isFieldData
= [] (const SvxFieldData
* ){return true;} );
465 sal_uInt16
GetFieldCount( sal_Int32 nPara
) const;
466 EFieldInfo
GetFieldInfo( sal_Int32 nPara
, sal_uInt16 nField
) const;
468 bool IsRightToLeft( sal_Int32 nPara
) const;
470 css::uno::Reference
< css::datatransfer::XTransferable
>
471 CreateTransferable( const ESelection
& rSelection
) const;
473 // MT: Can't create new virtual functions like for ParagraphInserted/Deleted, must be compatible in SRC638, change later...
474 void SetBeginMovingParagraphsHdl( const Link
<MoveParagraphsInfo
&,void>& rLink
);
475 void SetEndMovingParagraphsHdl( const Link
<MoveParagraphsInfo
&,void>& rLink
);
476 void SetBeginPasteOrDropHdl( const Link
<PasteOrDropInfos
&,void>& rLink
);
477 void SetEndPasteOrDropHdl( const Link
<PasteOrDropInfos
&,void>& rLink
);
479 virtual void PaintingFirstLine( sal_Int32 nPara
, const Point
& rStartPos
, long nBaseLineY
, const Point
& rOrigin
, short nOrientation
, OutputDevice
* pOutDev
);
480 virtual void ParagraphInserted( sal_Int32 nNewParagraph
);
481 virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph
);
482 virtual void ParagraphConnected( sal_Int32 nLeftParagraph
, sal_Int32 nRightParagraph
);
483 virtual void ParaAttribsChanged( sal_Int32 nParagraph
);
484 virtual void StyleSheetChanged( SfxStyleSheet
* pStyle
);
485 void ParagraphHeightChanged( sal_Int32 nPara
);
487 virtual void DrawingText( const Point
& rStartPos
, const OUString
& rText
,
488 sal_Int32 nTextStart
, sal_Int32 nTextLen
,
489 const long* pDXArray
, const SvxFont
& rFont
,
490 sal_Int32 nPara
, sal_uInt8 nRightToLeft
,
491 const EEngineData::WrongSpellVector
* pWrongSpellVector
,
492 const SvxFieldData
* pFieldData
,
494 bool bEndOfParagraph
,
495 const css::lang::Locale
* pLocale
,
496 const Color
& rOverlineColor
,
497 const Color
& rTextLineColor
);
499 virtual void DrawingTab( const Point
& rStartPos
, long nWidth
, const OUString
& rChar
,
500 const SvxFont
& rFont
, sal_Int32 nPara
, sal_uInt8 nRightToLeft
,
502 bool bEndOfParagraph
,
503 const Color
& rOverlineColor
,
504 const Color
& rTextLineColor
);
505 virtual OUString
GetUndoComment( sal_uInt16 nUndoId
) const;
506 virtual bool SpellNextDocument();
507 virtual void FieldClicked( const SvxFieldItem
& rField
, sal_Int32 nPara
, sal_Int32 nPos
);
508 virtual OUString
CalcFieldValue( const SvxFieldItem
& rField
, sal_Int32 nPara
, sal_Int32 nPos
, boost::optional
<Color
>& rTxtColor
, boost::optional
<Color
>& rFldColor
);
510 // override this if access to bullet information needs to be provided
511 virtual const SvxNumberFormat
* GetNumberFormat( sal_Int32 nPara
) const;
513 virtual tools::Rectangle
GetBulletArea( sal_Int32 nPara
);
515 static SfxItemPool
* CreatePool();
516 static SfxItemPool
& GetGlobalItemPool();
517 static bool DoesKeyChangeText( const KeyEvent
& rKeyEvent
);
518 static bool DoesKeyMoveCursor( const KeyEvent
& rKeyEvent
);
519 static bool IsSimpleCharInput( const KeyEvent
& rKeyEvent
);
520 static void SetFontInfoInItemSet( SfxItemSet
& rItemSet
, const vcl::Font
& rFont
);
521 static void SetFontInfoInItemSet( SfxItemSet
& rItemSet
, const SvxFont
& rFont
);
522 static vcl::Font
CreateFontFromItemSet( const SfxItemSet
& rItemSet
, SvtScriptType nScriptType
);
523 static SvxFont
CreateSvxFontFromItemSet( const SfxItemSet
& rItemSet
);
524 static bool IsPrintable( sal_Unicode c
) { return ( ( c
>= 32 ) && ( c
!= 127 ) ); }
525 static bool HasValidData( const css::uno::Reference
< css::datatransfer::XTransferable
>& rTransferable
);
526 /** sets a link that is called at the beginning of a drag operation at an edit view */
527 void SetBeginDropHdl( const Link
<EditView
*,void>& rLink
);
528 Link
<EditView
*,void> const & GetBeginDropHdl() const;
530 /** sets a link that is called at the end of a drag operation at an edit view */
531 void SetEndDropHdl( const Link
<EditView
*,void>& rLink
);
532 Link
<EditView
*,void> const & GetEndDropHdl() const;
534 /// specifies if auto-correction should capitalize the first word or not (default is on)
535 void SetFirstWordCapitalization( bool bCapitalize
);
537 /** specifies if auto-correction should replace a leading single quotation
538 mark (apostrophe) or not (default is on) */
539 void SetReplaceLeadingSingleQuotationMark( bool bReplace
);
541 EditDoc
& GetEditDoc();
542 const EditDoc
& GetEditDoc() const;
543 void dumpAsXmlEditDoc(xmlTextWriterPtr pWriter
) const;
545 ParaPortionList
& GetParaPortions();
546 const ParaPortionList
& GetParaPortions() const;
548 bool IsFormatted() const;
549 bool IsHtmlImportHandlerSet() const;
550 bool IsRtfImportHandlerSet() const;
551 bool IsImportRTFStyleSheetsSet() const;
553 void CallRtfImportHandler(RtfImportInfo
& rInfo
);
554 void CallHtmlImportHandler(HtmlImportInfo
& rInfo
);
556 void ParaAttribsToCharAttribs(ContentNode
* pNode
);
558 EditPaM
CreateEditPaM(const EPaM
& rEPaM
);
559 EditPaM
ConnectParagraphs(
560 ContentNode
* pLeft
, ContentNode
* pRight
, bool bBackward
);
562 EditPaM
InsertField(const EditSelection
& rEditSelection
, const SvxFieldItem
& rFld
);
563 EditPaM
InsertText(const EditSelection
& aCurEditSelection
, const OUString
& rStr
);
564 EditSelection
InsertText(const EditTextObject
& rTextObject
, const EditSelection
& rSel
);
565 EditPaM
InsertParaBreak(const EditSelection
& rEditSelection
);
566 EditPaM
InsertLineBreak(const EditSelection
& rEditSelection
);
569 const EditPaM
& rPaM
, sal_uInt16 nCharacterIteratorMode
= css::i18n::CharacterIteratorMode::SKIPCELL
);
571 const EditPaM
& rPaM
, sal_uInt16 nCharacterIteratorMode
= css::i18n::CharacterIteratorMode::SKIPCELL
);
573 void SeekCursor(ContentNode
* pNode
, sal_Int32 nPos
, SvxFont
& rFont
);
575 EditPaM
DeleteSelection(const EditSelection
& rSel
);
577 ESelection
CreateESelection(const EditSelection
& rSel
);
578 EditSelection
CreateSelection(const ESelection
& rSel
);
580 const SfxItemSet
& GetBaseParaAttribs(sal_Int32 nPara
) const;
581 void SetParaAttribsOnly(sal_Int32 nPara
, const SfxItemSet
& rSet
);
582 void SetAttribs(const EditSelection
& rSel
, const SfxItemSet
& rSet
, SetAttribsMode nSpecial
= SetAttribsMode::NONE
);
584 OUString
GetSelected(const EditSelection
& rSel
) const;
585 EditPaM
DeleteSelected(const EditSelection
& rSel
);
587 SvtScriptType
GetScriptType(const EditSelection
& rSel
) const;
589 void RemoveParaPortion(sal_Int32 nNode
);
591 void SetCallParaInsertedOrDeleted(bool b
);
592 bool IsCallParaInsertedOrDeleted() const;
594 void AppendDeletedNodeInfo(DeletedNodeInfo
* pInfo
);
595 void UpdateSelections();
597 void InsertContent(ContentNode
* pNode
, sal_Int32 nPos
);
598 EditPaM
SplitContent(sal_Int32 nNode
, sal_Int32 nSepPos
);
599 EditPaM
ConnectContents(sal_Int32 nLeftNode
, bool bBackward
);
601 void InsertFeature(const EditSelection
& rEditSelection
, const SfxPoolItem
& rItem
);
603 EditSelection
MoveParagraphs(const Range
& rParagraphs
, sal_Int32 nNewPos
);
605 void RemoveCharAttribs(sal_Int32 nPara
, sal_uInt16 nWhich
= 0, bool bRemoveFeatures
= false);
606 void RemoveCharAttribs(const EditSelection
& rSel
, bool bRemoveParaAttribs
, sal_uInt16 nWhich
);
608 ViewsType
& GetEditViews();
609 const ViewsType
& GetEditViews() const;
611 void SetUndoMode(bool b
);
612 void FormatAndUpdate(EditView
* pCurView
, bool bCalledFromUndo
= false);
614 void Undo(EditView
* pView
);
615 void Redo(EditView
* pView
);
617 sal_Int32
GetOverflowingParaNum() const;
618 sal_Int32
GetOverflowingLineNum() const;
619 void ClearOverflowingParaNum();
620 bool IsPageOverflow();
623 #endif // INCLUDED_EDITENG_EDITENG_HXX
625 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */