xref: /AOO41X/main/sw/inc/expfld.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef SW_EXPFLD_HXX
24cdf0e10cSrcweir #define SW_EXPFLD_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <svl/svarray.hxx>
27cdf0e10cSrcweir #include "swdllapi.h"
28cdf0e10cSrcweir #include <fldbas.hxx>
29cdf0e10cSrcweir #include <cellfml.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class SfxPoolItem;
32cdf0e10cSrcweir class SwTxtNode;
33cdf0e10cSrcweir class SwFrm;
34cdf0e10cSrcweir struct SwPosition;
35cdf0e10cSrcweir class SwTxtFld;
36cdf0e10cSrcweir class SwDoc;
37cdf0e10cSrcweir class SwFmtFld;
38cdf0e10cSrcweir class _SetGetExpFlds;
39cdf0e10cSrcweir class SwEditShell;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir // Vorwaertsdeklaration: besorge den "Body-TextNode", fuer Exp.Fld in Fly's
42cdf0e10cSrcweir //						Header/Footers/Footnodes
43cdf0e10cSrcweir const SwTxtNode* GetBodyTxtNode( const SwDoc& pDoc, SwPosition& rPos,
44cdf0e10cSrcweir 								 const SwFrm& rFrm );
45cdf0e10cSrcweir // Wandlung Address -> Adressen
46cdf0e10cSrcweir void ReplacePoint(String& sTmpName, sal_Bool bWithCommandType = sal_False);
47cdf0e10cSrcweir 
48cdf0e10cSrcweir struct _SeqFldLstElem
49cdf0e10cSrcweir {
50cdf0e10cSrcweir 	String sDlgEntry;
51cdf0e10cSrcweir 	sal_uInt16 nSeqNo;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	_SeqFldLstElem( const String& rStr, sal_uInt16 nNo )
54cdf0e10cSrcweir 		: sDlgEntry( rStr ), nSeqNo( nNo )
55cdf0e10cSrcweir 	{}
56cdf0e10cSrcweir };
57cdf0e10cSrcweir SV_DECL_PTRARR_DEL( _SwSeqFldList, _SeqFldLstElem*, 10, 10 )
58cdf0e10cSrcweir 
59cdf0e10cSrcweir class SW_DLLPUBLIC SwSeqFldList : public _SwSeqFldList
60cdf0e10cSrcweir {
61cdf0e10cSrcweir public:
62cdf0e10cSrcweir 	SwSeqFldList()	: _SwSeqFldList( 10, 10 ) {}
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	sal_Bool InsertSort( _SeqFldLstElem* );
65cdf0e10cSrcweir 	sal_Bool SeekEntry( const _SeqFldLstElem& , sal_uInt16* pPos = 0 );
66cdf0e10cSrcweir };
67cdf0e10cSrcweir 
68cdf0e10cSrcweir /*--------------------------------------------------------------------
69cdf0e10cSrcweir 	Beschreibung: Ausdruck
70cdf0e10cSrcweir  --------------------------------------------------------------------*/
71cdf0e10cSrcweir 
72cdf0e10cSrcweir class SwGetExpFieldType : public SwValueFieldType
73cdf0e10cSrcweir {
74cdf0e10cSrcweir public:
75cdf0e10cSrcweir 		SwGetExpFieldType(SwDoc* pDoc);
76cdf0e10cSrcweir 		virtual SwFieldType*    Copy() const;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 		// ueberlagert, weil das Get-Field nicht veraendert werden kann
79cdf0e10cSrcweir 		// und dann auch nicht aktualisiert werden muss. Aktualisierung
80cdf0e10cSrcweir 		// erfolgt beim Aendern von Set-Werten !
81cdf0e10cSrcweir protected:
82cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
83cdf0e10cSrcweir };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir /*--------------------------------------------------------------------
86cdf0e10cSrcweir 	Beschreibung: GetExperession
87cdf0e10cSrcweir  --------------------------------------------------------------------*/
88cdf0e10cSrcweir 
89cdf0e10cSrcweir class SW_DLLPUBLIC SwGetExpField : public SwFormulaField
90cdf0e10cSrcweir {
91cdf0e10cSrcweir 	String 			sExpand;
92cdf0e10cSrcweir 	sal_Bool 			bIsInBodyTxt;
93cdf0e10cSrcweir 	sal_uInt16			nSubType;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     bool            bLateInitialization; // #i82544#
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     virtual String              Expand() const;
98cdf0e10cSrcweir     virtual SwField*            Copy() const;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir public:
101cdf0e10cSrcweir 	SwGetExpField( SwGetExpFieldType*, const String& rFormel,
102cdf0e10cSrcweir 				   sal_uInt16 nSubType = nsSwGetSetExpType::GSE_EXPR, sal_uLong nFmt = 0);
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	virtual void 				SetValue( const double& rVal );
105cdf0e10cSrcweir 	virtual void				SetLanguage(sal_uInt16 nLng);
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	inline const String& 		GetExpStr() const;
108cdf0e10cSrcweir 	inline void  				ChgExpStr(const String& rExpand);
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	// wird von der Formatierung abgefragt
111cdf0e10cSrcweir 	inline sal_Bool 				IsInBodyTxt() const;
112cdf0e10cSrcweir 	// wird von UpdateExpFlds gesetzt (dort ist die Node-Position bekannt)
113cdf0e10cSrcweir 	inline void 				ChgBodyTxtFlag( sal_Bool bIsInBody );
114cdf0e10cSrcweir 	// fuer Felder in Header/Footer/Footnotes/Flys:
115cdf0e10cSrcweir 	// (wird nur von der Formatierung aufgerufen!!)
116cdf0e10cSrcweir 	void 						ChangeExpansion( const SwFrm&, const SwTxtFld& );
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     virtual String      GetFieldName() const;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	// Die Formel aendern
121cdf0e10cSrcweir 	virtual String				GetPar2() const;
122cdf0e10cSrcweir 	virtual void				SetPar2(const String& rStr);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	virtual sal_uInt16				GetSubType() const;
125cdf0e10cSrcweir 	virtual void				SetSubType(sal_uInt16 nType);
126cdf0e10cSrcweir     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
127cdf0e10cSrcweir     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 	static sal_uInt16 		GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc);
130cdf0e10cSrcweir     // #i82544#
131cdf0e10cSrcweir     void				SetLateInitialization() { bLateInitialization = true;}
132cdf0e10cSrcweir };
133cdf0e10cSrcweir 
134cdf0e10cSrcweir inline void SwGetExpField::ChgExpStr(const String& rExpand)
135cdf0e10cSrcweir 	{ sExpand = rExpand;}
136cdf0e10cSrcweir 
137cdf0e10cSrcweir inline const String& SwGetExpField::GetExpStr() const
138cdf0e10cSrcweir 	{ return sExpand; 	}
139cdf0e10cSrcweir 
140cdf0e10cSrcweir // wird von der Formatierung abgefragt
141cdf0e10cSrcweir inline sal_Bool SwGetExpField::IsInBodyTxt() const
142cdf0e10cSrcweir 	{ return bIsInBodyTxt; }
143cdf0e10cSrcweir 
144cdf0e10cSrcweir // wird von UpdateExpFlds gesetzt (dort ist die Node-Position bekannt)
145cdf0e10cSrcweir inline void SwGetExpField::ChgBodyTxtFlag( sal_Bool bIsInBody )
146cdf0e10cSrcweir 	{ bIsInBodyTxt = bIsInBody; }
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 
149cdf0e10cSrcweir /*--------------------------------------------------------------------
150cdf0e10cSrcweir 	Beschreibung: Ausdruck setzen
151cdf0e10cSrcweir  --------------------------------------------------------------------*/
152cdf0e10cSrcweir 
153cdf0e10cSrcweir class SwSetExpField;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir class SW_DLLPUBLIC SwSetExpFieldType : public SwValueFieldType
156cdf0e10cSrcweir {
157cdf0e10cSrcweir 	String 		sName;
158cdf0e10cSrcweir 	const SwNode* pOutlChgNd;
159cdf0e10cSrcweir 	String		sDelim;
160cdf0e10cSrcweir 	sal_uInt16 		nType;
161cdf0e10cSrcweir 	sal_uInt8		nLevel;
162cdf0e10cSrcweir 	sal_Bool		bDeleted;
163cdf0e10cSrcweir 
164cdf0e10cSrcweir protected:
165cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
166cdf0e10cSrcweir 
167cdf0e10cSrcweir public:
168cdf0e10cSrcweir 	SwSetExpFieldType( SwDoc* pDoc, const String& rName,
169cdf0e10cSrcweir 						sal_uInt16 nType = nsSwGetSetExpType::GSE_EXPR );
170cdf0e10cSrcweir 	virtual SwFieldType*    Copy() const;
171cdf0e10cSrcweir 	virtual const String&	GetName() const;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 	inline void				SetType(sal_uInt16 nTyp);
174cdf0e10cSrcweir 	inline sal_uInt16			GetType() const;
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 	void					SetSeqFormat(sal_uLong nFormat);
177cdf0e10cSrcweir 	sal_uLong					GetSeqFormat();
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 	sal_Bool					IsDeleted() const 		{ return bDeleted; }
180cdf0e10cSrcweir 	void					SetDeleted( sal_Bool b )	{ bDeleted = b; }
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 	// ueberlagert, weil das Set-Field selbst dafuer sorgt, das
183cdf0e10cSrcweir 	// es aktualisiert wird.
184cdf0e10cSrcweir 	inline const String& 	GetSetRefName() const;
185cdf0e10cSrcweir 
186cdf0e10cSrcweir 	sal_uInt16 SetSeqRefNo( SwSetExpField& rFld );
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 	sal_uInt16 GetSeqFldList( SwSeqFldList& rList );
189cdf0e10cSrcweir 	String MakeSeqName( sal_uInt16 nSeqNo );
190cdf0e10cSrcweir 
191cdf0e10cSrcweir 	// Seqencefelder ggfs. Kapitelweise numerieren
192cdf0e10cSrcweir //	sal_Unicode GetDelimiter() const 		{ return cDelim; }
193cdf0e10cSrcweir //	void SetDelimiter( sal_Unicode c ) 		{ cDelim = c; }
194cdf0e10cSrcweir 	const String& GetDelimiter() const 		{ return sDelim; }
195cdf0e10cSrcweir 	void SetDelimiter( const String& s ) 	{ sDelim = s; }
196cdf0e10cSrcweir 	sal_uInt8 GetOutlineLvl() const 				{ return nLevel; }
197cdf0e10cSrcweir 	void SetOutlineLvl( sal_uInt8 n ) 			{ nLevel = n; }
198cdf0e10cSrcweir 	void SetChapter( SwSetExpField& rFld, const SwNode& rNd );
199cdf0e10cSrcweir 	// Member nur fuers SwDoc::UpdateExpFld - wird nur waehrend der Laufzeit
200cdf0e10cSrcweir 	// von SequencefeldTypen benoetigt!!!
201cdf0e10cSrcweir 	const SwNode* GetOutlineChgNd() const	{ return pOutlChgNd; }
202cdf0e10cSrcweir 	void SetOutlineChgNd( const SwNode* p )	{ pOutlChgNd = p; }
203cdf0e10cSrcweir 
204cdf0e10cSrcweir     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
205cdf0e10cSrcweir     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
206cdf0e10cSrcweir };
207cdf0e10cSrcweir 
208cdf0e10cSrcweir inline void SwSetExpFieldType::SetType( sal_uInt16 nTyp )
209cdf0e10cSrcweir {
210cdf0e10cSrcweir 		nType = nTyp;
211cdf0e10cSrcweir 		EnableFormat( !(nType & (nsSwGetSetExpType::GSE_SEQ|nsSwGetSetExpType::GSE_STRING)));
212cdf0e10cSrcweir }
213cdf0e10cSrcweir 
214cdf0e10cSrcweir inline sal_uInt16 SwSetExpFieldType::GetType() const
215cdf0e10cSrcweir 	{ return nType;	  }
216cdf0e10cSrcweir 
217cdf0e10cSrcweir inline const String& SwSetExpFieldType::GetSetRefName() const
218cdf0e10cSrcweir 	{ return sName; }
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 
221cdf0e10cSrcweir /*--------------------------------------------------------------------
222cdf0e10cSrcweir 	Beschreibung: Ausdruck
223cdf0e10cSrcweir  --------------------------------------------------------------------*/
224cdf0e10cSrcweir 
225cdf0e10cSrcweir class SW_DLLPUBLIC SwSetExpField : public SwFormulaField
226cdf0e10cSrcweir {
227cdf0e10cSrcweir 	String 			sExpand;
228cdf0e10cSrcweir 	String			aPText;
229cdf0e10cSrcweir 	String			aSeqText;
230cdf0e10cSrcweir 	sal_Bool			bInput;
231cdf0e10cSrcweir 	sal_uInt16 			nSeqNo;
232cdf0e10cSrcweir 	sal_uInt16			nSubType;
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     virtual String              Expand() const;
235cdf0e10cSrcweir     virtual SwField*            Copy() const;
236cdf0e10cSrcweir 
237cdf0e10cSrcweir public:
238cdf0e10cSrcweir 	SwSetExpField(SwSetExpFieldType*, const String& rFormel, sal_uLong nFmt = 0);
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 	virtual void 				SetValue( const double& rVal );
241cdf0e10cSrcweir 
242cdf0e10cSrcweir 	inline const String& 		GetExpStr() const;
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 	inline void 				ChgExpStr( const String& rExpand );
245cdf0e10cSrcweir 
246cdf0e10cSrcweir 	inline void  				SetPromptText(const String& rStr);
247cdf0e10cSrcweir 	inline const 				String& GetPromptText() const;
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 	inline void  				SetInputFlag(sal_Bool bInp);
250cdf0e10cSrcweir 	inline sal_Bool					GetInputFlag() const;
251cdf0e10cSrcweir 
252cdf0e10cSrcweir     virtual String              GetFieldName() const;
253cdf0e10cSrcweir 
254cdf0e10cSrcweir 	virtual sal_uInt16				GetSubType() const;
255cdf0e10cSrcweir 	virtual void				SetSubType(sal_uInt16 nType);
256cdf0e10cSrcweir 
257cdf0e10cSrcweir 	inline sal_Bool 				IsSequenceFld() const;
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 	// fuer SequenceFelder - logische Nummer
260cdf0e10cSrcweir 	inline void					SetSeqNumber( sal_uInt16 n )	{ nSeqNo = n; }
261cdf0e10cSrcweir 	inline sal_uInt16				GetSeqNumber() const		{ return nSeqNo; }
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 	// Der Name nur erfragen
264cdf0e10cSrcweir 	virtual const String&		GetPar1() 	const;
265cdf0e10cSrcweir 
266cdf0e10cSrcweir 	// Die Formel
267cdf0e10cSrcweir 	virtual String				GetPar2() 	const;
268cdf0e10cSrcweir 	virtual void				SetPar2(const String& rStr);
269cdf0e10cSrcweir     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
270cdf0e10cSrcweir     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
271cdf0e10cSrcweir };
272cdf0e10cSrcweir 
273cdf0e10cSrcweir inline const String& SwSetExpField::GetExpStr() const
274cdf0e10cSrcweir 	{ return sExpand; 		}
275cdf0e10cSrcweir 
276cdf0e10cSrcweir inline void SwSetExpField::ChgExpStr( const String& rExpand )
277cdf0e10cSrcweir 	{ sExpand = rExpand; 	}
278cdf0e10cSrcweir 
279cdf0e10cSrcweir inline void  SwSetExpField::SetPromptText(const String& rStr)
280cdf0e10cSrcweir 	{ aPText = rStr;  		}
281cdf0e10cSrcweir 
282cdf0e10cSrcweir inline const String& SwSetExpField::GetPromptText() const
283cdf0e10cSrcweir 	{ return aPText;  		}
284cdf0e10cSrcweir 
285cdf0e10cSrcweir inline void SwSetExpField::SetInputFlag(sal_Bool bInp)
286cdf0e10cSrcweir 	{ bInput = bInp; }
287cdf0e10cSrcweir 
288cdf0e10cSrcweir inline sal_Bool	SwSetExpField::GetInputFlag() const
289cdf0e10cSrcweir 	{ return bInput; }
290cdf0e10cSrcweir 
291cdf0e10cSrcweir inline sal_Bool SwSetExpField::IsSequenceFld() const
292cdf0e10cSrcweir 	{ return 0 != (nsSwGetSetExpType::GSE_SEQ & ((SwSetExpFieldType*)GetTyp())->GetType()); }
293cdf0e10cSrcweir 
294cdf0e10cSrcweir /*--------------------------------------------------------------------
295cdf0e10cSrcweir 	Beschreibung: Eingabe im Text/Variable setzen
296cdf0e10cSrcweir  --------------------------------------------------------------------*/
297cdf0e10cSrcweir 
298cdf0e10cSrcweir class SwInputFieldType : public SwFieldType
299cdf0e10cSrcweir {
300cdf0e10cSrcweir 	SwDoc* pDoc;
301cdf0e10cSrcweir public:
302cdf0e10cSrcweir 	SwInputFieldType( SwDoc* pDoc );
303cdf0e10cSrcweir 
304cdf0e10cSrcweir 	virtual SwFieldType* Copy() const;
305cdf0e10cSrcweir 
306cdf0e10cSrcweir 	SwDoc* GetDoc() const { return pDoc; }
307cdf0e10cSrcweir };
308cdf0e10cSrcweir 
309cdf0e10cSrcweir /*--------------------------------------------------------------------
310cdf0e10cSrcweir 	Beschreibung: Eingabefeld
311cdf0e10cSrcweir  --------------------------------------------------------------------*/
312cdf0e10cSrcweir 
313cdf0e10cSrcweir class SW_DLLPUBLIC SwInputField : public SwField
314cdf0e10cSrcweir {
315cdf0e10cSrcweir 	String  aContent;
316cdf0e10cSrcweir 	String	aPText;
317cdf0e10cSrcweir     String  aHelp;
318cdf0e10cSrcweir     String  aToolTip;
319cdf0e10cSrcweir 	sal_uInt16  nSubType;
320cdf0e10cSrcweir 
321cdf0e10cSrcweir     virtual String          Expand() const;
322cdf0e10cSrcweir     virtual SwField*        Copy() const;
323cdf0e10cSrcweir 
324cdf0e10cSrcweir public:
325cdf0e10cSrcweir 	// Direkte Eingabe ueber Dialog alten Wert loeschen
326cdf0e10cSrcweir 	SwInputField(SwInputFieldType*, const String& rContent ,
327cdf0e10cSrcweir 				 const String& rPrompt, sal_uInt16 nSubType = 0,
328cdf0e10cSrcweir 				 sal_uLong nFmt = 0);
329cdf0e10cSrcweir 
330cdf0e10cSrcweir     virtual String          GetFieldName() const;
331cdf0e10cSrcweir 
332cdf0e10cSrcweir 	// Content
333cdf0e10cSrcweir 	virtual const String&	GetPar1() const;
334cdf0e10cSrcweir 	virtual void			SetPar1(const String& rStr);
335cdf0e10cSrcweir 
336cdf0e10cSrcweir 	// aPromptText
337cdf0e10cSrcweir 	virtual String			GetPar2() const;
338cdf0e10cSrcweir 	virtual void			SetPar2(const String& rStr);
339cdf0e10cSrcweir 
340cdf0e10cSrcweir     virtual String          GetHelp() const;
341cdf0e10cSrcweir     virtual void            SetHelp(const String & rStr);
342cdf0e10cSrcweir 
343cdf0e10cSrcweir     virtual String          GetToolTip() const;
344cdf0e10cSrcweir     virtual void            SetToolTip(const String & rStr);
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     virtual sal_Bool            isFormField() const;
347cdf0e10cSrcweir 
348cdf0e10cSrcweir 	virtual sal_uInt16			GetSubType() const;
349cdf0e10cSrcweir 	virtual void			SetSubType(sal_uInt16 nSub);
350cdf0e10cSrcweir     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
351cdf0e10cSrcweir     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
352cdf0e10cSrcweir };
353cdf0e10cSrcweir 
354cdf0e10cSrcweir /*--------------------------------------------------------------------
355cdf0e10cSrcweir     Description: Sorted list of input fields and DropDown fields
356cdf0e10cSrcweir  --------------------------------------------------------------------*/
357cdf0e10cSrcweir 
358cdf0e10cSrcweir class SwInputFieldList
359cdf0e10cSrcweir {
360cdf0e10cSrcweir public:
361cdf0e10cSrcweir 	SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst = sal_False );
362cdf0e10cSrcweir 	~SwInputFieldList();
363cdf0e10cSrcweir 
364cdf0e10cSrcweir 	sal_uInt16		Count() const;
365cdf0e10cSrcweir 	SwField*    GetField(sal_uInt16 nId);
366cdf0e10cSrcweir 
367cdf0e10cSrcweir 	void		GotoFieldPos(sal_uInt16 nId);
368cdf0e10cSrcweir 	void		PushCrsr();
369cdf0e10cSrcweir 	void	 	PopCrsr();
370cdf0e10cSrcweir 
371cdf0e10cSrcweir 	// vergleiche TmpLst mit akt Feldern. Alle neue kommen in die SortLst
372cdf0e10cSrcweir 	// damit sie geupdatet werden koennen. Returnt die Anzahl.
373cdf0e10cSrcweir 	// (Fuer Textbausteine: nur seine Input-Felder aktualisieren)
374cdf0e10cSrcweir 	sal_uInt16		BuildSortLst();
375cdf0e10cSrcweir 
376cdf0e10cSrcweir 	// Alle unselektierten Felder aus Liste entfernen
377cdf0e10cSrcweir 	void		RemoveUnselectedFlds();
378cdf0e10cSrcweir 
379cdf0e10cSrcweir private:
380cdf0e10cSrcweir 	SwEditShell*	pSh;
381cdf0e10cSrcweir 	_SetGetExpFlds*	pSrtLst;
382cdf0e10cSrcweir 	SvPtrarr		aTmpLst;
383cdf0e10cSrcweir };
384cdf0e10cSrcweir 
385cdf0e10cSrcweir /*--------------------------------------------------------------------
386cdf0e10cSrcweir 	Beschreibung: Tabellen-Formelfeld
387cdf0e10cSrcweir 				  (Implementierung steht in tblcalc.cxx)
388cdf0e10cSrcweir  --------------------------------------------------------------------*/
389cdf0e10cSrcweir 
390cdf0e10cSrcweir class SwTblFieldType : public SwValueFieldType
391cdf0e10cSrcweir {
392cdf0e10cSrcweir public:
393cdf0e10cSrcweir 	SwTblFieldType(SwDoc* pDocPtr);
394cdf0e10cSrcweir 	virtual SwFieldType* Copy() const;
395cdf0e10cSrcweir };
396cdf0e10cSrcweir 
397cdf0e10cSrcweir 
398cdf0e10cSrcweir // MSC will den hier nicht
399cdf0e10cSrcweir //typedef void (SwField:: *FnScanFormel)( const SwTable&, String&,
400cdf0e10cSrcweir //									 String&, String* = 0, void* = 0 );
401cdf0e10cSrcweir 
402cdf0e10cSrcweir 
403cdf0e10cSrcweir class SwTblField : public SwValueField, public SwTableFormula
404cdf0e10cSrcweir {
405cdf0e10cSrcweir 	String 		sExpand;
406cdf0e10cSrcweir 	sal_uInt16		nSubType;
407cdf0e10cSrcweir 
408cdf0e10cSrcweir     virtual String      Expand() const;
409cdf0e10cSrcweir     virtual SwField*    Copy() const;
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 	// suche den TextNode, in dem das Feld steht
412cdf0e10cSrcweir 	virtual const SwNode* GetNodeOfFormula() const;
413cdf0e10cSrcweir 
414cdf0e10cSrcweir     String GetCommand();
415cdf0e10cSrcweir 
416cdf0e10cSrcweir public:
417cdf0e10cSrcweir 	SwTblField( SwTblFieldType*, const String& rFormel,
418cdf0e10cSrcweir 				sal_uInt16 nSubType = 0, sal_uLong nFmt = 0);
419cdf0e10cSrcweir 
420cdf0e10cSrcweir 	virtual void 		SetValue( const double& rVal );
421cdf0e10cSrcweir 	virtual sal_uInt16		GetSubType() const;
422cdf0e10cSrcweir 	virtual void		SetSubType(sal_uInt16 nType);
423cdf0e10cSrcweir 
424cdf0e10cSrcweir 	const String& 		GetExpStr() const 				{ return sExpand; }
425cdf0e10cSrcweir 	void 				ChgExpStr(const String& rStr) 	{ sExpand = rStr; }
426cdf0e10cSrcweir 
427cdf0e10cSrcweir 	// berechne sich selbst
428cdf0e10cSrcweir 	void 				CalcField( SwTblCalcPara& rCalcPara );
429cdf0e10cSrcweir 
430cdf0e10cSrcweir     virtual String      GetFieldName() const;
431cdf0e10cSrcweir 
432cdf0e10cSrcweir 	// Die Formel
433cdf0e10cSrcweir 	virtual String		GetPar2() 	const;
434cdf0e10cSrcweir 	virtual void		SetPar2(const String& rStr);
435cdf0e10cSrcweir     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
436cdf0e10cSrcweir     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
437cdf0e10cSrcweir };
438cdf0e10cSrcweir 
439cdf0e10cSrcweir 
440cdf0e10cSrcweir #endif // SW_EXPFLD_HXX
441