xref: /trunk/main/sw/inc/expfld.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51d2dbeb0SAndrew Rist  * distributed with this work for additional information
61d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
131d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
171d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew 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 
_SeqFldLstElem_SeqFldLstElem53cdf0e10cSrcweir     _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:
SwSeqFldList()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#
SetLateInitialization()131cdf0e10cSrcweir     void                SetLateInitialization() { bLateInitialization = true;}
132cdf0e10cSrcweir };
133cdf0e10cSrcweir 
ChgExpStr(const String & rExpand)134cdf0e10cSrcweir inline void SwGetExpField::ChgExpStr(const String& rExpand)
135cdf0e10cSrcweir     { sExpand = rExpand;}
136cdf0e10cSrcweir 
GetExpStr() const137cdf0e10cSrcweir inline const String& SwGetExpField::GetExpStr() const
138cdf0e10cSrcweir     { return sExpand;   }
139cdf0e10cSrcweir 
140cdf0e10cSrcweir // wird von der Formatierung abgefragt
IsInBodyTxt() const141cdf0e10cSrcweir inline sal_Bool SwGetExpField::IsInBodyTxt() const
142cdf0e10cSrcweir     { return bIsInBodyTxt; }
143cdf0e10cSrcweir 
144cdf0e10cSrcweir // wird von UpdateExpFlds gesetzt (dort ist die Node-Position bekannt)
ChgBodyTxtFlag(sal_Bool bIsInBody)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 
IsDeleted() const179cdf0e10cSrcweir     sal_Bool                    IsDeleted() const       { return bDeleted; }
SetDeleted(sal_Bool b)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; }
GetDelimiter() const194cdf0e10cSrcweir     const String& GetDelimiter() const      { return sDelim; }
SetDelimiter(const String & s)195cdf0e10cSrcweir     void SetDelimiter( const String& s )    { sDelim = s; }
GetOutlineLvl() const196cdf0e10cSrcweir     sal_uInt8 GetOutlineLvl() const                 { return nLevel; }
SetOutlineLvl(sal_uInt8 n)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!!!
GetOutlineChgNd() const201cdf0e10cSrcweir     const SwNode* GetOutlineChgNd() const   { return pOutlChgNd; }
SetOutlineChgNd(const SwNode * p)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 
SetType(sal_uInt16 nTyp)208cdf0e10cSrcweir inline void SwSetExpFieldType::SetType( sal_uInt16 nTyp )
209cdf0e10cSrcweir {
210cdf0e10cSrcweir         nType = nTyp;
211cdf0e10cSrcweir         EnableFormat( !(nType & (nsSwGetSetExpType::GSE_SEQ|nsSwGetSetExpType::GSE_STRING)));
212cdf0e10cSrcweir }
213cdf0e10cSrcweir 
GetType() const214cdf0e10cSrcweir inline sal_uInt16 SwSetExpFieldType::GetType() const
215cdf0e10cSrcweir     { return nType;   }
216cdf0e10cSrcweir 
GetSetRefName() const217cdf0e10cSrcweir 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
SetSeqNumber(sal_uInt16 n)260cdf0e10cSrcweir     inline void                 SetSeqNumber( sal_uInt16 n )    { nSeqNo = n; }
GetSeqNumber() const261cdf0e10cSrcweir     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 
GetExpStr() const273cdf0e10cSrcweir inline const String& SwSetExpField::GetExpStr() const
274cdf0e10cSrcweir     { return sExpand;       }
275cdf0e10cSrcweir 
ChgExpStr(const String & rExpand)276cdf0e10cSrcweir inline void SwSetExpField::ChgExpStr( const String& rExpand )
277cdf0e10cSrcweir     { sExpand = rExpand;    }
278cdf0e10cSrcweir 
SetPromptText(const String & rStr)279cdf0e10cSrcweir inline void  SwSetExpField::SetPromptText(const String& rStr)
280cdf0e10cSrcweir     { aPText = rStr;        }
281cdf0e10cSrcweir 
GetPromptText() const282cdf0e10cSrcweir inline const String& SwSetExpField::GetPromptText() const
283cdf0e10cSrcweir     { return aPText;        }
284cdf0e10cSrcweir 
SetInputFlag(sal_Bool bInp)285cdf0e10cSrcweir inline void SwSetExpField::SetInputFlag(sal_Bool bInp)
286cdf0e10cSrcweir     { bInput = bInp; }
287cdf0e10cSrcweir 
GetInputFlag() const288cdf0e10cSrcweir inline sal_Bool SwSetExpField::GetInputFlag() const
289cdf0e10cSrcweir     { return bInput; }
290cdf0e10cSrcweir 
IsSequenceFld() const291cdf0e10cSrcweir 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 
GetDoc() const306cdf0e10cSrcweir     SwDoc* GetDoc() const { return pDoc; }
307cdf0e10cSrcweir };
308cdf0e10cSrcweir 
309cdf0e10cSrcweir /*--------------------------------------------------------------------
310cdf0e10cSrcweir     Beschreibung: Eingabefeld
311cdf0e10cSrcweir  --------------------------------------------------------------------*/
312cdf0e10cSrcweir 
313cdf0e10cSrcweir class SW_DLLPUBLIC SwInputField : public SwField
314cdf0e10cSrcweir {
31569a74367SOliver-Rainer Wittmann     mutable String aContent;
316cdf0e10cSrcweir     String aPText;
317cdf0e10cSrcweir     String aHelp;
318cdf0e10cSrcweir     String aToolTip;
319cdf0e10cSrcweir     sal_uInt16 nSubType;
32069a74367SOliver-Rainer Wittmann     bool mbIsFormField;
32169a74367SOliver-Rainer Wittmann 
32269a74367SOliver-Rainer Wittmann     SwFmtFld* mpFmtFld; // attribute to which the <SwInputField> belongs to
323cdf0e10cSrcweir 
324cdf0e10cSrcweir     virtual String          Expand() const;
325cdf0e10cSrcweir     virtual SwField*        Copy() const;
326cdf0e10cSrcweir 
32769a74367SOliver-Rainer Wittmann     // Accessing Input Field's content
32869a74367SOliver-Rainer Wittmann     const String& getContent() const;
32969a74367SOliver-Rainer Wittmann 
330*1bf9188dSOliver-Rainer Wittmann     void LockNotifyContentChange();
331*1bf9188dSOliver-Rainer Wittmann     void UnlockNotifyContentChange();
332*1bf9188dSOliver-Rainer Wittmann 
333cdf0e10cSrcweir public:
334cdf0e10cSrcweir     // Direkte Eingabe ueber Dialog alten Wert loeschen
33569a74367SOliver-Rainer Wittmann     SwInputField(
33669a74367SOliver-Rainer Wittmann         SwInputFieldType* pFieldType,
33769a74367SOliver-Rainer Wittmann         const String& rContent,
33869a74367SOliver-Rainer Wittmann         const String& rPrompt,
33969a74367SOliver-Rainer Wittmann         sal_uInt16 nSubType = 0,
34069a74367SOliver-Rainer Wittmann         sal_uLong nFmt = 0,
34169a74367SOliver-Rainer Wittmann         bool bIsFormField = true );
34269a74367SOliver-Rainer Wittmann     virtual ~SwInputField();
34369a74367SOliver-Rainer Wittmann 
34469a74367SOliver-Rainer Wittmann     void SetFmtFld( SwFmtFld& rFmtFld );
34569a74367SOliver-Rainer Wittmann     SwFmtFld* GetFmtFld();
34669a74367SOliver-Rainer Wittmann 
34769a74367SOliver-Rainer Wittmann     // Providing new Input Field's content:
34869a74367SOliver-Rainer Wittmann     // Fill Input Field's content depending on <nSupType>.
34969a74367SOliver-Rainer Wittmann     void applyFieldContent( const String& rNewFieldContent );
35069a74367SOliver-Rainer Wittmann 
35169a74367SOliver-Rainer Wittmann     bool isFormField() const;
352cdf0e10cSrcweir 
353cdf0e10cSrcweir     virtual String          GetFieldName() const;
354cdf0e10cSrcweir 
355cdf0e10cSrcweir     // Content
356cdf0e10cSrcweir     virtual const String&   GetPar1() const;
357cdf0e10cSrcweir     virtual void            SetPar1(const String& rStr);
358cdf0e10cSrcweir 
359cdf0e10cSrcweir     // aPromptText
360cdf0e10cSrcweir     virtual String          GetPar2() const;
361cdf0e10cSrcweir     virtual void            SetPar2(const String& rStr);
362cdf0e10cSrcweir 
363cdf0e10cSrcweir     virtual String          GetHelp() const;
364cdf0e10cSrcweir     virtual void            SetHelp(const String & rStr);
365cdf0e10cSrcweir 
366cdf0e10cSrcweir     virtual String          GetToolTip() const;
367cdf0e10cSrcweir     virtual void            SetToolTip(const String & rStr);
368cdf0e10cSrcweir 
369cdf0e10cSrcweir     virtual sal_uInt16      GetSubType() const;
370cdf0e10cSrcweir     virtual void            SetSubType(sal_uInt16 nSub);
371cdf0e10cSrcweir     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
372cdf0e10cSrcweir     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
373cdf0e10cSrcweir };
374cdf0e10cSrcweir 
375cdf0e10cSrcweir /*--------------------------------------------------------------------
376cdf0e10cSrcweir     Description: Sorted list of input fields and DropDown fields
377cdf0e10cSrcweir  --------------------------------------------------------------------*/
378cdf0e10cSrcweir 
379cdf0e10cSrcweir class SwInputFieldList
380cdf0e10cSrcweir {
381cdf0e10cSrcweir public:
382cdf0e10cSrcweir     SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst = sal_False );
383cdf0e10cSrcweir     ~SwInputFieldList();
384cdf0e10cSrcweir 
385cdf0e10cSrcweir     sal_uInt16      Count() const;
386cdf0e10cSrcweir     SwField*    GetField(sal_uInt16 nId);
387cdf0e10cSrcweir 
388cdf0e10cSrcweir     void        GotoFieldPos(sal_uInt16 nId);
389cdf0e10cSrcweir     void        PushCrsr();
390cdf0e10cSrcweir     void        PopCrsr();
391cdf0e10cSrcweir 
392cdf0e10cSrcweir     // vergleiche TmpLst mit akt Feldern. Alle neue kommen in die SortLst
393cdf0e10cSrcweir     // damit sie geupdatet werden koennen. Returnt die Anzahl.
394cdf0e10cSrcweir     // (Fuer Textbausteine: nur seine Input-Felder aktualisieren)
395cdf0e10cSrcweir     sal_uInt16      BuildSortLst();
396cdf0e10cSrcweir 
397cdf0e10cSrcweir     // Alle unselektierten Felder aus Liste entfernen
398cdf0e10cSrcweir     void        RemoveUnselectedFlds();
399cdf0e10cSrcweir 
400cdf0e10cSrcweir private:
401cdf0e10cSrcweir     SwEditShell*    pSh;
402cdf0e10cSrcweir     _SetGetExpFlds* pSrtLst;
403cdf0e10cSrcweir     SvPtrarr        aTmpLst;
404cdf0e10cSrcweir };
405cdf0e10cSrcweir 
406cdf0e10cSrcweir /*--------------------------------------------------------------------
407cdf0e10cSrcweir     Beschreibung: Tabellen-Formelfeld
408cdf0e10cSrcweir                   (Implementierung steht in tblcalc.cxx)
409cdf0e10cSrcweir  --------------------------------------------------------------------*/
410cdf0e10cSrcweir 
411cdf0e10cSrcweir class SwTblFieldType : public SwValueFieldType
412cdf0e10cSrcweir {
413cdf0e10cSrcweir public:
414cdf0e10cSrcweir     SwTblFieldType(SwDoc* pDocPtr);
415cdf0e10cSrcweir     virtual SwFieldType* Copy() const;
416cdf0e10cSrcweir };
417cdf0e10cSrcweir 
418cdf0e10cSrcweir 
419cdf0e10cSrcweir // MSC will den hier nicht
420cdf0e10cSrcweir //typedef void (SwField:: *FnScanFormel)( const SwTable&, String&,
421cdf0e10cSrcweir //                                   String&, String* = 0, void* = 0 );
422cdf0e10cSrcweir 
423cdf0e10cSrcweir 
424cdf0e10cSrcweir class SwTblField : public SwValueField, public SwTableFormula
425cdf0e10cSrcweir {
426cdf0e10cSrcweir     String      sExpand;
427cdf0e10cSrcweir     sal_uInt16      nSubType;
428cdf0e10cSrcweir 
429cdf0e10cSrcweir     virtual String      Expand() const;
430cdf0e10cSrcweir     virtual SwField*    Copy() const;
431cdf0e10cSrcweir 
432cdf0e10cSrcweir     // suche den TextNode, in dem das Feld steht
433cdf0e10cSrcweir     virtual const SwNode* GetNodeOfFormula() const;
434cdf0e10cSrcweir 
435cdf0e10cSrcweir     String GetCommand();
436cdf0e10cSrcweir 
437cdf0e10cSrcweir public:
438cdf0e10cSrcweir     SwTblField( SwTblFieldType*, const String& rFormel,
439cdf0e10cSrcweir                 sal_uInt16 nSubType = 0, sal_uLong nFmt = 0);
440cdf0e10cSrcweir 
441cdf0e10cSrcweir     virtual void        SetValue( const double& rVal );
442cdf0e10cSrcweir     virtual sal_uInt16      GetSubType() const;
443cdf0e10cSrcweir     virtual void        SetSubType(sal_uInt16 nType);
444cdf0e10cSrcweir 
GetExpStr() const445cdf0e10cSrcweir     const String&       GetExpStr() const               { return sExpand; }
ChgExpStr(const String & rStr)446cdf0e10cSrcweir     void                ChgExpStr(const String& rStr)   { sExpand = rStr; }
447cdf0e10cSrcweir 
448cdf0e10cSrcweir     // berechne sich selbst
449cdf0e10cSrcweir     void                CalcField( SwTblCalcPara& rCalcPara );
450cdf0e10cSrcweir 
451cdf0e10cSrcweir     virtual String      GetFieldName() const;
452cdf0e10cSrcweir 
453cdf0e10cSrcweir     // Die Formel
454cdf0e10cSrcweir     virtual String      GetPar2()   const;
455cdf0e10cSrcweir     virtual void        SetPar2(const String& rStr);
456cdf0e10cSrcweir     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
457cdf0e10cSrcweir     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
458cdf0e10cSrcweir };
459cdf0e10cSrcweir 
460cdf0e10cSrcweir 
461cdf0e10cSrcweir #endif // SW_EXPFLD_HXX
462