LibreOffice Module editeng (master) 1
include/editeng/editeng.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_EDITENG_EDITENG_HXX
21#define INCLUDED_EDITENG_EDITENG_HXX
22
23#include <memory>
24#include <vector>
25
26#include <optional>
27
28#include <com/sun/star/uno/Reference.h>
29#include <com/sun/star/i18n/WordType.hpp>
30#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
31
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>
38#include <i18nlangtag/lang.h>
39
40#include <tools/lineend.hxx>
41#include <tools/degree.hxx>
42#include <tools/long.hxx>
43#include <tools/fontenum.hxx>
45
46#include <editeng/eedata.hxx>
50#include <functional>
51
52template <typename Arg, typename Ret> class Link;
53
54namespace com::sun::star {
55 namespace linguistic2 {
56 class XSpellChecker1;
57 class XHyphenator;
58 }
59 namespace datatransfer {
60 class XTransferable;
61 }
62 namespace lang {
63 struct Locale;
64 }
65}
66
67namespace svx {
68struct SpellPortion;
69typedef std::vector<SpellPortion> SpellPortions;
70}
71
72class SfxUndoManager;
73namespace basegfx { class B2DPolyPolygon; }
74namespace editeng {
75 struct MisspellRanges;
76}
77
78class ImpEditEngine;
79class EditView;
80class OutputDevice;
81class SvxFont;
82class SfxItemPool;
83class SfxStyleSheet;
85class SvxSearchItem;
86class SvxFieldItem;
87class MapMode;
88class Color;
89namespace vcl { class Font; }
90class KeyEvent;
91class Size;
92class Point;
93namespace tools { class Rectangle; }
94class SvStream;
95namespace vcl { class Window; }
98class SvxNumberFormat;
99class SvxFieldData;
100class ContentNode;
101class ParaPortion;
102class EditSelection;
103class EditPaM;
104class EditLine;
107class EditDoc;
108class Range;
109struct EPaM;
110class DeletedNodeInfo;
111class ParaPortionList;
112enum class CharCompressType;
113enum class TransliterationFlags;
114class LinkParamNone;
115
120 All,
121 OnlyHard
122};
123
128{
129 NONE = 0x00,
130 STYLESHEET = 0x01,
131 PARAATTRIBS = 0x02,
132 CHARATTRIBS = 0x04,
133 ALL = 0x07,
134};
135namespace o3tl
136{
137 template<> struct typed_flags<GetAttribsFlags> : is_typed_flags<GetAttribsFlags, 0x07> {};
138}
139
140enum class SetAttribsMode {
142};
143
145{
146 friend class EditView;
147 friend class ImpEditView;
148 friend class Outliner;
149 friend class TextChainingUtils;
150
151
152public:
153 typedef std::vector<EditView*> ViewsType;
154
156 css::uno::Reference<css::datatransfer::XTransferable > const & rxDataObj,
157 const OUString& rBaseURL, const EditPaM& rPaM, bool bUseSpecial);
158
159private:
160 std::unique_ptr<ImpEditEngine> pImpEditEngine;
161
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 );
165
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;
172
173 EDITENG_DLLPRIVATE css::uno::Reference<
174 css::datatransfer::XTransferable>
175 CreateTransferable(const EditSelection& rSelection);
176
177 EDITENG_DLLPRIVATE EditPaM EndOfWord(const EditPaM& rPaM);
178
179 EDITENG_DLLPRIVATE EditPaM GetPaM(const Point& aDocPos, bool bSmart = true);
180
182 const EditSelection& rCurSelection,
183 sal_Int16 nWordType = css::i18n::WordType::ANYWORD_IGNOREWHITESPACES);
184
186 const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart = false) const;
187
188 EDITENG_DLLPRIVATE Range GetLineXPosStartEnd(
189 const ParaPortion* pParaPortion, const EditLine* pLine) const;
190
191 EDITENG_DLLPRIVATE InternalEditStatus& GetInternalEditStatus();
192
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);
198
199protected:
200
201
202public:
203 EditEngine( SfxItemPool* pItemPool );
204 virtual ~EditEngine();
205
206 const SfxItemSet& GetEmptyItemSet() const;
207
208 void SetDefTab( sal_uInt16 nDefTab );
209
210 void SetRefDevice( OutputDevice* pRefDef );
211 OutputDevice* GetRefDevice() const;
212
213 void SetRefMapMode( const MapMode& rMapMode );
214 MapMode const & GetRefMapMode() const;
215
221 bool SetUpdateLayout(bool bUpdate, bool bRestoring = false);
222 bool IsUpdateLayout() const;
223
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;
230
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);
239
240 void SetPaperSize( const Size& rSize );
241 const Size& GetPaperSize() const;
242
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;
249
250 void SetTextColumns(sal_Int16 nColumns, sal_Int32 nSpacing);
251
252 void SetFixedCellHeight( bool bUseFixedCellHeight );
253
254 void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir );
255 EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const;
256
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;
260
261 void TransliterateText( const ESelection& rSelection, TransliterationFlags nTransliterationMode );
262 EditSelection TransliterateText( const EditSelection& rSelection, TransliterationFlags nTransliterationMode );
263
264 void SetAsianCompressionMode( CharCompressType nCompression );
265
266 void SetKernAsianPunctuation( bool bEnabled );
267
268 void SetAddExtLeading( bool b );
269
270 void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon );
271 void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon);
272 void ClearPolygon();
273
274 const Size& GetMinAutoPaperSize() const;
275 void SetMinAutoPaperSize( const Size& rSz );
276
277 const Size& GetMaxAutoPaperSize() const;
278 void SetMaxAutoPaperSize( const Size& rSz );
279
280 void SetMinColumnWrapHeight(tools::Long nVal);
281
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();
288
289 OUString GetText( sal_Int32 nParagraph ) const;
290 sal_Int32 GetTextLen( sal_Int32 nParagraph ) const;
291 sal_uInt32 GetTextHeight( sal_Int32 nParagraph ) const;
292
293 sal_Int32 GetParagraphCount() const;
294
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;
305
306 OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex);
307
308 ESelection GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const;
309
310 void Clear();
311 void SetText( const OUString& rStr );
312
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 );
318
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);
322
323 void SetText(sal_Int32 nPara, const OUString& rText);
324
325 virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
326 const SfxItemSet& GetParaAttribs( sal_Int32 nPara ) const;
327
329 void SetCharAttribs(sal_Int32 nPara, const SfxItemSet& rSet);
330 void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
331
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 );
334
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
339 {
340 return static_cast<const T&>(GetParaAttrib(nPara, sal_uInt16(nWhich)));
341 }
342
343 vcl::Font GetStandardFont( sal_Int32 nPara );
344 SvxFont GetStandardSvxFont( sal_Int32 nPara );
345
346 void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich );
347
348 void ShowParagraph( sal_Int32 nParagraph, bool bShow );
349
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;
356
357 void EnableUndo( bool bEnable );
358 bool IsUndoEnabled() const;
359
363 bool HasTriedMergeOnLastAddUndo() const;
364
365 void ClearModifyFlag();
366 void SetModified();
367 bool IsModified() const;
368
369 void SetModifyHdl( const Link<LinkParamNone*,void>& rLink );
370
371 bool IsInSelectionMode() const;
372
373 void StripPortions();
374 void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList );
375
376 tools::Long GetFirstLineStartX( sal_Int32 nParagraph );
377 Point GetDocPosTopLeft( sal_Int32 nParagraph );
378 Point GetDocPos( const Point& rPaperPos ) const;
379 bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder );
380
381 // StartDocPos corresponds to VisArea.TopLeft().
382 void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect );
383 void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos );
384 void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip );
385 void Draw( OutputDevice& rOutDev, const Point& rStartPos, Degree10 nOrientation = 0_deg10 );
386
387 ErrCode Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr );
388 void Write( SvStream& rOutput, EETextFormat );
389
390 void SetStatusEventHdl( const Link<EditStatus&,void>& rLink );
391 Link<EditStatus&,void> const & GetStatusEventHdl() const;
392
393 void SetNotifyHdl( const Link<EENotify&,void>& rLink );
394 Link<EENotify&,void> const & GetNotifyHdl() const;
395
396 void SetRtfImportHdl( const Link<RtfImportInfo&,void>& rLink );
397 const Link<RtfImportInfo&,void>& GetRtfImportHdl() const;
398
399 void SetHtmlImportHdl( const Link<HtmlImportInfo&,void>& rLink );
400 const Link<HtmlImportInfo&,void>& GetHtmlImportHdl() const;
401
402 // Do not evaluate font formatting => For Outliner
403 bool IsFlatMode() const;
404 void SetFlatMode( bool bFlat );
405
406 void SetSingleLine( bool bValue );
407
408 void SetControlWord( EEControlBits nWord );
409 EEControlBits GetControlWord() const;
410
411 void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
412 void QuickMarkInvalid( const ESelection& rSel );
413 void QuickFormatDoc( bool bFull = false );
414 void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
415 void QuickInsertLineBreak( const ESelection& rSel );
416 void QuickInsertText(const OUString& rText, const ESelection& rSel);
417 void QuickDelete( const ESelection& rSel );
418 void QuickMarkToBeRepainted( sal_Int32 nPara );
419
420 void setGlobalScale(double fFontScaleX, double fFontScaleY, double fSpacingScaleX, double fSpacingScaleY);
421
422 void getGlobalSpacingScale(double& rX, double& rY) const;
423 basegfx::B2DTuple getGlobalSpacingScale() const;
424 void getGlobalFontScale(double& rX, double& rY) const;
425 basegfx::B2DTuple getGlobalFontScale() const;
426
427 void setRoundFontSizeToPt(bool bRound) const;
428
429 void SetEditTextObjectPool( SfxItemPool* pPool );
430 SfxItemPool* GetEditTextObjectPool() const;
431
432 void SetStyleSheetPool( SfxStyleSheetPool* pSPool );
433 SfxStyleSheetPool* GetStyleSheetPool();
434
435 void SetStyleSheet(const EditSelection& aSel, SfxStyleSheet* pStyle);
436 void SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle );
437 const SfxStyleSheet* GetStyleSheet( sal_Int32 nPara ) const;
438 SfxStyleSheet* GetStyleSheet( sal_Int32 nPara );
439
440 void SetWordDelimiters( const OUString& rDelimiters );
441 const OUString& GetWordDelimiters() const;
442
443 void EraseVirtualDevice();
444
445 void SetSpeller( css::uno::Reference<
446 css::linguistic2::XSpellChecker1 > const &xSpeller );
447 css::uno::Reference<
448 css::linguistic2::XSpellChecker1 > const &
449 GetSpeller();
450 void SetHyphenator( css::uno::Reference<
451 css::linguistic2::XHyphenator > const & xHyph );
452
453 void GetAllMisspellRanges( std::vector<editeng::MisspellRanges>& rRanges ) const;
454 void SetAllMisspellRanges( const std::vector<editeng::MisspellRanges>& rRanges );
455
456 static void SetForbiddenCharsTable(const std::shared_ptr<SvxForbiddenCharactersTable>& xForbiddenChars);
457
458 void SetDefaultLanguage( LanguageType eLang );
459 LanguageType GetDefaultLanguage() const;
460
461 bool HasOnlineSpellErrors() const;
462 void CompleteOnlineSpelling();
463
464 bool ShouldCreateBigTextObject() const;
465
466 // For fast Pre-Test without view:
467 EESpellState HasSpellErrors();
468 void ClearSpellErrors();
469 bool HasText( const SvxSearchItem& rSearchItem );
470
471 //spell and return a sentence
472 bool SpellSentence(EditView const & rEditView, svx::SpellPortions& rToFill );
473 // put spell position to start of current sentence
474 void PutSpellingToSentenceStart( EditView const & rEditView );
475 //applies a changed sentence
476 void ApplyChangedSentence(EditView const & rEditView, const svx::SpellPortions& rNewPortions, bool bRecheck );
477
478 // for text conversion (see also HasSpellErrors)
479 bool HasConvertibleTextPortion( LanguageType nLang );
480 virtual bool ConvertNextDocument();
481
482 bool UpdateFields();
483 bool UpdateFieldsOnly();
484 void RemoveFields( const std::function<bool ( const SvxFieldData* )>& isFieldData = [] (const SvxFieldData* ){return true;} );
485
486 sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
487 EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
488
489 bool IsRightToLeft( sal_Int32 nPara ) const;
490
491 css::uno::Reference< css::datatransfer::XTransferable >
492 CreateTransferable( const ESelection& rSelection ) const;
493
494 // MT: Can't create new virtual functions like for ParagraphInserted/Deleted, must be compatible in SRC638, change later...
495 void SetBeginMovingParagraphsHdl( const Link<MoveParagraphsInfo&,void>& rLink );
496 void SetEndMovingParagraphsHdl( const Link<MoveParagraphsInfo&,void>& rLink );
497 void SetBeginPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
498 void SetEndPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
499
500 virtual void PaintingFirstLine(sal_Int32 nPara, const Point& rStartPos, const Point& rOrigin, Degree10 nOrientation, OutputDevice& rOutDev);
501 virtual void ParagraphInserted( sal_Int32 nNewParagraph );
502 virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
503 virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
504 virtual void ParaAttribsChanged( sal_Int32 nParagraph );
505 virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
506 void ParagraphHeightChanged( sal_Int32 nPara );
507
508 virtual void DrawingText( const Point& rStartPos, const OUString& rText,
509 sal_Int32 nTextStart, sal_Int32 nTextLen,
511 o3tl::span<const sal_Bool> pKashidaArray,
512 const SvxFont& rFont,
513 sal_Int32 nPara, sal_uInt8 nRightToLeft,
514 const EEngineData::WrongSpellVector* pWrongSpellVector,
515 const SvxFieldData* pFieldData,
516 bool bEndOfLine,
517 bool bEndOfParagraph,
518 const css::lang::Locale* pLocale,
519 const Color& rOverlineColor,
520 const Color& rTextLineColor);
521
522 virtual void DrawingTab( const Point& rStartPos, tools::Long nWidth, const OUString& rChar,
523 const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
524 bool bEndOfLine,
525 bool bEndOfParagraph,
526 const Color& rOverlineColor,
527 const Color& rTextLineColor);
528 virtual OUString GetUndoComment( sal_uInt16 nUndoId ) const;
529 virtual bool SpellNextDocument();
531 virtual bool FieldClicked( const SvxFieldItem& rField );
532 virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rTxtColor, std::optional<Color>& rFldColor, std::optional<FontLineStyle>& rFldLineStyle );
533
534 // override this if access to bullet information needs to be provided
535 virtual const SvxNumberFormat * GetNumberFormat( sal_Int32 nPara ) const;
536
537 virtual tools::Rectangle GetBulletArea( sal_Int32 nPara );
538
539 static rtl::Reference<SfxItemPool> CreatePool();
540 static SfxItemPool& GetGlobalItemPool();
541 static bool DoesKeyChangeText( const KeyEvent& rKeyEvent );
542 static bool DoesKeyMoveCursor( const KeyEvent& rKeyEvent );
543 static bool IsSimpleCharInput( const KeyEvent& rKeyEvent );
544 static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const vcl::Font& rFont );
545 static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const SvxFont& rFont );
546 static vcl::Font CreateFontFromItemSet( const SfxItemSet& rItemSet, SvtScriptType nScriptType );
547 static SvxFont CreateSvxFontFromItemSet( const SfxItemSet& rItemSet );
548 static bool IsPrintable( sal_Unicode c ) { return ( ( c >= 32 ) && ( c != 127 ) ); }
549 static bool HasValidData( const css::uno::Reference< css::datatransfer::XTransferable >& rTransferable );
551 void SetBeginDropHdl( const Link<EditView*,void>& rLink );
552 Link<EditView*,void> const & GetBeginDropHdl() const;
553
555 void SetEndDropHdl( const Link<EditView*,void>& rLink );
556 Link<EditView*,void> const & GetEndDropHdl() const;
557
559 void SetFirstWordCapitalization( bool bCapitalize );
560
563 void SetReplaceLeadingSingleQuotationMark( bool bReplace );
564
565 EditDoc& GetEditDoc();
566 const EditDoc& GetEditDoc() const;
567 void dumpAsXmlEditDoc(xmlTextWriterPtr pWriter) const;
568
569 ParaPortionList& GetParaPortions();
570 const ParaPortionList& GetParaPortions() const;
571
572 bool IsFormatted() const;
573 bool IsHtmlImportHandlerSet() const;
574 bool IsRtfImportHandlerSet() const;
575 bool IsImportRTFStyleSheetsSet() const;
576
577 void CallRtfImportHandler(RtfImportInfo& rInfo);
578 void CallHtmlImportHandler(HtmlImportInfo& rInfo);
579
580 void ParaAttribsToCharAttribs(ContentNode* pNode);
581
582 EditPaM CreateEditPaM(const EPaM& rEPaM);
583 EditPaM ConnectParagraphs(
584 ContentNode* pLeft, ContentNode* pRight, bool bBackward);
585
586 EditPaM InsertField(const EditSelection& rEditSelection, const SvxFieldItem& rFld);
587 EditPaM InsertText(const EditSelection& aCurEditSelection, const OUString& rStr);
588 EditSelection InsertText(const EditTextObject& rTextObject, const EditSelection& rSel);
589 EditPaM InsertParaBreak(const EditSelection& rEditSelection);
590 EditPaM InsertLineBreak(const EditSelection& rEditSelection);
591
592 EditPaM CursorLeft(
593 const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = css::i18n::CharacterIteratorMode::SKIPCELL);
594 EditPaM CursorRight(
595 const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = css::i18n::CharacterIteratorMode::SKIPCELL);
596
597 void SeekCursor(ContentNode* pNode, sal_Int32 nPos, SvxFont& rFont);
598
599 EditPaM DeleteSelection(const EditSelection& rSel);
600
601 ESelection CreateESelection(const EditSelection& rSel) const;
602 EditSelection CreateSelection(const ESelection& rSel);
603
604 const SfxItemSet& GetBaseParaAttribs(sal_Int32 nPara) const;
605 void SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet& rSet);
606 void SetAttribs(const EditSelection& rSel, const SfxItemSet& rSet, SetAttribsMode nSpecial = SetAttribsMode::NONE);
607
608 OUString GetSelected(const EditSelection& rSel) const;
609 EditPaM DeleteSelected(const EditSelection& rSel);
610
611 SvtScriptType GetScriptType(const EditSelection& rSel) const;
612
613 void RemoveParaPortion(sal_Int32 nNode);
614
615 void SetCallParaInsertedOrDeleted(bool b);
616 bool IsCallParaInsertedOrDeleted() const;
617
618 void AppendDeletedNodeInfo(DeletedNodeInfo* pInfo);
619 void UpdateSelections();
620
621 void InsertContent(ContentNode* pNode, sal_Int32 nPos);
622 EditPaM SplitContent(sal_Int32 nNode, sal_Int32 nSepPos);
623 EditPaM ConnectContents(sal_Int32 nLeftNode, bool bBackward);
624
625 void InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem);
626
627 EditSelection MoveParagraphs(const Range& rParagraphs, sal_Int32 nNewPos);
628
629 void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false);
630 void RemoveCharAttribs(const EditSelection& rSel, bool bRemoveParaAttribs, sal_uInt16 nWhich);
631 void RemoveCharAttribs(const EditSelection& rSel, EERemoveParaAttribsMode eMode, sal_uInt16 nWhich);
632
633 ViewsType& GetEditViews();
634 const ViewsType& GetEditViews() const;
635
636 void SetUndoMode(bool b);
637 void FormatAndLayout(EditView* pCurView, bool bCalledFromUndo = false);
638
639 void Undo(EditView* pView);
640 void Redo(EditView* pView);
641
642 sal_Int32 GetOverflowingParaNum() const;
643 sal_Int32 GetOverflowingLineNum() const;
644 void ClearOverflowingParaNum();
645 bool IsPageOverflow();
646
647 // tdf#132288 By default inserting an attribute beside another that is of
648 // the same type expands the original instead of inserting another. But the
649 // spell check dialog doesn't want that behaviour
650 void DisableAttributeExpanding();
651
652 // Optimization, if set, formatting will be done only for text lines that fit
653 // in given paper size and exceeding lines will be ignored.
654 void EnableSkipOutsideFormat(bool set);
655
656 void SetLOKSpecialPaperSize(const Size& rSize);
657 const Size& GetLOKSpecialPaperSize() const;
658
659#ifdef DBG_UTIL
660 static void DumpData(const EditEngine* pEE, bool bInfoBox);
661#endif
662};
663
664#endif // INCLUDED_EDITENG_EDITENG_HXX
665
666/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CharCompressType
static bool IsPrintable(sal_Unicode c)
EditEngine(const EditEngine &)=delete
EditEngine & operator=(const EditEngine &)=delete
EditSelection InsertText(css::uno::Reference< css::datatransfer::XTransferable > const &rxDataObj, const OUString &rBaseURL, const EditPaM &rPaM, bool bUseSpecial)
std::vector< EditView * > ViewsType
std::unique_ptr< ImpEditEngine > pImpEditEngine
const T & GetParaAttrib(sal_Int32 nPara, TypedWhichId< T > nWhich) const
This item stores a field (SvxFieldData).
Definition: flditem.hxx:70
virtual OUString GetWord() override
virtual void SetText(const OUString &rStr) override
const size_t EE_APPEND
Definition: editdata.cxx:14
EETextFormat
Definition: editdata.hxx:35
EESpellState
Definition: editdata.hxx:40
EERemoveParaAttribsMode
Definition: editdata.hxx:46
EEHorizontalTextDirection
Definition: editdata.hxx:36
#define EDITENG_DLLPRIVATE
Definition: editengdllapi.h:30
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28
TextRotation
Definition: editobj.hxx:55
EEControlBits
Definition: editstat.hxx:28
struct _xmlTextWriter * xmlTextWriterPtr
@ StyleSheetChanged
GetAttribsFlags
values for: SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd,...
EditEngineAttribs
values for: SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEn...
@ OnlyHard
returns all attributes even when they are not set
SvtScriptType
LineEnd
std::vector< WrongSpellClass > WrongSpellVector
Definition: eedata.hxx:42
void Clear(EHistoryType eHistory)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
NONE
std::vector< SpellPortion > SpellPortions
Definition: outliner.hxx:87
long Long
Definition: editdoc.hxx:56
SW_DLLPUBLIC SwView * GetActiveView()
OUString GetUndoComment(SwUndoId eId)
TransliterationFlags
unsigned char sal_uInt8
sal_uInt16 sal_Unicode