xref: /trunk/main/editeng/inc/editeng/unoforou.hxx (revision 1bf365f0)
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 
24 #ifndef _SVX_UNOFOROU_HXX
25 #define _SVX_UNOFOROU_HXX
26 
27 #include <editeng/unoedsrc.hxx>
28 #include "editeng/editengdllapi.h"
29 
30 #include <editeng/editdata.hxx>
31 
32 class Outliner;
33 
34 //	SvxOutlinerForwarder - SvxTextForwarder fuer Outliner
35 
36 class EDITENG_DLLPUBLIC SvxOutlinerForwarder : public SvxTextForwarder
37 {
38 private:
39 	Outliner&			rOutliner;
40     sal_Bool				bOutlinerText;
41 
42 	/** this pointer may be null or point to an item set for the attribs of
43 		the selection maAttribsSelection */
44 	mutable SfxItemSet* mpAttribsCache;
45 
46 	/** if we have a chached attribute item set, this is the selection of it */
47 	mutable ESelection	maAttribCacheSelection;
48 
49 	/** this pointer may be null or point to an item set for the paragraph
50 		mnParaAttribsCache */
51 	mutable SfxItemSet*	mpParaAttribsCache;
52 
53 	/** if we have a cached para attribute item set, this is the paragraph of it */
54 	mutable sal_uInt16		mnParaAttribsCache;
55 
56 public:
57 						SvxOutlinerForwarder( Outliner& rOutl, sal_Bool bOutlText = sal_False );
58 	virtual				~SvxOutlinerForwarder();
59 
60 	virtual sal_uInt32		GetParagraphCount() const;
61 	virtual sal_uInt16		GetTextLen( sal_uInt32 nParagraph ) const;
62 	virtual String		GetText( const ESelection& rSel ) const;
63 	virtual SfxItemSet	GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
64 	virtual	SfxItemSet	GetParaAttribs( sal_uInt32 nPara ) const;
65 	virtual void		SetParaAttribs( sal_uInt32 nPara, const SfxItemSet& rSet );
66     virtual void        RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
67 	virtual void		GetPortions( sal_uInt32 nPara, SvUShorts& rList ) const;
68 
69 	virtual sal_uInt16		GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
70 	virtual sal_uInt16		GetItemState( sal_uInt32 nPara, sal_uInt16 nWhich ) const;
71 
72 	virtual void		QuickInsertText( const String& rText, const ESelection& rSel );
73 	virtual void		QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
74 	virtual void		QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
75 	virtual void		QuickInsertLineBreak( const ESelection& rSel );
76 
77 	virtual SfxItemPool* GetPool() const;
78 
79 	virtual XubString    CalcFieldValue( const SvxFieldItem& rField, sal_uInt32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
80 	virtual void 	     FieldClicked( const SvxFieldItem& rField, sal_uInt32 nPara, xub_StrLen nPos );
81 
82 	virtual sal_Bool		IsValid() const;
83 
GetOutliner() const84 	Outliner&			GetOutliner() const { return rOutliner; }
85 
86     virtual LanguageType 	GetLanguage( sal_uInt32 nPara, sal_uInt16 nIndex ) const;
87     virtual sal_uInt16			GetFieldCount( sal_uInt32 nPara ) const;
88     virtual EFieldInfo		GetFieldInfo( sal_uInt32 nPara, sal_uInt16 nField ) const;
89     virtual EBulletInfo     GetBulletInfo( sal_uInt32 nPara ) const;
90     virtual Rectangle		GetCharBounds( sal_uInt32 nPara, sal_uInt16 nIndex ) const;
91     virtual Rectangle		GetParaBounds( sal_uInt32 nPara ) const;
92     virtual MapMode			GetMapMode() const;
93 	virtual OutputDevice*	GetRefDevice() const;
94     virtual sal_Bool		GetIndexAtPoint( const Point&, sal_uInt32& nPara, sal_uInt16& nIndex ) const;
95     virtual sal_Bool		GetWordIndices( sal_uInt32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
96     virtual sal_Bool 		GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt32 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const;
97     virtual sal_uInt16			GetLineCount( sal_uInt32 nPara ) const;
98     virtual sal_uInt16			GetLineLen( sal_uInt32 nPara, sal_uInt16 nLine ) const;
99     virtual void            GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt32 nPara, sal_uInt16 nLine ) const;
100     virtual sal_uInt16          GetLineNumberAtIndex( sal_uInt32 nPara, sal_uInt16 nIndex ) const;
101     virtual sal_Bool		Delete( const ESelection& );
102     virtual sal_Bool		InsertText( const String&, const ESelection& );
103     virtual sal_Bool		QuickFormatDoc( sal_Bool bFull=sal_False );
104     virtual sal_Int16		GetDepth( sal_uInt32 nPara ) const;
105     virtual sal_Bool		SetDepth( sal_uInt32 nPara, sal_Int16 nNewDepth );
106     virtual sal_Int16       GetNumberingStartValue( sal_uInt32 nPara );
107     virtual void            SetNumberingStartValue( sal_uInt32 nPara, sal_Int16 nNumberingStartValue );
108 
109     virtual sal_Bool        IsParaIsNumberingRestart( sal_uInt32 nPara );
110     virtual void            SetParaIsNumberingRestart( sal_uInt32 nPara, sal_Bool bParaIsNumberingRestart );
111 
112 	/* this method flushes internal caches for this forwarder */
113 	void				flushCache();
114 
115     virtual const SfxItemSet*   GetEmptyItemSetPtr();
116 
117     // implementation functions for XParagraphAppend and XTextPortionAppend
118     virtual void        AppendParagraph();
119     virtual xub_StrLen  AppendTextPortion( sal_uInt32 nPara, const String &rText, const SfxItemSet &rSet );
120     //XTextCopy
121     virtual void        CopyText(const SvxTextForwarder& rSource);
122 };
123 
124 #endif
125 
126