Line data Source code
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 : // MyEDITENG, due to exported EditEng
20 : #ifndef INCLUDED_EDITENG_EDITENG_HXX
21 : #define INCLUDED_EDITENG_EDITENG_HXX
22 :
23 : #include <rtl/ref.hxx>
24 : #include <vector>
25 : #include <com/sun/star/uno/Reference.h>
26 : #include <com/sun/star/i18n/WordType.hpp>
27 : #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
28 :
29 : #include <rsc/rscsfx.hxx>
30 : #include <editeng/editdata.hxx>
31 : #include <i18nlangtag/lang.h>
32 : #include <editeng/editengdllapi.h>
33 :
34 : #include <tools/lineend.hxx>
35 : #include <tools/rtti.hxx>
36 :
37 : #include <editeng/eedata.hxx>
38 :
39 : namespace com { namespace sun { namespace star {
40 : namespace linguistic2 {
41 : class XSpellChecker1;
42 : class XHyphenator;
43 : }
44 : namespace datatransfer {
45 : class XTransferable;
46 : }
47 : namespace lang {
48 : struct Locale;
49 : }
50 : }}}
51 :
52 : namespace svx {
53 : struct SpellPortion;
54 : typedef std::vector<SpellPortion> SpellPortions;
55 : }
56 :
57 : namespace svl { class IUndoManager; }
58 : namespace basegfx { class B2DPolyPolygon; }
59 : namespace editeng {
60 : struct MisspellRanges;
61 : }
62 :
63 : class ImpEditEngine;
64 : class EditView;
65 : class OutputDevice;
66 : class EditUndo;
67 : class SvxFont;
68 : class SfxItemPool;
69 : class SfxStyleSheet;
70 : class SfxStyleSheetPool;
71 : class SvxSearchItem;
72 : class SvxFieldItem;
73 : class SvxCharSetColorItem;
74 : class SfxUndoAction;
75 : class MapMode;
76 : class Color;
77 : class Font;
78 : class KeyEvent;
79 : class PolyPolygon;
80 : class Size;
81 : class Point;
82 : class Rectangle;
83 : class SvStream;
84 : class Link;
85 : class OutputDevice;
86 : class Window;
87 : class SfxPoolItem;
88 : class SvxNumBulletItem;
89 : class SvxBulletItem;
90 : class SvxLRSpaceItem;
91 : class SvKeyValueIterator;
92 : class SvxForbiddenCharactersTable;
93 : class SvxNumberFormat;
94 : class FontList;
95 : class SvxFieldData;
96 : class ContentNode;
97 : class ParaPortion;
98 : class EditSelection;
99 : class EditPaM;
100 : class EditLine;
101 : class InternalEditStatus;
102 : class EditSelectionEngine;
103 : class EditDoc;
104 : struct PasteOrDropInfos;
105 : class Range;
106 : struct EPaM;
107 : class DeletedNodeInfo;
108 : class ParaPortionList;
109 :
110 :
111 :
112 : /** values for:
113 : SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All );
114 : */
115 : enum EditEngineAttribs {
116 : EditEngineAttribs_All, /// returns all attributes even when theire not set
117 : EditEngineAttribs_HardAndPara, /// returns all attributes set on paragraph and on portions
118 : EditEngineAttribs_OnlyHard /// returns only attributes hard set on portions
119 : };
120 :
121 : /** values for:
122 : SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags = 0xFF ) const;
123 : */
124 : #define GETATTRIBS_STYLESHEET (sal_uInt8)0x01
125 : #define GETATTRIBS_PARAATTRIBS (sal_uInt8)0x02
126 : #define GETATTRIBS_CHARATTRIBS (sal_uInt8)0x04
127 : #define GETATTRIBS_ALL (sal_uInt8)0xFF
128 :
129 : class SdrObject;
130 : class EDITENG_DLLPUBLIC EditEngine
131 : {
132 : friend class EditView;
133 : friend class ImpEditView;
134 : friend class EditDbg;
135 : friend class Outliner;
136 :
137 : public:
138 : typedef std::vector<EditView*> ViewsType;
139 :
140 : private:
141 : ImpEditEngine* pImpEditEngine;
142 :
143 : EDITENG_DLLPRIVATE EditEngine( const EditEngine& );
144 : EDITENG_DLLPRIVATE EditEngine& operator=( const EditEngine& );
145 : EDITENG_DLLPRIVATE bool PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pView, Window* pFrameWin = NULL );
146 :
147 : EDITENG_DLLPRIVATE void CursorMoved(ContentNode* pPrevNode);
148 : EDITENG_DLLPRIVATE void CheckIdleFormatter();
149 : EDITENG_DLLPRIVATE bool IsIdleFormatterActive() const;
150 : EDITENG_DLLPRIVATE ParaPortion* FindParaPortion(ContentNode* pNode);
151 : EDITENG_DLLPRIVATE const ParaPortion* FindParaPortion(ContentNode* pNode) const;
152 : EDITENG_DLLPRIVATE const ParaPortion* GetPrevVisPortion(const ParaPortion* pCurPortion) const;
153 :
154 : EDITENG_DLLPRIVATE com::sun::star::uno::Reference<
155 : com::sun::star::datatransfer::XTransferable>
156 : CreateTransferable(const EditSelection& rSelection);
157 :
158 : EDITENG_DLLPRIVATE EditSelection InsertText(
159 : com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable >& rxDataObj,
160 : const OUString& rBaseURL, const EditPaM& rPaM, bool bUseSpecial);
161 :
162 : EDITENG_DLLPRIVATE EditPaM EndOfWord(
163 : const EditPaM& rPaM, sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES);
164 :
165 : EDITENG_DLLPRIVATE EditPaM GetPaM(const Point& aDocPos, bool bSmart = true);
166 :
167 : EDITENG_DLLPRIVATE EditSelection SelectWord(
168 : const EditSelection& rCurSelection,
169 : sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES,
170 : bool bAcceptStartOfWord = true);
171 :
172 : EDITENG_DLLPRIVATE long GetXPos(
173 : const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart = false) const;
174 :
175 : EDITENG_DLLPRIVATE Range GetLineXPosStartEnd(
176 : const ParaPortion* pParaPortion, const EditLine* pLine) const;
177 :
178 : EDITENG_DLLPRIVATE sal_uInt16 GetOnePixelInRef() const;
179 : EDITENG_DLLPRIVATE InternalEditStatus& GetInternalEditStatus();
180 :
181 : EDITENG_DLLPRIVATE void HandleBeginPasteOrDrop(PasteOrDropInfos& rInfos);
182 : EDITENG_DLLPRIVATE void HandleEndPasteOrDrop(PasteOrDropInfos& rInfos);
183 : EDITENG_DLLPRIVATE bool HasText() const;
184 : EDITENG_DLLPRIVATE const EditSelectionEngine& GetSelectionEngine() const;
185 : EDITENG_DLLPRIVATE void SetInSelectionMode(bool b);
186 :
187 : protected:
188 :
189 :
190 : public:
191 : EditEngine( SfxItemPool* pItemPool );
192 : virtual ~EditEngine();
193 :
194 : const SfxItemSet& GetEmptyItemSet();
195 :
196 : void SetDefTab( sal_uInt16 nDefTab );
197 :
198 : void SetRefDevice( OutputDevice* pRefDef );
199 : OutputDevice* GetRefDevice() const;
200 :
201 : void SetRefMapMode( const MapMode& rMapMode );
202 : MapMode GetRefMapMode();
203 :
204 : void SetUpdateMode( bool bUpdate );
205 : bool GetUpdateMode() const;
206 : void SetUpdateModeForAcc( bool bUp);
207 : bool GetUpdateModeForAcc( ) const;
208 :
209 : void SetBackgroundColor( const Color& rColor );
210 : Color GetBackgroundColor() const;
211 : Color GetAutoColor() const;
212 : void EnableAutoColor( bool b );
213 : void ForceAutoColor( bool b );
214 : bool IsForceAutoColor() const;
215 :
216 : void InsertView(EditView* pEditView, size_t nIndex = EE_APPEND);
217 : EditView* RemoveView( EditView* pEditView );
218 : EditView* RemoveView(size_t nIndex = EE_APPEND);
219 : EditView* GetView(size_t nIndex = 0) const;
220 : size_t GetViewCount() const;
221 : bool HasView( EditView* pView ) const;
222 : EditView* GetActiveView() const;
223 : void SetActiveView(EditView* pView);
224 :
225 : void SetPaperSize( const Size& rSize );
226 : const Size& GetPaperSize() const;
227 :
228 : void SetVertical( bool bVertical );
229 : bool IsVertical() const;
230 :
231 : void SetFixedCellHeight( bool bUseFixedCellHeight );
232 :
233 : void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir );
234 : EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const;
235 :
236 : sal_uInt16 GetScriptType( const ESelection& rSelection ) const;
237 : LanguageType GetLanguage(const EditPaM& rPaM) const;
238 : LanguageType GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const;
239 :
240 : void TransliterateText( const ESelection& rSelection, sal_Int32 nTransliterationMode );
241 : EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
242 :
243 : void SetAsianCompressionMode( sal_uInt16 nCompression );
244 :
245 : void SetKernAsianPunctuation( bool bEnabled );
246 :
247 : void SetAddExtLeading( bool b );
248 :
249 : void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon );
250 : void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon);
251 : void ClearPolygon();
252 :
253 : const Size& GetMinAutoPaperSize() const;
254 : void SetMinAutoPaperSize( const Size& rSz );
255 :
256 : const Size& GetMaxAutoPaperSize() const;
257 : void SetMaxAutoPaperSize( const Size& rSz );
258 :
259 : OUString GetText( LineEnd eEnd = LINEEND_LF ) const;
260 : OUString GetText( const ESelection& rSelection, const LineEnd eEnd = LINEEND_LF ) const;
261 : sal_uInt32 GetTextLen() const;
262 : sal_uInt32 GetTextHeight() const;
263 : sal_uInt32 GetTextHeightNTP() const;
264 : sal_uInt32 CalcTextWidth();
265 :
266 : OUString GetText( sal_Int32 nParagraph ) const;
267 : sal_Int32 GetTextLen( sal_Int32 nParagraph ) const;
268 : sal_uInt32 GetTextHeight( sal_Int32 nParagraph ) const;
269 :
270 : sal_Int32 GetParagraphCount() const;
271 :
272 : sal_Int32 GetLineCount( sal_Int32 nParagraph ) const;
273 : sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const;
274 : void GetLineBoundaries( /*out*/sal_Int32& rStart, /*out*/sal_Int32& rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const;
275 : sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const;
276 : sal_uInt32 GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine = 0 );
277 : ParagraphInfos GetParagraphInfos( sal_Int32 nPara );
278 : sal_Int32 FindParagraph( long nDocPosY );
279 : EPosition FindDocPosition( const Point& rDocPos ) const;
280 : Rectangle GetCharacterBounds( const EPosition& rPos ) const;
281 :
282 : OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex);
283 :
284 : ESelection GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const;
285 :
286 : void Clear();
287 : void SetText( const OUString& rStr );
288 :
289 : EditTextObject* CreateTextObject();
290 : EditTextObject* CreateTextObject( sal_Int32 nPara, sal_Int32 nParas = 1 );
291 : EditTextObject* CreateTextObject( const ESelection& rESelection );
292 : void SetText( const EditTextObject& rTextObject );
293 :
294 : void RemoveParagraph(sal_Int32 nPara);
295 : void InsertParagraph(sal_Int32 nPara, const EditTextObject& rTxtObj);
296 : void InsertParagraph(sal_Int32 nPara, const OUString& rText);
297 :
298 : void SetText(sal_Int32 nPara, const OUString& rText);
299 :
300 : virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
301 : virtual const SfxItemSet& GetParaAttribs( sal_Int32 nPara ) const;
302 :
303 : void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
304 :
305 : SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags = 0xFF ) const;
306 : SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All );
307 :
308 : bool HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
309 : const SfxPoolItem& GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich );
310 :
311 : Font GetStandardFont( sal_Int32 nPara );
312 : SvxFont GetStandardSvxFont( sal_Int32 nPara );
313 :
314 : void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich );
315 :
316 : void ShowParagraph( sal_Int32 nParagraph, bool bShow = true );
317 :
318 : ::svl::IUndoManager& GetUndoManager();
319 : ::svl::IUndoManager* SetUndoManager(::svl::IUndoManager* pNew);
320 : void UndoActionStart( sal_uInt16 nId );
321 : void UndoActionStart(sal_uInt16 nId, const ESelection& rSel);
322 : void UndoActionEnd( sal_uInt16 nId );
323 : bool IsInUndo();
324 :
325 : void EnableUndo( bool bEnable );
326 : bool IsUndoEnabled();
327 :
328 : /** returns the value last used for bTryMerge while calling ImpEditEngine::InsertUndo
329 : This is currently used in a bad but needed hack to get undo actions merged in the
330 : OutlineView in impress. Do not use it unless you want to sell your soul too! */
331 : bool HasTriedMergeOnLastAddUndo() const;
332 :
333 : void ClearModifyFlag();
334 : void SetModified();
335 : bool IsModified() const;
336 :
337 : void SetModifyHdl( const Link& rLink );
338 : Link GetModifyHdl() const;
339 :
340 : bool IsInSelectionMode() const;
341 :
342 : void StripPortions();
343 : void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList );
344 :
345 : long GetFirstLineStartX( sal_Int32 nParagraph );
346 : Point GetDocPosTopLeft( sal_Int32 nParagraph );
347 : Point GetDocPos( const Point& rPaperPos ) const;
348 : bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder = 0 );
349 :
350 : // StartDocPos corrresponds to VisArea.TopLeft().
351 : void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect );
352 : void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const Point& rStartDocPos );
353 : void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const Point& rStartDocPos, bool bClip );
354 : void Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 );
355 :
356 : // sal_uInt32: Error code of the stream.
357 : sal_uLong Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
358 : sal_uLong Write( SvStream& rOutput, EETextFormat );
359 :
360 : void SetStatusEventHdl( const Link& rLink );
361 : Link GetStatusEventHdl() const;
362 :
363 : void SetNotifyHdl( const Link& rLink );
364 : Link GetNotifyHdl() const;
365 :
366 : void SetImportHdl( const Link& rLink );
367 : Link GetImportHdl() const;
368 :
369 : // Do not evaluate font formatting => For Outliner
370 : bool IsFlatMode() const;
371 : void SetFlatMode( bool bFlat );
372 :
373 : void SetControlWord( sal_uInt32 nWord );
374 : sal_uInt32 GetControlWord() const;
375 :
376 : void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
377 : void QuickRemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0 );
378 : void QuickMarkInvalid( const ESelection& rSel );
379 : void QuickFormatDoc( bool bFull = false );
380 : void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
381 : void QuickInsertLineBreak( const ESelection& rSel );
382 : void QuickInsertText(const OUString& rText, const ESelection& rSel);
383 : void QuickDelete( const ESelection& rSel );
384 : void QuickMarkToBeRepainted( sal_Int32 nPara );
385 :
386 : void SetGlobalCharStretching( sal_uInt16 nX = 100, sal_uInt16 nY = 100 );
387 : void GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY ) const;
388 :
389 : void SetEditTextObjectPool( SfxItemPool* pPool );
390 : SfxItemPool* GetEditTextObjectPool() const;
391 :
392 : void SetStyleSheetPool( SfxStyleSheetPool* pSPool );
393 : SfxStyleSheetPool* GetStyleSheetPool();
394 :
395 : void SetStyleSheet(const EditSelection& aSel, SfxStyleSheet* pStyle);
396 : void SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle );
397 : const SfxStyleSheet* GetStyleSheet( sal_Int32 nPara ) const;
398 : SfxStyleSheet* GetStyleSheet( sal_Int32 nPara );
399 :
400 : void SetWordDelimiters( const OUString& rDelimiters );
401 : OUString GetWordDelimiters() const;
402 :
403 : void EraseVirtualDevice();
404 :
405 : void SetSpeller( ::com::sun::star::uno::Reference<
406 : ::com::sun::star::linguistic2::XSpellChecker1 > &xSpeller );
407 : ::com::sun::star::uno::Reference<
408 : ::com::sun::star::linguistic2::XSpellChecker1 >
409 : GetSpeller();
410 : void SetHyphenator( ::com::sun::star::uno::Reference<
411 : ::com::sun::star::linguistic2::XHyphenator >& xHyph );
412 :
413 : void GetAllMisspellRanges( std::vector<editeng::MisspellRanges>& rRanges ) const;
414 : void SetAllMisspellRanges( const std::vector<editeng::MisspellRanges>& rRanges );
415 :
416 : void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars );
417 :
418 : void SetDefaultLanguage( LanguageType eLang );
419 : LanguageType GetDefaultLanguage() const;
420 :
421 : bool HasOnlineSpellErrors() const;
422 : void CompleteOnlineSpelling();
423 :
424 : bool ShouldCreateBigTextObject() const;
425 :
426 : // For fast Pre-Test without view:
427 : EESpellState HasSpellErrors();
428 : void ClearSpellErrors();
429 : bool HasText( const SvxSearchItem& rSearchItem );
430 :
431 : //initialize sentence spelling
432 : void StartSpelling(EditView& rEditView, bool bMultipleDoc);
433 : //spell and return a sentence
434 : bool SpellSentence(EditView& rEditView, ::svx::SpellPortions& rToFill, bool bIsGrammarChecking );
435 : // put spell position to start of current sentence
436 : void PutSpellingToSentenceStart( EditView& rEditView );
437 : //applies a changed sentence
438 : void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck );
439 :
440 : // for text conversion (see also HasSpellErrors)
441 : bool HasConvertibleTextPortion( LanguageType nLang );
442 : virtual bool ConvertNextDocument();
443 :
444 : bool UpdateFields();
445 : bool UpdateFieldsOnly();
446 : void RemoveFields( bool bKeepFieldText, TypeId aType = NULL );
447 :
448 : sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
449 : EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
450 :
451 : bool IsRightToLeft( sal_Int32 nPara ) const;
452 :
453 : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
454 : CreateTransferable( const ESelection& rSelection ) const;
455 :
456 : // MT: Can't create new virtual functions like for ParagraphInserted/Deleted, musst be compatible in SRC638, change later...
457 : void SetBeginMovingParagraphsHdl( const Link& rLink );
458 : void SetEndMovingParagraphsHdl( const Link& rLink );
459 : void SetBeginPasteOrDropHdl( const Link& rLink );
460 : void SetEndPasteOrDropHdl( const Link& rLink );
461 :
462 : virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
463 : virtual void ParagraphInserted( sal_Int32 nNewParagraph );
464 : virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
465 : virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
466 : virtual void ParaAttribsChanged( sal_Int32 nParagraph );
467 : virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
468 : virtual void ParagraphHeightChanged( sal_Int32 nPara );
469 :
470 : virtual void DrawingText(
471 : const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, sal_Int32 nTextLen, const sal_Int32* pDXArray,
472 : const SvxFont& rFont, sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
473 : const EEngineData::WrongSpellVector* pWrongSpellVector,
474 : const SvxFieldData* pFieldData,
475 : bool bEndOfLine,
476 : bool bEndOfParagraph,
477 : bool bEndOfBullet,
478 : const ::com::sun::star::lang::Locale* pLocale,
479 : const Color& rOverlineColor,
480 : const Color& rTextLineColor);
481 :
482 : virtual void DrawingTab(
483 : const Point& rStartPos, long nWidth, const OUString& rChar,
484 : const SvxFont& rFont, sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
485 : bool bEndOfLine,
486 : bool bEndOfParagraph,
487 : const Color& rOverlineColor,
488 : const Color& rTextLineColor);
489 : virtual OUString GetUndoComment( sal_uInt16 nUndoId ) const;
490 : virtual bool FormattingParagraph( sal_Int32 nPara );
491 : virtual bool SpellNextDocument();
492 : virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos );
493 : virtual void FieldSelected( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos );
494 : virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rTxtColor, Color*& rFldColor );
495 :
496 : // to be overloaded if access to bullet information needs to be provided
497 : virtual const SvxNumberFormat * GetNumberFormat( sal_Int32 nPara ) const;
498 :
499 : virtual Rectangle GetBulletArea( sal_Int32 nPara );
500 :
501 : static SfxItemPool* CreatePool( bool bLoadRefCounts = true );
502 : static SfxItemPool& GetGlobalItemPool();
503 : static bool DoesKeyChangeText( const KeyEvent& rKeyEvent );
504 : static bool DoesKeyMoveCursor( const KeyEvent& rKeyEvent );
505 : static bool IsSimpleCharInput( const KeyEvent& rKeyEvent );
506 : static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const Font& rFont );
507 : static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const SvxFont& rFont );
508 : static Font CreateFontFromItemSet( const SfxItemSet& rItemSet, sal_uInt16 nScriptType );
509 : static SvxFont CreateSvxFontFromItemSet( const SfxItemSet& rItemSet );
510 0 : static bool IsPrintable( sal_Unicode c ) { return ( ( c >= 32 ) && ( c != 127 ) ); }
511 : static bool HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable );
512 0 : virtual SdrObject* GetCurTextObj() { return NULL; }
513 : /** sets a link that is called at the beginning of a drag operation at an edit view */
514 : void SetBeginDropHdl( const Link& rLink );
515 : Link GetBeginDropHdl() const;
516 :
517 : /** sets a link that is called at the end of a drag operation at an edit view */
518 : void SetEndDropHdl( const Link& rLink );
519 : Link GetEndDropHdl() const;
520 :
521 : /// specifies if auto-correction should capitalize the first word or not (default is on)
522 : void SetFirstWordCapitalization( bool bCapitalize );
523 :
524 : EditDoc& GetEditDoc();
525 : const EditDoc& GetEditDoc() const;
526 :
527 : ParaPortionList& GetParaPortions();
528 : const ParaPortionList& GetParaPortions() const;
529 :
530 : bool IsFormatted() const;
531 : bool IsImportHandlerSet() const;
532 : bool IsImportRTFStyleSheetsSet() const;
533 :
534 : void CallImportHandler(ImportInfo& rInfo);
535 :
536 : void ParaAttribsToCharAttribs(ContentNode* pNode);
537 :
538 : EditPaM CreateEditPaM(const EPaM& rEPaM);
539 : EditPaM ConnectParagraphs(
540 : ContentNode* pLeft, ContentNode* pRight, bool bBackward = false);
541 :
542 : EditPaM InsertField(const EditSelection& rEditSelection, const SvxFieldItem& rFld);
543 : EditPaM InsertText(const EditSelection& aCurEditSelection, const OUString& rStr);
544 : EditSelection InsertText(const EditTextObject& rTextObject, const EditSelection& rSel);
545 : EditPaM InsertParaBreak(
546 : const EditSelection& rEditSelection, bool bKeepEndingAttribs = true);
547 : EditPaM InsertLineBreak(const EditSelection& rEditSelection);
548 :
549 : EditPaM CursorLeft(
550 : const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = com::sun::star::i18n::CharacterIteratorMode::SKIPCELL);
551 : EditPaM CursorRight(
552 : const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = com::sun::star::i18n::CharacterIteratorMode::SKIPCELL);
553 :
554 : void SeekCursor(
555 : ContentNode* pNode, sal_Int32 nPos, SvxFont& rFont, OutputDevice* pOut = NULL, sal_uInt16 nIgnoreWhich = 0);
556 :
557 : EditPaM DeleteSelection(const EditSelection& rSel);
558 :
559 : ESelection CreateESelection(const EditSelection& rSel);
560 : EditSelection CreateSelection(const ESelection& rSel);
561 :
562 : const SfxItemSet& GetBaseParaAttribs(sal_Int32 nPara) const;
563 : void SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet& rSet);
564 : void SetAttribs(const EditSelection& rSel, const SfxItemSet& rSet, sal_uInt8 nSpecial = 0);
565 :
566 : OUString GetSelected(const EditSelection& rSel, const LineEnd eParaSep = LINEEND_LF) const;
567 : EditPaM DeleteSelected(const EditSelection& rSel);
568 :
569 : sal_uInt16 GetScriptType(const EditSelection& rSel) const;
570 :
571 : void RemoveParaPortion(sal_Int32 nNode);
572 :
573 : void SetCallParaInsertedOrDeleted(bool b);
574 : bool IsCallParaInsertedOrDeleted() const;
575 :
576 : void AppendDeletedNodeInfo(DeletedNodeInfo* pInfo);
577 : void UpdateSelections();
578 :
579 : void InsertContent(ContentNode* pNode, sal_Int32 nPos);
580 : EditPaM SplitContent(sal_Int32 nNode, sal_Int32 nSepPos);
581 : EditPaM ConnectContents(sal_Int32 nLeftNode, bool bBackward);
582 :
583 : EditPaM InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem);
584 :
585 : EditSelection MoveParagraphs(const Range& rParagraphs, sal_Int32 nNewPos, EditView* pCurView);
586 :
587 : void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false);
588 : void RemoveCharAttribs(const EditSelection& rSel, bool bRemoveParaAttribs, sal_uInt16 nWhich = 0);
589 :
590 : ViewsType& GetEditViews();
591 : const ViewsType& GetEditViews() const;
592 :
593 : void SetUndoMode(bool b);
594 : void FormatAndUpdate(EditView* pCurView = NULL);
595 :
596 : bool Undo(EditView* pView);
597 : bool Redo(EditView* pView);
598 : };
599 :
600 : #endif // INCLUDED_EDITENG_EDITENG_HXX
601 :
602 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|