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 : namespace vcl { class Font; }
78 : class KeyEvent;
79 : namespace tools { class PolyPolygon; }
80 : class Size;
81 : class Point;
82 : class Rectangle;
83 : class SvStream;
84 : class Link;
85 : class OutputDevice;
86 : namespace vcl { 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, vcl::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 : vcl::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 QuickMarkInvalid( const ESelection& rSel );
378 : void QuickFormatDoc( bool bFull = false );
379 : void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
380 : void QuickInsertLineBreak( const ESelection& rSel );
381 : void QuickInsertText(const OUString& rText, const ESelection& rSel);
382 : void QuickDelete( const ESelection& rSel );
383 : void QuickMarkToBeRepainted( sal_Int32 nPara );
384 :
385 : void SetGlobalCharStretching( sal_uInt16 nX = 100, sal_uInt16 nY = 100 );
386 : void GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY ) const;
387 :
388 : void SetEditTextObjectPool( SfxItemPool* pPool );
389 : SfxItemPool* GetEditTextObjectPool() const;
390 :
391 : void SetStyleSheetPool( SfxStyleSheetPool* pSPool );
392 : SfxStyleSheetPool* GetStyleSheetPool();
393 :
394 : void SetStyleSheet(const EditSelection& aSel, SfxStyleSheet* pStyle);
395 : void SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle );
396 : const SfxStyleSheet* GetStyleSheet( sal_Int32 nPara ) const;
397 : SfxStyleSheet* GetStyleSheet( sal_Int32 nPara );
398 :
399 : void SetWordDelimiters( const OUString& rDelimiters );
400 : OUString GetWordDelimiters() const;
401 :
402 : void EraseVirtualDevice();
403 :
404 : void SetSpeller( ::com::sun::star::uno::Reference<
405 : ::com::sun::star::linguistic2::XSpellChecker1 > &xSpeller );
406 : ::com::sun::star::uno::Reference<
407 : ::com::sun::star::linguistic2::XSpellChecker1 >
408 : GetSpeller();
409 : void SetHyphenator( ::com::sun::star::uno::Reference<
410 : ::com::sun::star::linguistic2::XHyphenator >& xHyph );
411 :
412 : void GetAllMisspellRanges( std::vector<editeng::MisspellRanges>& rRanges ) const;
413 : void SetAllMisspellRanges( const std::vector<editeng::MisspellRanges>& rRanges );
414 :
415 : void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars );
416 :
417 : void SetDefaultLanguage( LanguageType eLang );
418 : LanguageType GetDefaultLanguage() const;
419 :
420 : bool HasOnlineSpellErrors() const;
421 : void CompleteOnlineSpelling();
422 :
423 : bool ShouldCreateBigTextObject() const;
424 :
425 : // For fast Pre-Test without view:
426 : EESpellState HasSpellErrors();
427 : void ClearSpellErrors();
428 : bool HasText( const SvxSearchItem& rSearchItem );
429 :
430 : //initialize sentence spelling
431 : void StartSpelling(EditView& rEditView, bool bMultipleDoc);
432 : //spell and return a sentence
433 : bool SpellSentence(EditView& rEditView, ::svx::SpellPortions& rToFill, bool bIsGrammarChecking );
434 : // put spell position to start of current sentence
435 : void PutSpellingToSentenceStart( EditView& rEditView );
436 : //applies a changed sentence
437 : void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck );
438 :
439 : // for text conversion (see also HasSpellErrors)
440 : bool HasConvertibleTextPortion( LanguageType nLang );
441 : virtual bool ConvertNextDocument();
442 :
443 : bool UpdateFields();
444 : bool UpdateFieldsOnly();
445 : void RemoveFields( bool bKeepFieldText, TypeId aType = NULL );
446 :
447 : sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
448 : EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
449 :
450 : bool IsRightToLeft( sal_Int32 nPara ) const;
451 :
452 : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
453 : CreateTransferable( const ESelection& rSelection ) const;
454 :
455 : // MT: Can't create new virtual functions like for ParagraphInserted/Deleted, musst be compatible in SRC638, change later...
456 : void SetBeginMovingParagraphsHdl( const Link& rLink );
457 : void SetEndMovingParagraphsHdl( const Link& rLink );
458 : void SetBeginPasteOrDropHdl( const Link& rLink );
459 : void SetEndPasteOrDropHdl( const Link& rLink );
460 :
461 : virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
462 : virtual void ParagraphInserted( sal_Int32 nNewParagraph );
463 : virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
464 : virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
465 : virtual void ParaAttribsChanged( sal_Int32 nParagraph );
466 : virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
467 : virtual void ParagraphHeightChanged( sal_Int32 nPara );
468 :
469 : virtual void DrawingText( const Point& rStartPos, const OUString& rText,
470 : sal_Int32 nTextStart, sal_Int32 nTextLen,
471 : const long* pDXArray, const SvxFont& rFont,
472 : 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( const Point& rStartPos, long nWidth, const OUString& rChar,
483 : const SvxFont& rFont, sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
484 : bool bEndOfLine,
485 : bool bEndOfParagraph,
486 : const Color& rOverlineColor,
487 : const Color& rTextLineColor);
488 : virtual OUString GetUndoComment( sal_uInt16 nUndoId ) const;
489 : virtual bool FormattingParagraph( sal_Int32 nPara );
490 : virtual bool SpellNextDocument();
491 : virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos );
492 : virtual void FieldSelected( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos );
493 : virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rTxtColor, Color*& rFldColor );
494 :
495 : // to be overloaded if access to bullet information needs to be provided
496 : virtual const SvxNumberFormat * GetNumberFormat( sal_Int32 nPara ) const;
497 :
498 : virtual Rectangle GetBulletArea( sal_Int32 nPara );
499 :
500 : static SfxItemPool* CreatePool( bool bLoadRefCounts = true );
501 : static SfxItemPool& GetGlobalItemPool();
502 : static bool DoesKeyChangeText( const KeyEvent& rKeyEvent );
503 : static bool DoesKeyMoveCursor( const KeyEvent& rKeyEvent );
504 : static bool IsSimpleCharInput( const KeyEvent& rKeyEvent );
505 : static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const vcl::Font& rFont );
506 : static void SetFontInfoInItemSet( SfxItemSet& rItemSet, const SvxFont& rFont );
507 : static vcl::Font CreateFontFromItemSet( const SfxItemSet& rItemSet, sal_uInt16 nScriptType );
508 : static SvxFont CreateSvxFontFromItemSet( const SfxItemSet& rItemSet );
509 0 : static bool IsPrintable( sal_Unicode c ) { return ( ( c >= 32 ) && ( c != 127 ) ); }
510 : static bool HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable );
511 0 : virtual SdrObject* GetCurTextObj() { return NULL; }
512 : /** sets a link that is called at the beginning of a drag operation at an edit view */
513 : void SetBeginDropHdl( const Link& rLink );
514 : Link GetBeginDropHdl() const;
515 :
516 : /** sets a link that is called at the end of a drag operation at an edit view */
517 : void SetEndDropHdl( const Link& rLink );
518 : Link GetEndDropHdl() const;
519 :
520 : /// specifies if auto-correction should capitalize the first word or not (default is on)
521 : void SetFirstWordCapitalization( bool bCapitalize );
522 :
523 : EditDoc& GetEditDoc();
524 : const EditDoc& GetEditDoc() const;
525 :
526 : ParaPortionList& GetParaPortions();
527 : const ParaPortionList& GetParaPortions() const;
528 :
529 : bool IsFormatted() const;
530 : bool IsImportHandlerSet() const;
531 : bool IsImportRTFStyleSheetsSet() const;
532 :
533 : void CallImportHandler(ImportInfo& rInfo);
534 :
535 : void ParaAttribsToCharAttribs(ContentNode* pNode);
536 :
537 : EditPaM CreateEditPaM(const EPaM& rEPaM);
538 : EditPaM ConnectParagraphs(
539 : ContentNode* pLeft, ContentNode* pRight, bool bBackward = false);
540 :
541 : EditPaM InsertField(const EditSelection& rEditSelection, const SvxFieldItem& rFld);
542 : EditPaM InsertText(const EditSelection& aCurEditSelection, const OUString& rStr);
543 : EditSelection InsertText(const EditTextObject& rTextObject, const EditSelection& rSel);
544 : EditPaM InsertParaBreak(
545 : const EditSelection& rEditSelection, bool bKeepEndingAttribs = true);
546 : EditPaM InsertLineBreak(const EditSelection& rEditSelection);
547 :
548 : EditPaM CursorLeft(
549 : const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = com::sun::star::i18n::CharacterIteratorMode::SKIPCELL);
550 : EditPaM CursorRight(
551 : const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = com::sun::star::i18n::CharacterIteratorMode::SKIPCELL);
552 :
553 : void SeekCursor(
554 : ContentNode* pNode, sal_Int32 nPos, SvxFont& rFont, OutputDevice* pOut = NULL, sal_uInt16 nIgnoreWhich = 0);
555 :
556 : EditPaM DeleteSelection(const EditSelection& rSel);
557 :
558 : ESelection CreateESelection(const EditSelection& rSel);
559 : EditSelection CreateSelection(const ESelection& rSel);
560 :
561 : const SfxItemSet& GetBaseParaAttribs(sal_Int32 nPara) const;
562 : void SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet& rSet);
563 : void SetAttribs(const EditSelection& rSel, const SfxItemSet& rSet, sal_uInt8 nSpecial = 0);
564 :
565 : OUString GetSelected(const EditSelection& rSel, const LineEnd eParaSep = LINEEND_LF) const;
566 : EditPaM DeleteSelected(const EditSelection& rSel);
567 :
568 : sal_uInt16 GetScriptType(const EditSelection& rSel) const;
569 :
570 : void RemoveParaPortion(sal_Int32 nNode);
571 :
572 : void SetCallParaInsertedOrDeleted(bool b);
573 : bool IsCallParaInsertedOrDeleted() const;
574 :
575 : void AppendDeletedNodeInfo(DeletedNodeInfo* pInfo);
576 : void UpdateSelections();
577 :
578 : void InsertContent(ContentNode* pNode, sal_Int32 nPos);
579 : EditPaM SplitContent(sal_Int32 nNode, sal_Int32 nSepPos);
580 : EditPaM ConnectContents(sal_Int32 nLeftNode, bool bBackward);
581 :
582 : EditPaM InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem);
583 :
584 : EditSelection MoveParagraphs(const Range& rParagraphs, sal_Int32 nNewPos, EditView* pCurView);
585 :
586 : void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false);
587 : void RemoveCharAttribs(const EditSelection& rSel, bool bRemoveParaAttribs, sal_uInt16 nWhich = 0);
588 :
589 : ViewsType& GetEditViews();
590 : const ViewsType& GetEditViews() const;
591 :
592 : void SetUndoMode(bool b);
593 : void FormatAndUpdate(EditView* pCurView = NULL);
594 :
595 : bool Undo(EditView* pView);
596 : bool Redo(EditView* pView);
597 : };
598 :
599 : #endif // INCLUDED_EDITENG_EDITENG_HXX
600 :
601 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|