xref: /trunk/main/editeng/inc/editeng/outliner.hxx (revision 7a9d3b93)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _OUTLINER_HXX
24 #define _OUTLINER_HXX
25 
26 #include <tools/gen.hxx>
27 #include <tools/string.hxx>
28 #include <tools/debug.hxx>
29 
30 #include <svl/brdcst.hxx>
31 
32 #include <editeng/editdata.hxx>
33 #include <i18npool/lang.h>
34 #include <tools/color.hxx>
35 #include <vcl/graph.hxx>
36 #include <tools/list.hxx>
37 #include <tools/link.hxx>
38 #include <rsc/rscsfx.hxx>
39 #include "editeng/editengdllapi.h"
40 #include <editeng/numitem.hxx>
41 #include <svtools/grfmgr.hxx>
42 
43 #include <tools/rtti.hxx>	// wegen typedef TypeId
44 #include <vector>
45 
46 class OutlinerEditEng;
47 class Outliner;
48 class EditView;
49 class EditUndo;
50 class ParagraphList;
51 class OutlinerParaObject;
52 class SvStream;
53 class SvxBulletItem;
54 class SvxFont;
55 class SvxSearchItem;
56 class SvxFieldItem;
57 class OLUndoRemove;
58 class Window;
59 class KeyEvent;
60 class MouseEvent;
61 class Pointer;
62 class CommandEvent;
63 class MapMode;
64 class OutputDevice;
65 class PolyPolygon;
66 class SfxStyleSheetPool;
67 class SfxStyleSheet;
68 class SfxItemPool;
69 class SfxItemSet;
70 class SvxNumBulletItem;
71 class SvxNumberFormat;
72 class SvxLRSpaceItem;
73 class EditEngine;
74 class SvKeyValueIterator;
75 class SvxForbiddenCharactersTable;
76 
77 namespace svl
78 {
79     class IUndoManager;
80 }
81 
82 #include <com/sun/star/uno/Reference.h>
83 
84 #include <vos/ref.hxx>
85 #include <editeng/svxfont.hxx>
86 #include <editeng/eedata.hxx>
87 #include <editeng/paragraphdata.hxx>
88 
89 class SvxFieldData;
90 //////////////////////////////////////////////////////////////////////////////
91 
92 namespace com { namespace sun { namespace star { namespace linguistic2 {
93 	class XSpellChecker1;
94 	class XHyphenator;
95 }}}}
96 namespace svx{
97 struct SpellPortion;
98 typedef std::vector<SpellPortion> SpellPortions;
99 }
100 
101 namespace basegfx { class B2DPolyPolygon; }
102 
103 // nur interner Gebrauch!
104 #define PARAFLAG_DROPTARGET         0x1000
105 #define PARAFLAG_DROPTARGET_EMPTY   0x2000
106 #define PARAFLAG_HOLDDEPTH          0x4000
107 #define PARAFLAG_SETBULLETTEXT      0x8000
108 #define PARAFLAG_ISPAGE				0x0100
109 
110 // Undo-Action-Ids
111 #define OLUNDO_DEPTH            EDITUNDO_USER
112 // #define OLUNDO_HEIGHT           EDITUNDO_USER+1
113 #define OLUNDO_EXPAND           EDITUNDO_USER+2
114 #define OLUNDO_COLLAPSE         EDITUNDO_USER+3
115 // #define OLUNDO_REMOVE           EDITUNDO_USER+4
116 #define OLUNDO_ATTR             EDITUNDO_USER+5
117 #define OLUNDO_INSERT           EDITUNDO_USER+6
118 // #define OLUNDO_MOVEPARAGRAPHS	EDITUNDO_USER+7
119 #define OLUNDO_CHECKPARA		EDITUNDO_USER+8
120 
121 class Paragraph : protected ParagraphData
122 {
123 private:
124 	friend class Outliner;
125 	friend class ParagraphList;
126 	friend class OutlinerView;
127 	friend class OutlinerParaObject;
128 	friend class OutlinerEditEng;
129 	friend class OLUndoDepth;
130 	friend class OutlinerUndoCheckPara;
131 	friend class OutlinerUndoChangeParaFlags;
132 
133 	Paragraph& operator=(const Paragraph& rPara );
134 
135 	sal_uInt16				nFlags;
136 	XubString			aBulText;
137 	Size				aBulSize;
138 	sal_Bool				bVisible;
139 
IsVisible() const140 	sal_Bool 				IsVisible() const { return bVisible; }
SetText(const XubString & rText)141 	void 				SetText( const XubString& rText ) { aBulText = rText; aBulSize.Width() = -1; }
Invalidate()142 	void 				Invalidate() { aBulSize.Width() = -1; }
SetDepth(sal_Int16 nNewDepth)143 	void 				SetDepth( sal_Int16 nNewDepth ) { nDepth = nNewDepth; aBulSize.Width() = -1; }
GetText() const144 	const XubString&	GetText() const { return aBulText; }
145 
146 						Paragraph( sal_Int16 nDepth );
147 						Paragraph( const Paragraph& );
148                         Paragraph( const ParagraphData& );
149 						~Paragraph();
150 
GetDepth() const151 	sal_Int16			GetDepth() const { return nDepth; }
152 
GetNumberingStartValue() const153     sal_Int16           GetNumberingStartValue() const { return mnNumberingStartValue; }
154     void                SetNumberingStartValue( sal_Int16 nNumberingStartValue );
155 
IsParaIsNumberingRestart() const156     sal_Bool            IsParaIsNumberingRestart() const { return mbParaIsNumberingRestart; }
157     void                SetParaIsNumberingRestart( sal_Bool bParaIsNumberingRestart );
158 
SetFlag(sal_uInt16 nFlag)159 	void				SetFlag( sal_uInt16 nFlag ) { nFlags |= nFlag; }
RemoveFlag(sal_uInt16 nFlag)160 	void				RemoveFlag( sal_uInt16 nFlag ) { nFlags &= ~nFlag; }
HasFlag(sal_uInt16 nFlag) const161 	bool				HasFlag( sal_uInt16 nFlag ) const { return (nFlags & nFlag) != 0; }
162 };
163 
164 struct ParaRange
165 {
166 	sal_uInt32 	nStartPara;
167 	sal_uInt32 	nEndPara;
168 
ParaRangeParaRange169 			ParaRange( sal_uInt32 nS, sal_uInt32 nE ) { nStartPara = nS, nEndPara = nE; }
170 
171 	void 	Adjust();
LenParaRange172 	sal_uInt32	Len() const { return 1 + ( ( nEndPara > nStartPara ) ? (nEndPara-nStartPara) : (nStartPara-nEndPara) ); }
173 };
174 
Adjust()175 inline void ParaRange::Adjust()
176 {
177 	if ( nStartPara > nEndPara )
178 	{
179 		sal_uInt32 nTmp = nStartPara;
180 		nStartPara = nEndPara;
181 		nEndPara = nTmp;
182 	}
183 }
184 
185 #define OL_ROOTPARENT (Paragraph*)NULL
186 
187 class EDITENG_DLLPUBLIC OutlinerView
188 {
189 	friend class Outliner;
190 
191 private:
192 
193 	Outliner*   pOwner;
194 	EditView*   pEditView;
195 
196 	// Drag & Drop
197 	sal_Bool        bBeginDragAtMove_OLDMEMBER;
198 	sal_Bool        bInDragMode;
199 	Point       aDDStartPosRef;
200 	Point       aDDStartPosPix;
201 	sal_uLong       nDDStartPara;
202 	sal_uLong       nDDStartParaVisChildCount;
203 	sal_uLong       nDDCurPara;
204 	sal_uInt16      nDDStartDepth;
205 	sal_uInt16      nDDCurDepth;
206 	sal_uInt16      nDDMaxDepth;
207 	sal_Bool        bDDChangingDepth;
208 	sal_Bool        bDDCursorVisible;
209 	long*       pHorTabArrDoc;
210 	long        nDDScrollLRBorderWidthWin;  // Left Right
211 	long        nDDScrollTBBorderWidthWin;  // Top Bottom
212 	long        nDDScrollLROffs;
213 	long        nDDScrollTDOffs;
214 
215 	void*		pDummy;
216 	sal_uLong		nDummy;
217 
218 	enum MouseTarget {
219 		MouseText = 0,
220 		MouseBullet = 1,
221 		MouseHypertext = 2,    //            ausserhalb OutputArea
222 		MouseOutside = 3,    //            ausserhalb OutputArea
223 		MouseDontKnow = 4
224 	};
225 	MouseTarget OLD_ePrevMouseTarget;
226 
227 #ifdef _OUTLINER_CXX
228 
229 	EDITENG_DLLPRIVATE void 		ImplExpandOrCollaps( sal_uInt32 nStartPara, sal_uInt32 nEndPara, sal_Bool bExpand );
230 
231 	EDITENG_DLLPRIVATE sal_uLong       ImpCheckMousePos( const Point& rPosPixel, MouseTarget& reTarget);
232 	EDITENG_DLLPRIVATE void        ImpToggleExpand( Paragraph* pParentPara );
233 	EDITENG_DLLPRIVATE ParaRange	ImpGetSelectedParagraphs( sal_Bool bIncludeHiddenChilds );
234 	EDITENG_DLLPRIVATE void        ImpHideDDCursor();
235 	EDITENG_DLLPRIVATE void        ImpShowDDCursor();
236 	EDITENG_DLLPRIVATE void        ImpPaintDDCursor();
237 
238 	EDITENG_DLLPRIVATE void        ImpDragScroll( const Point& rPosPix );
239 	EDITENG_DLLPRIVATE void        ImpScrollLeft();
240 	EDITENG_DLLPRIVATE void        ImpScrollRight();
241 	EDITENG_DLLPRIVATE void        ImpScrollUp();
242 	EDITENG_DLLPRIVATE void        ImpScrollDown();
243 
244 	EDITENG_DLLPRIVATE sal_uLong       ImpGetInsertionPara( const Point& rPosPixel );
245 	EDITENG_DLLPRIVATE Point       ImpGetDocPos( const Point& rPosPixel );
246 	EDITENG_DLLPRIVATE Pointer     ImpGetMousePointer( MouseTarget eTarget );
247 	EDITENG_DLLPRIVATE sal_uInt32      ImpInitPaste( sal_uInt32& rStart );
248 	EDITENG_DLLPRIVATE void        ImpPasted( sal_uInt32 nStart, sal_uInt32 nPrevParaCount, sal_uInt32 nSize);
249 	EDITENG_DLLPRIVATE sal_uInt16      ImpCalcSelectedPages( sal_Bool bIncludeFirstSelected );
250 	EDITENG_DLLPRIVATE sal_Bool        ImpIsIndentingPages();
251 
252 #endif
253 
254 public:
255 				OutlinerView( Outliner* pOut, Window* pWindow );
256 	virtual		~OutlinerView();
257 
GetEditView() const258 	EditView& 	GetEditView() const { return *pEditView; }
259 
260 	void        Scroll( long nHorzScroll, long nVertScroll );
261 
262 	void        Paint( const Rectangle& rRect, OutputDevice* pTargetDevice = 0 );
263 	sal_Bool        PostKeyEvent( const KeyEvent& rKEvt );
264 	sal_Bool        MouseButtonDown( const MouseEvent& );
265 	sal_Bool        MouseButtonUp( const MouseEvent& );
266 	sal_Bool        MouseMove( const MouseEvent& );
267 
268 	void        ShowCursor( sal_Bool bGotoCursor = sal_True );
269 	void        HideCursor();
270 
271 	void        SetOutliner( Outliner* pOutliner );
GetOutliner() const272 	Outliner*   GetOutliner() const { return pOwner; }
273 
274 	void        SetWindow( Window* pWindow );
275 	Window*     GetWindow() const;
276 
277 	void		SetReadOnly( sal_Bool bReadOnly );
278 	sal_Bool		IsReadOnly() const;
279 
280 	void        SetOutputArea( const Rectangle& rRect );
281 	Rectangle   GetOutputArea() const;
282 
283 	Rectangle   GetVisArea() const;
284 
285 	List*       CreateSelectionList();
286 
287 	// gibt Anzahl selektierter Absaetze zurueck
288 	// MT 07/00: Who needs this?
289 	sal_uLong       Select( Paragraph* pParagraph,
290 					sal_Bool bSelect=sal_True,
291 					sal_Bool bWChilds=sal_True);
292 
293 	String      GetSelected() const;
294 	void        SelectRange( sal_uInt32 nFirst, sal_uInt32 nCount );
295 	void        SetAttribs( const SfxItemSet& );
296 	void 		Indent( short nDiff );
297 	void        AdjustDepth( short nDX );	// Spaeter gegeb Indent ersetzen!
298 
299 	sal_Bool        AdjustHeight( long nDY );
300 	void        AdjustDepth( Paragraph* pPara, short nDX,
301 					sal_Bool bWithChilds = sal_False );
302 	void        AdjustHeight( Paragraph* pPara, long nDY,
303 					sal_Bool bWithChilds=sal_False );
304 
305     sal_uLong       Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect = sal_False, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
306 	sal_uLong		Write( SvStream& rOutput, EETextFormat eFormat );
307 
308 	void        InsertText( const String& rNew, sal_Bool bSelect = sal_False );
309 	void        InsertText( const OutlinerParaObject& rParaObj );
310 	void        Expand();
311 	void        Collapse();
312 	void        Expand( Paragraph* );
313 	void        Collapse( Paragraph* );
314 	void        ExpandAll();
315 	void        CollapseAll();
316 
317 	void		SetBackgroundColor( const Color& rColor );
318 	Color		GetBackgroundColor();
319 
320 	SfxItemSet  GetAttribs();
321 
322 	void        Cut();
323 	void        Copy();
324     void        Paste();
325     void        PasteSpecial();
326 	void        EnablePaste( sal_Bool bEnable );
327 
328 	void        Undo();
329 	void        Redo();
330 
331 	void        	SetStyleSheet( SfxStyleSheet* );
332 	SfxStyleSheet*	GetStyleSheet() const;
333 
334 	void        SetControlWord( sal_uLong nWord );
335 	sal_uLong       GetControlWord() const;
336 
337 	void            SetAnchorMode( EVAnchorMode eMode );
338 	EVAnchorMode    GetAnchorMode() const;
339 
340 	Pointer     GetPointer( const Point& rPosPixel );
341 	void        Command( const CommandEvent& rCEvt );
342 	void        RemoveCharAttribs( sal_uLong nPara, sal_uInt16 nWhich = 0 );
343 
344 	void		CompleteAutoCorrect();
345 
346 	EESpellState    StartSpeller( sal_Bool bMultipleDoc = sal_False );
347 	EESpellState    StartThesaurus();
348 	sal_uInt16          StartSearchAndReplace( const SvxSearchItem& rSearchItem );
349 
350     // for text conversion
351     void            StartTextConversion( LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc );
352 
353 	void			TransliterateText( sal_Int32 nTransliterationMode );
354 
355 	ESelection  GetSelection();
356 
357 	sal_uInt16		GetSelectedScriptType() const;
358 
359 	void        SetVisArea( const Rectangle& rRec );
360 	void        SetSelection( const ESelection& );
361 
362     void        RemoveAttribs( sal_Bool bRemoveParaAttribs = sal_False, sal_uInt16 nWhich = 0, sal_Bool bKeepLanguages = sal_False );
363     void        RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs );
364 	sal_Bool        HasSelection() const;
365 
366 	void                InsertField( const SvxFieldItem& rFld );
367 	const SvxFieldItem* GetFieldUnderMousePointer() const;
368 	const SvxFieldItem*	GetFieldUnderMousePointer( sal_uInt32& nPara, xub_StrLen& nPos ) const;
369 	const SvxFieldItem* GetFieldAtSelection() const;
370 
371     /** enables bullets for the selected paragraphs if the bullets/numbering of the first paragraph is off
372         or disables bullets/numbering for the selected paragraphs if the bullets/numbering of the first paragraph is on
373     */
374     void ToggleBullets();
375 
376     void ToggleBulletsNumbering(
377         const bool bToggle,
378         const bool bHandleBullets,
379         const SvxNumRule* pNumRule = NULL );
380 
381     /** apply bullets/numbering for paragraphs
382 
383         @param boolean bHandleBullets
384         true: handle bullets
385         false: handle numbering
386 
387         @param pNewNumRule
388         numbering rule which needs to be applied. can be 0.
389 
390         @param boolean bAtSelection
391         true: apply bullets/numbering at selected paragraphs
392         false: apply bullets/numbering at all paragraphs
393     */
394     void ApplyBulletsNumbering(
395         const bool bHandleBullets,
396         const SvxNumRule* pNewNumRule,
397         const bool bCheckCurrentNumRuleBeforeApplyingNewNumRule,
398         const bool bAtSelection = false );
399 
400     /** switch off bullets/numbering for paragraphs
401 
402         @param boolean bAtSelection
403         true: switch off bullets/numbering at selected paragraphs
404         false: switch off bullets/numbering at all paragraphs
405     */
406     void SwitchOffBulletsNumbering(
407         const bool bAtSelection = false );
408 
409     /** enables numbering for the selected paragraphs that are not enabled and ignore all selected
410         paragraphs that already have numbering enabled.
411     */
412     void        EnableBullets();
413 
414 	sal_Bool        IsCursorAtWrongSpelledWord( sal_Bool bMarkIfWrong = sal_False );
415 	sal_Bool        IsWrongSpelledWordAtPos( const Point& rPosPixel, sal_Bool bMarkIfWrong = sal_False );
416 	void        SpellIgnoreWord();
417 	void        ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack = 0 );
418 
419 	void		SetInvalidateMore( sal_uInt16 nPixel );
420 	sal_uInt16		GetInvalidateMore() const;
421 
422     String		GetSurroundingText() const;
423  	Selection	GetSurroundingTextSelection() const;
424 };
425 
426 
427 // some thesaurus functionality to avoid code duplication in different projects...
428 bool EDITENG_DLLPUBLIC  GetStatusValueForThesaurusFromContext( String &rStatusVal, LanguageType &rLang, const EditView &rEditView );
429 void EDITENG_DLLPUBLIC  ReplaceTextWithSynonym( EditView &rEditView, const String &rSynonmText );
430 
431 
432 //#if 0 // _SOLAR__PRIVATE
433 DECLARE_LIST(ViewList,OutlinerView*)
434 //#else
435 //typedef List ViewList;
436 //#endif
437 
438 class EDITENG_DLLPUBLIC DrawPortionInfo
439 {
440 public:
441 	const Point&        mrStartPos;
442     const String&       mrText;
443     sal_uInt16          mnTextStart;
444     sal_uInt16          mnTextLen;
445     sal_uInt32          mnPara;
446 	xub_StrLen          mnIndex;
447     const SvxFont&      mrFont;
448     const sal_Int32*    mpDXArray;
449 
450     const EEngineData::WrongSpellVector*  mpWrongSpellVector;
451     const SvxFieldData* mpFieldData;
452     const ::com::sun::star::lang::Locale* mpLocale;
453     const Color maOverlineColor;
454     const Color maTextLineColor;
455 
456     // #101498# BiDi level needs to be transported, too.
457 	sal_uInt8			    mnBiDiLevel;
458 
459     // bitfield
460     unsigned            mbEndOfLine : 1;
461     unsigned            mbEndOfParagraph : 1;
462     unsigned            mbEndOfBullet : 1;
463 
GetBiDiLevel() const464 	sal_uInt8 GetBiDiLevel() const { return mnBiDiLevel; }
465 	sal_Bool IsRTL() const;
466 
DrawPortionInfo(const Point & rPos,const String & rTxt,sal_uInt16 nTxtStart,sal_uInt16 nTxtLen,const SvxFont & rFnt,sal_uInt32 nPar,xub_StrLen nIdx,const sal_Int32 * pDXArr,const EEngineData::WrongSpellVector * pWrongSpellVector,const SvxFieldData * pFieldData,const::com::sun::star::lang::Locale * pLocale,const Color & rOverlineColor,const Color & rTextLineColor,sal_uInt8 nBiDiLevel,bool bEndOfLine,bool bEndOfParagraph,bool bEndOfBullet)467     DrawPortionInfo(
468         const Point& rPos,
469         const String& rTxt,
470         sal_uInt16 nTxtStart,
471         sal_uInt16 nTxtLen,
472 		const SvxFont& rFnt,
473         sal_uInt32 nPar,
474         xub_StrLen nIdx,
475         const sal_Int32* pDXArr,
476         const EEngineData::WrongSpellVector* pWrongSpellVector,
477         const SvxFieldData* pFieldData,
478         const ::com::sun::star::lang::Locale* pLocale,
479         const Color& rOverlineColor,
480         const Color& rTextLineColor,
481         sal_uInt8 nBiDiLevel,
482         bool bEndOfLine,
483         bool bEndOfParagraph,
484         bool bEndOfBullet)
485     :	mrStartPos(rPos),
486         mrText(rTxt),
487         mnTextStart(nTxtStart),
488         mnTextLen(nTxtLen),
489         mnPara(nPar),
490         mnIndex(nIdx),
491 		mrFont(rFnt),
492         mpDXArray(pDXArr),
493         mpWrongSpellVector(pWrongSpellVector),
494         mpFieldData(pFieldData),
495         mpLocale(pLocale),
496         maOverlineColor(rOverlineColor),
497         maTextLineColor(rTextLineColor),
498         mnBiDiLevel(nBiDiLevel),
499         mbEndOfLine(bEndOfLine),
500         mbEndOfParagraph(bEndOfParagraph),
501         mbEndOfBullet(bEndOfBullet)
502     {}
503 };
504 
505 class EDITENG_DLLPUBLIC DrawBulletInfo
506 {
507 public:
508     const GraphicObject maBulletGraphicObject;
509     Point               maBulletPosition;
510     Size                maBulletSize;
511 
DrawBulletInfo(const GraphicObject & rBulletGraphicObject,const Point & rBulletPosition,const Size & rBulletSize)512     DrawBulletInfo(
513         const GraphicObject& rBulletGraphicObject,
514         const Point& rBulletPosition,
515         const Size& rBulletSize)
516     :   maBulletGraphicObject(rBulletGraphicObject),
517         maBulletPosition(rBulletPosition),
518         maBulletSize(rBulletSize)
519     {}
520 };
521 
522 struct EDITENG_DLLPUBLIC PaintFirstLineInfo
523 {
524 	sal_uInt32 mnPara;
525 	const Point& mrStartPos;
526 	long mnBaseLineY;
527 	const Point& mrOrigin;
528 	short mnOrientation;
529 	OutputDevice* mpOutDev;
530 
PaintFirstLineInfoPaintFirstLineInfo531 	PaintFirstLineInfo( sal_uInt32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
532 		: mnPara( nPara ), mrStartPos( rStartPos ), mnBaseLineY( nBaseLineY ), mrOrigin( rOrigin ), mnOrientation( nOrientation ), mpOutDev( pOutDev )
533 	{}
534 };
535 
536 class SdrPage;
537 
538 class EditFieldInfo
539 {
540 private:
541 	Outliner*			pOutliner;
542 	const SvxFieldItem& rFldItem;
543 
544 	Color*              pTxtColor;
545 	Color*              pFldColor;
546 
547 	String              aRepresentation;
548 
549 	sal_uInt32              nPara;
550 	xub_StrLen			nPos;
551 	sal_Bool                bSimpleClick;
552 
553 						EditFieldInfo();
554 						EditFieldInfo( const EditFieldInfo& );
555 
556 	SdrPage*			mpSdrPage;
557 
558 public:
EditFieldInfo(Outliner * pOutl,const SvxFieldItem & rFItem,sal_uInt32 nPa,xub_StrLen nPo)559 					EditFieldInfo( Outliner* pOutl, const SvxFieldItem& rFItem, sal_uInt32 nPa, xub_StrLen nPo )
560 						: rFldItem( rFItem )
561 					{
562 						pOutliner = pOutl;
563 						nPara = nPa; nPos = nPo;
564 						pTxtColor = 0; pFldColor = 0; bSimpleClick = sal_False;
565 						mpSdrPage = 0;
566 					}
~EditFieldInfo()567 					~EditFieldInfo()
568 					{
569 						delete pTxtColor;
570 						delete pFldColor;
571 					}
572 
GetOutliner() const573 	Outliner*		GetOutliner() const { return pOutliner; }
574 
GetField() const575 	const SvxFieldItem& GetField() const { return rFldItem; }
576 
GetTxtColor() const577 	Color*          GetTxtColor() const { return pTxtColor; }
SetTxtColor(const Color & rColor)578 	void            SetTxtColor( const Color& rColor )
579 						{ delete pTxtColor; pTxtColor = new Color( rColor ); }
580 
GetFldColor() const581 	Color*          GetFldColor() const { return pFldColor; }
SetFldColor(const Color & rColor)582 	void            SetFldColor( const Color& rColor )
583 						{ delete pFldColor; pFldColor = new Color( rColor ); }
ClearFldColor()584 	void            ClearFldColor()
585 						{ delete pFldColor; pFldColor = 0; }
586 
GetPara() const587 	sal_uInt32          GetPara() const { return nPara; }
GetPos() const588 	xub_StrLen          GetPos() const { return nPos; }
589 
IsSimpleClick() const590 	sal_Bool            IsSimpleClick() const { return bSimpleClick; }
SetSimpleClick(sal_Bool bSimple)591 	void            SetSimpleClick( sal_Bool bSimple ) { bSimpleClick = bSimple; }
592 
GetRepresentation() const593 	const String&       GetRepresentation() const                { return aRepresentation; }
GetRepresentation()594 	String&             GetRepresentation()                      { return aRepresentation; }
SetRepresentation(const String & rStr)595 	void                SetRepresentation( const String& rStr )  { aRepresentation = rStr; }
596 
SetSdrPage(SdrPage * pPage)597 	void			SetSdrPage( SdrPage* pPage ) { mpSdrPage = pPage; }
GetSdrPage() const598 	SdrPage*		GetSdrPage() const { return mpSdrPage; }
599 };
600 
601 struct EBulletInfo
602 {
603     sal_Bool        bVisible;
604     sal_uInt16      nType;          // see SvxNumberType
605     String      aText;
606     SvxFont		aFont;
607     Graphic     aGraphic;
608     sal_uInt32      nParagraph;
609     Rectangle   aBounds;
610 
EBulletInfoEBulletInfo611     EBulletInfo() : bVisible( sal_False ), nType( 0 ), nParagraph( EE_PARA_NOT_FOUND ) {}
612 };
613 
614 #define OUTLINERMODE_DONTKNOW		0x0000
615 #define OUTLINERMODE_TEXTOBJECT		0x0001
616 #define OUTLINERMODE_TITLEOBJECT	0x0002
617 #define OUTLINERMODE_OUTLINEOBJECT	0x0003
618 #define OUTLINERMODE_OUTLINEVIEW	0x0004
619 
620 #define OUTLINERMODE_USERMASK		0x00FF
621 
622 #define OUTLINERMODE_SUBTITLE		(0x0100|OUTLINERMODE_TEXTOBJECT)
623 #define OUTLINERMODE_NOTE			(0x0200|OUTLINERMODE_TEXTOBJECT)
624 
625 class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster
626 {
627 	friend class OutlinerView;
628 	friend class OutlinerEditEng;
629 	friend class OutlinerParaObject;
630 	friend class OLUndoExpand;
631 	friend class OutlinerUndoChangeDepth;
632 	friend class OutlinerUndoCheckPara;
633 	friend class OutlinerUndoChangeParaFlags;
634 
635 	OutlinerEditEng*    pEditEngine;
636 
637 	ParagraphList*      pParaList;
638 	ViewList            aViewList;
639 
640 	Paragraph*          pHdlParagraph;
641 	sal_uLong				mnFirstSelPage;
642 	Link                aDrawPortionHdl;
643 	Link                aDrawBulletHdl;
644 	Link                aExpandHdl;
645 	Link                aParaInsertedHdl;
646 	Link                aParaRemovingHdl;
647 	Link                aDepthChangedHdl;
648 	Link                aWidthArrReqHdl;
649 	Link                aBeginMovingHdl;
650 	Link                aEndMovingHdl;
651 	Link                aIndentingPagesHdl;
652 	Link                aRemovingPagesHdl;
653 	Link                aFieldClickedHdl;
654 	Link                aCalcFieldValueHdl;
655 	Link				maPaintFirstLineHdl;
656     Link                maBeginPasteOrDropHdl;
657     Link                maEndPasteOrDropHdl;
658 
659 	sal_Int16			nDepthChangedHdlPrevDepth;
660 	sal_uInt16				mnDepthChangeHdlPrevFlags;
661 	sal_Int16			nMaxDepth;
662 	const sal_Int16		nMinDepth;
663 	sal_uInt16				nFirstPage;
664 
665 	sal_uInt16				nOutlinerMode;
666 
667 	sal_Bool                bIsExpanding; // Nur in Expand/Collaps-Hdl gueltig, mal umstellen
668 	sal_Bool                bFirstParaIsEmpty;
669 	sal_Bool                bBlockInsCallback;
670 	sal_Bool                bStrippingPortions;
671 	sal_Bool 				bPasting;
672 
673     sal_uLong				nDummy;
674 
675 #ifdef _OUTLINER_CXX
676 
677 	DECL_LINK( 				ParaVisibleStateChangedHdl, Paragraph* );
678 	DECL_LINK( 				BeginMovingParagraphsHdl, MoveParagraphsInfo* );
679 	DECL_LINK( 				EndMovingParagraphsHdl, MoveParagraphsInfo* );
680 	DECL_LINK( 				BeginPasteOrDropHdl, PasteOrDropInfos* );
681 	DECL_LINK( 				EndPasteOrDropHdl, PasteOrDropInfos* );
682 	DECL_LINK( 				EditEngineNotifyHdl, EENotify* );
683 
684     void ImplCheckParagraphs( sal_uInt32 nStart, sal_uInt32 nEnd );
685     bool ImplHasNumberFormat( sal_uInt32 nPara ) const;
686     Size ImplGetBulletSize( sal_uInt32 nPara );
687     sal_uInt16 ImplGetNumbering( sal_uInt32 nPara, const SvxNumberFormat* pParaFmt );
688     void ImplCalcBulletText( sal_uInt32 nPara, sal_Bool bRecalcLevel, sal_Bool bRecalcChilds );
689     String ImplGetBulletText( sal_uInt32 nPara );
690     void ImplCheckNumBulletItem( sal_uInt32 nPara );
691     void ImplInitDepth( sal_uInt32 nPara, sal_Int16 nDepth, sal_Bool bCreateUndo, sal_Bool bUndoAction = sal_False );
692     void ImplSetLevelDependendStyleSheet( sal_uInt32 nPara, SfxStyleSheet* pLevelStyle = NULL );
693 
694     void                    ImplBlockInsertionCallbacks( sal_Bool b );
695 
696 	void 				ImplCheckStyleSheet( sal_uInt32 nPara, sal_Bool bReplaceExistingStyle );
697 	void                ImpRecalcBulletIndent( sal_uLong nPara );
698 
699 	const SvxBulletItem& ImpGetBullet( sal_uLong nPara, sal_uInt16& );
700 	void        ImpFilterIndents( sal_uLong nFirstPara, sal_uLong nLastPara );
701 	bool		ImpConvertEdtToOut( sal_uInt32 nPara, EditView* pView = 0 );
702 
703 	void        ImpTextPasted( sal_uInt32 nStartPara, sal_uInt32 nCount );
704 	long 		ImpCalcMaxBulletWidth( sal_uInt32 nPara, const SvxBulletItem& rBullet );
705 	Font        ImpCalcBulletFont( sal_uInt32 nPara ) const;
706 	Rectangle   ImpCalcBulletArea( sal_uInt32 nPara, sal_Bool bAdjust, sal_Bool bReturnPaperPos );
707 	long 		ImpGetTextIndent( sal_uLong nPara );
708 	sal_Bool        ImpCanIndentSelectedPages( OutlinerView* pCurView );
709 	sal_Bool        ImpCanDeleteSelectedPages( OutlinerView* pCurView );
710 	sal_Bool        ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_uInt16 nFirstPage, sal_uInt16 nPages );
711 
ImplGetOutlinerMode() const712 	sal_uInt16		ImplGetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; }
713     void        ImplCheckDepth( sal_Int16& rnDepth ) const;
714 #endif
715 
716 protected:
717 	void        	ParagraphInserted( sal_uInt32 nParagraph );
718 	void        	ParagraphDeleted( sal_uInt32 nParagraph );
719 	void			ParaAttribsChanged( sal_uInt32 nParagraph );
720 
721 	virtual void 	StyleSheetChanged( SfxStyleSheet* pStyle );
722 
723 	void        InvalidateBullet( Paragraph* pPara, sal_uLong nPara );
724 	void        PaintBullet( sal_uInt32 nPara, const Point& rStartPos,
725 					const Point& rOrigin, short nOrientation,
726 					OutputDevice* pOutDev );
727 
728     // used by OutlinerEditEng. Allows Outliner objects to provide
729     // bullet access to the EditEngine.
730     virtual const SvxNumberFormat*  GetNumberFormat( sal_uInt32 nPara ) const;
731 
732 public:
733 
734 					Outliner( SfxItemPool* pPool, sal_uInt16 nOutlinerMode );
735 	virtual         ~Outliner();
736 
737 	void            Init( sal_uInt16 nOutlinerMode );
GetMode() const738 	sal_uInt16			GetMode() const { return nOutlinerMode; }
739 
740 	void			SetVertical( sal_Bool bVertical );
741 	sal_Bool			IsVertical() const;
742 
743 	void			SetFixedCellHeight( sal_Bool bUseFixedCellHeight );
744 	sal_Bool			IsFixedCellHeight() const;
745 
746     void                        SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir );
747     EEHorizontalTextDirection   GetDefaultHorizontalTextDirection() const;
748 
749     sal_uInt16			GetScriptType( const ESelection& rSelection ) const;
750     LanguageType    GetLanguage( sal_uInt32 nPara, sal_uInt16 nPos ) const;
751 
752 	void            SetAsianCompressionMode( sal_uInt16 nCompressionMode );
753 	sal_uInt16          GetAsianCompressionMode() const;
754 
755     void            SetKernAsianPunctuation( sal_Bool bEnabled );
756     sal_Bool            IsKernAsianPunctuation() const;
757 
758     void            SetAddExtLeading( sal_Bool b );
759     sal_Bool            IsAddExtLeading() const;
760 
761 	sal_uLong           InsertView( OutlinerView* pView, sal_uLong nIndex=LIST_APPEND);
762 	OutlinerView*   RemoveView( OutlinerView* pView );
763 	OutlinerView*   RemoveView( sal_uLong nIndex );
764 	OutlinerView*   GetView( sal_uLong nIndex ) const;
765 	sal_uLong           GetViewCount() const;
766 
767 	Paragraph*      Insert( const String& rText, sal_uLong nAbsPos = LIST_APPEND, sal_Int16 nDepth = 0 );
768 	void            SetText( const OutlinerParaObject& );
769 	void            AddText( const OutlinerParaObject& );
770 	void            SetText( const String& rText, Paragraph* pParagraph );
771 	String          GetText( Paragraph* pPara, sal_uLong nParaCount=1 ) const;
772 
773 	OutlinerParaObject* CreateParaObject( sal_uInt32 nStartPara = 0, sal_uInt32 nParaCount = EE_PARA_MAX ) const;
774 
775 	const SfxItemSet& GetEmptyItemSet() const;
776 
777 	void            SetRefMapMode( const MapMode& );
778 	MapMode         GetRefMapMode() const;
779 
780 	void			SetBackgroundColor( const Color& rColor );
781 	Color			GetBackgroundColor() const;
782 
GetMinDepth() const783 	sal_Int16		GetMinDepth() const { return -1; }
784 
785 	void            SetMaxDepth( sal_Int16 nDepth, sal_Bool bCheckParas = sal_False );
GetMaxDepth() const786 	sal_Int16          GetMaxDepth() const { return nMaxDepth; }
787 
788 	void            SetUpdateMode( sal_Bool bUpdate );
789 	sal_Bool            GetUpdateMode() const;
790 
791 	void            Clear();
792 
793     void            RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
794 
795 	sal_uLong           GetParagraphCount() const;
796 	Paragraph*      GetParagraph( sal_uLong nAbsPos ) const;
797 
798 	sal_Bool            HasParent( Paragraph* pParagraph ) const;
799 	sal_Bool            HasChilds( Paragraph* pParagraph ) const;
800 	sal_uLong           GetChildCount( Paragraph* pParent ) const;
801 	sal_Bool            IsExpanded( Paragraph* pPara ) const;
802 //	Paragraph*      GetParagraph( Paragraph* pParent, sal_uLong nRelPos ) const;
803 	Paragraph*      GetParent( Paragraph* pParagraph ) const;
804 //	sal_uLong           GetRelPos( Paragraph* pParent, Paragraph* pPara ) const;
805 	sal_uLong           GetAbsPos( Paragraph* pPara );
806 
807 	sal_Int16		GetDepth( sal_uLong nPara ) const;
808 	void			SetDepth( Paragraph* pParagraph, sal_Int16 nNewDepth );
809 
810 	void			SetVisible( Paragraph* pPara, sal_Bool bVisible );
IsVisible(Paragraph * pPara) const811 	sal_Bool            IsVisible( Paragraph* pPara ) const { return pPara->IsVisible(); }
812 
813 	void            EnableUndo( sal_Bool bEnable );
814 	sal_Bool            IsUndoEnabled() const;
815 	void            UndoActionStart( sal_uInt16 nId );
816 	void            UndoActionEnd( sal_uInt16 nId );
817 	void            InsertUndo( EditUndo* pUndo );
818 	sal_Bool            IsInUndo();
819 
820 	void            ClearModifyFlag();
821 	sal_Bool            IsModified() const;
822 
GetHdlParagraph() const823 	Paragraph*      GetHdlParagraph() const { return pHdlParagraph; }
IsExpanding() const824 	sal_Bool            IsExpanding() const { return bIsExpanding; }
825 
826 	virtual void    ExpandHdl();
SetExpandHdl(const Link & rLink)827 	void            SetExpandHdl( const Link& rLink ) { aExpandHdl = rLink; }
GetExpandHdl() const828 	Link            GetExpandHdl() const { return aExpandHdl; }
829 
830 	virtual void    ParagraphInsertedHdl();
SetParaInsertedHdl(const Link & rLink)831 	void            SetParaInsertedHdl(const Link& rLink){aParaInsertedHdl=rLink;}
GetParaInsertedHdl() const832 	Link            GetParaInsertedHdl() const { return aParaInsertedHdl; }
833 
834 	virtual void    ParagraphRemovingHdl();
SetParaRemovingHdl(const Link & rLink)835 	void            SetParaRemovingHdl(const Link& rLink){aParaRemovingHdl=rLink;}
GetParaRemovingHdl() const836 	Link            GetParaRemovingHdl() const { return aParaRemovingHdl; }
837 
838 	virtual void    DepthChangedHdl();
SetDepthChangedHdl(const Link & rLink)839 	void            SetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;}
GetDepthChangedHdl() const840 	Link            GetDepthChangedHdl() const { return aDepthChangedHdl; }
GetPrevDepth() const841 	sal_Int16       GetPrevDepth() const { return nDepthChangedHdlPrevDepth; }
GetPrevFlags() const842 	sal_uInt16			GetPrevFlags() const { return mnDepthChangeHdlPrevFlags; }
843 
844 	virtual long    RemovingPagesHdl( OutlinerView* );
SetRemovingPagesHdl(const Link & rLink)845 	void            SetRemovingPagesHdl(const Link& rLink){aRemovingPagesHdl=rLink;}
GetRemovingPagesHdl() const846 	Link            GetRemovingPagesHdl() const { return aRemovingPagesHdl; }
847 	virtual long    IndentingPagesHdl( OutlinerView* );
SetIndentingPagesHdl(const Link & rLink)848 	void            SetIndentingPagesHdl(const Link& rLink){aIndentingPagesHdl=rLink;}
GetIndentingPagesHdl() const849 	Link            GetIndentingPagesHdl() const { return aIndentingPagesHdl; }
850 	// nur gueltig in den beiden oberen Handlern
GetSelPageCount() const851 	sal_uInt16          GetSelPageCount() const { return nDepthChangedHdlPrevDepth; }
852 	// nur gueltig in den beiden oberen Handlern
GetFirstSelPage() const853 	sal_uLong           GetFirstSelPage() const { return mnFirstSelPage; }
854 
SetCalcFieldValueHdl(const Link & rLink)855 	void            SetCalcFieldValueHdl(const Link& rLink ) { aCalcFieldValueHdl= rLink; }
GetCalcFieldValueHdl() const856 	Link            GetCalcFieldValueHdl() const { return aCalcFieldValueHdl; }
857 
SetFieldClickedHdl(const Link & rLink)858 	void            SetFieldClickedHdl(const Link& rLink ) { aFieldClickedHdl= rLink; }
GetFieldClickedHdl() const859 	Link            GetFieldClickedHdl() const { return aFieldClickedHdl; }
860 
SetDrawPortionHdl(const Link & rLink)861 	void            SetDrawPortionHdl(const Link& rLink){aDrawPortionHdl=rLink;}
GetDrawPortionHdl() const862 	Link            GetDrawPortionHdl() const { return aDrawPortionHdl; }
863 
SetDrawBulletHdl(const Link & rLink)864     void            SetDrawBulletHdl(const Link& rLink){aDrawBulletHdl=rLink;}
GetDrawBulletHdl() const865 	Link            GetDrawBulletHdl() const { return aDrawBulletHdl; }
866 
SetPaintFirstLineHdl(const Link & rLink)867 	void			SetPaintFirstLineHdl(const Link& rLink) { maPaintFirstLineHdl = rLink; }
GetPaintFirstLineHdl() const868 	Link			GetPaintFirstLineHdl() const { return maPaintFirstLineHdl; }
869 
870 	void			SetModifyHdl( const Link& rLink );
871 	Link			GetModifyHdl() const;
872 
873 	void            SetNotifyHdl( const Link& rLink );
874 	Link            GetNotifyHdl() const;
875 
876 	void            SetStatusEventHdl( const Link& rLink );
877 	Link            GetStatusEventHdl() const;
878 
879 	void            Draw( OutputDevice* pOutDev, const Rectangle& rOutRect );
880 	void            Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const Point& rStartDocPos );
881 	void            Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 );
882 
883 	const Size&     GetPaperSize() const;
884 	void            SetPaperSize( const Size& rSize );
885 
SetFirstPageNumber(sal_uInt16 n)886 	void			SetFirstPageNumber( sal_uInt16 n ) 	{ nFirstPage = n; }
GetFirstPageNumber() const887 	sal_uInt16			GetFirstPageNumber() const 		{ return nFirstPage; }
888 
889 	void				SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon );
890 	void				SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon);
891 	void				ClearPolygon();
892 	const PolyPolygon*	GetPolygon();
893 
894 	const Size&     GetMinAutoPaperSize() const;
895 	void            SetMinAutoPaperSize( const Size& rSz );
896 
897 	const Size&     GetMaxAutoPaperSize() const;
898 	void            SetMaxAutoPaperSize( const Size& rSz );
899 
900 	void            SetDefTab( sal_uInt16 nTab );
901 	sal_uInt16          GetDefTab() const;
902 
903 	sal_Bool			IsFlatMode() const;
904 	void			SetFlatMode( sal_Bool bFlat );
905 
906     void            EnableAutoColor( sal_Bool b );
907     sal_Bool            IsAutoColorEnabled() const;
908 
909     void            ForceAutoColor( sal_Bool b );
910     sal_Bool            IsForceAutoColor() const;
911 
912     EBulletInfo     GetBulletInfo( sal_uInt32 nPara );
913 
914 	void        SetWordDelimiters( const String& rDelimiters );
915 	String      GetWordDelimiters() const;
916 	String      GetWord( sal_uInt32 nPara, xub_StrLen nIndex );
917 
918 	void            StripPortions();
919 
920 	// #101498#
921 	virtual void DrawingText(
922         const Point& rStartPos, const String& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen,
923 		const sal_Int32* pDXArray, const SvxFont& rFont, sal_uInt32 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
924         const EEngineData::WrongSpellVector* pWrongSpellVector,
925         const SvxFieldData* pFieldData,
926         bool bEndOfLine,
927         bool bEndOfParagraph,
928         bool bEndOfBullet,
929         const ::com::sun::star::lang::Locale* pLocale,
930         const Color& rOverlineColor,
931         const Color& rTextLineColor);
932 
933 	Size            CalcTextSize();
934 
935 	Point           GetDocPos( Paragraph* pPara );
936 
937 	void            	SetStyleSheetPool( SfxStyleSheetPool* pSPool );
938 	SfxStyleSheetPool*	GetStyleSheetPool();
939 
940 	sal_Bool            IsInSelectionMode() const;
941 
942 	void            SetStyleSheet( sal_uLong nPara, SfxStyleSheet* pStyle );
943 	SfxStyleSheet*	GetStyleSheet( sal_uLong nPara );
944 
945 	void            SetParaAttribs( sal_uInt32 nPara, const SfxItemSet& );
946 	SfxItemSet      GetParaAttribs( sal_uInt32 nPara );
947 
948 	void            Remove( Paragraph* pPara, sal_uLong nParaCount );
949 	sal_Bool            Expand( Paragraph* );
950 	sal_Bool            Collapse( Paragraph* );
951 
952 	void			SetParaFlag( Paragraph* pPara,  sal_uInt16 nFlag );
953 	void			RemoveParaFlag( Paragraph* pPara, sal_uInt16 nFlag );
954 	bool			HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const;
955 
956 	// gibt ein Array mit den Bulletbreiten der n Einrueckebenen
957 	// zurueck. Letzter Wert muss -1 sein. Wird vom Outliner geloescht.
GetWidthArrReqHdl() const958 	Link            GetWidthArrReqHdl() const{ return aWidthArrReqHdl; }
SetWidthArrReqHdl(const Link & rLink)959 	void            SetWidthArrReqHdl(const Link& rLink){aWidthArrReqHdl=rLink; }
960 
961 	void            SetControlWord( sal_uLong nWord );
962 	sal_uLong           GetControlWord() const;
963 
GetBeginMovingHdl() const964 	Link            GetBeginMovingHdl() const { return aBeginMovingHdl; }
SetBeginMovingHdl(const Link & rLink)965 	void            SetBeginMovingHdl(const Link& rLink) {aBeginMovingHdl=rLink;}
GetEndMovingHdl() const966 	Link            GetEndMovingHdl() const {return aEndMovingHdl;}
SetEndMovingHdl(const Link & rLink)967 	void            SetEndMovingHdl( const Link& rLink){aEndMovingHdl=rLink;}
968 
969 	sal_uLong           GetLineCount( sal_uLong nParagraph ) const;
970 	sal_uInt16          GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const;
971 	sal_uLong           GetLineHeight( sal_uLong nParagraph, sal_uLong nLine = 0 );
972 
973 	// nFormat muss ein Wert aus dem enum EETextFormat sein (wg.CLOOKS)
974     sal_uLong           Read( SvStream& rInput, const String& rBaseURL, sal_uInt16, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
975 
976     ::svl::IUndoManager& GetUndoManager();
977     ::svl::IUndoManager* SetUndoManager(::svl::IUndoManager* pNew);
978 
979 	void            QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
980 	void            QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
981 	void 			QuickInsertLineBreak( const ESelection& rSel );
982 
983 	// nur fuer EditEngine-Modus
984 	void            QuickInsertText( const String& rText, const ESelection& rSel );
985 	void            QuickDelete( const ESelection& rSel );
986 	void            QuickRemoveCharAttribs( sal_uInt32 nPara, sal_uInt16 nWhich = 0 );
987 	void            QuickFormatDoc( sal_Bool bFull = sal_False );
988 
989 	sal_Bool            UpdateFields();
990 	void 			RemoveFields( sal_Bool bKeepFieldText, TypeId aType = NULL );
991 
992 	virtual void    FieldClicked( const SvxFieldItem& rField, sal_uInt32 nPara, xub_StrLen nPos );
993 	virtual void    FieldSelected( const SvxFieldItem& rField, sal_uInt32 nPara, xub_StrLen nPos );
994 	virtual String  CalcFieldValue( const SvxFieldItem& rField, sal_uInt32 nPara, xub_StrLen nPos, Color*& rTxtColor, Color*& rFldColor );
995 
996 	void			SetSpeller( ::com::sun::star::uno::Reference<
997 							::com::sun::star::linguistic2::XSpellChecker1 > &xSpeller );
998 	::com::sun::star::uno::Reference<
999 		::com::sun::star::linguistic2::XSpellChecker1 >
1000 					GetSpeller();
1001 	::com::sun::star::uno::Reference<
1002 		::com::sun::star::linguistic2::XHyphenator >
1003 					GetHyphenator() const;
1004 	void			SetHyphenator( ::com::sun::star::uno::Reference<
1005 						::com::sun::star::linguistic2::XHyphenator >& xHyph );
1006 
1007 	void			SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars );
1008 	vos::ORef<SvxForbiddenCharactersTable>	GetForbiddenCharsTable() const;
1009 
1010 	// Depricated
1011 	void 			SetDefaultLanguage( LanguageType eLang );
1012 	LanguageType	GetDefaultLanguage() const;
1013 
1014 	sal_Bool			HasOnlineSpellErrors() const;
1015 	void			CompleteOnlineSpelling();
1016 
1017 	EESpellState    HasSpellErrors();
1018 	sal_Bool            HasText( const SvxSearchItem& rSearchItem );
1019 	virtual sal_Bool    SpellNextDocument();
1020 
1021     // for text conversion
1022     sal_Bool        HasConvertibleTextPortion( LanguageType nLang );
1023     virtual sal_Bool    ConvertNextDocument();
1024 
1025 	void            SetEditTextObjectPool( SfxItemPool* pPool );
1026 	SfxItemPool*    GetEditTextObjectPool() const;
1027 
1028 	void            SetRefDevice( OutputDevice* pRefDev );
1029 	OutputDevice*   GetRefDevice() const;
1030 
1031 	sal_uInt16          GetFirstLineOffset( sal_uLong nParagraph );
1032 
1033 	sal_uLong           GetTextHeight() const;
1034 	sal_uLong           GetTextHeight( sal_uLong nParagraph ) const;
1035 	Point           GetDocPosTopLeft( sal_uLong nParagraph );
1036 	Point			GetDocPos( const Point& rPaperPos ) const;
1037 	sal_Bool			IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder = 0 );
1038 	sal_Bool			IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder, sal_Bool* pbBuuletPos );
1039 
1040 	void            SetGlobalCharStretching( sal_uInt16 nX = 100, sal_uInt16 nY = 100 );
1041 	void            GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY );
1042 	void            DoStretchChars( sal_uInt16 nX, sal_uInt16 nY );
1043 	void            EraseVirtualDevice();
1044 
1045 	void            SetBigTextObjectStart( sal_uInt16 nStartAtPortionCount );
1046 	sal_uInt16          GetBigTextObjectStart() const;
1047 	sal_Bool            ShouldCreateBigTextObject() const;
1048 
GetEditEngine() const1049 	const EditEngine& GetEditEngine() const { return *((EditEngine*)pEditEngine); }
1050 
1051 	// this is needed for StarOffice Api
1052 	void SetLevelDependendStyleSheet( sal_uInt32 nPara );
1053 
GetOutlinerMode() const1054 	sal_uInt16	GetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; }
1055 
1056     void            StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc);
1057     //spell and return a sentence
1058     bool            SpellSentence(EditView& rEditView, ::svx::SpellPortions& rToFill, bool bIsGrammarChecking );
1059     // put spell position to start of current sentence
1060     void            PutSpellingToSentenceStart( EditView& rEditView );
1061     //applies a changed sentence
1062     void            ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck );
1063     void            EndSpelling();
1064 
1065 	/** sets a link that is called at the beginning of a drag operation at an edit view */
1066 	void			SetBeginDropHdl( const Link& rLink );
1067 	Link			GetBeginDropHdl() const;
1068 
1069 	/** sets a link that is called at the end of a drag operation at an edit view */
1070 	void			SetEndDropHdl( const Link& rLink );
1071 	Link			GetEndDropHdl() const;
1072 
1073     /** sets a link that is called before a drop or paste operation. */
1074     void            SetBeginPasteOrDropHdl( const Link& rLink );
GetBeginPasteOrDropHdl() const1075     Link            GetBeginPasteOrDropHdl() const { return maBeginPasteOrDropHdl; }
1076 
1077     /** sets a link that is called after a drop or paste operation. */
1078     void            SetEndPasteOrDropHdl( const Link& rLink );
GetEndPasteOrDropHdl() const1079     Link            GetEndPasteOrDropHdl() const { return maEndPasteOrDropHdl; }
1080 
1081     virtual sal_Int16 GetNumberingStartValue( sal_uInt32 nPara );
1082     virtual void SetNumberingStartValue( sal_uInt32 nPara, sal_Int16 nNumberingStartValue );
1083 
1084     virtual sal_Bool IsParaIsNumberingRestart( sal_uInt32 nPara );
1085     virtual void SetParaIsNumberingRestart( sal_uInt32 nPara, sal_Bool bParaIsNumberingRestart );
1086 
1087     /** determine the bullets/numbering status of the given paragraphs
1088 
1089         @param nParaStart
1090         index of paragraph at which the check starts
1091 
1092         @param nParaEnd
1093         index of paragraph at which the check ends
1094 
1095         @returns
1096         0 : all paragraphs have bullets
1097         1 : all paragraphs have numbering
1098         2 : otherwise
1099     */
1100     sal_Int16 GetBulletsNumberingStatus(
1101         const sal_uInt32 nParaStart,
1102         const sal_uInt32 nParaEnd ) const;
1103 
1104     // convenient method to determine the bullets/numbering status for all paragraphs
1105     sal_Int16 GetBulletsNumberingStatus() const;
1106 };
1107 
1108 #endif
1109 
1110