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