xref: /trunk/main/sw/inc/unofield.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 _UNOFIELD_HXX
24cdf0e10cSrcweir #define _UNOFIELD_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp>
27cdf0e10cSrcweir #include <com/sun/star/util/XRefreshable.hpp>
28cdf0e10cSrcweir #include <com/sun/star/util/XUpdatable.hpp>
29cdf0e10cSrcweir #include <com/sun/star/text/XDependentTextField.hpp>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <calbck.hxx>
34cdf0e10cSrcweir #include <unocoll.hxx>
35cdf0e10cSrcweir #include <RefreshListenerContainer.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir 
38cdf0e10cSrcweir class SwFieldType;
39cdf0e10cSrcweir class SwDoc;
40cdf0e10cSrcweir class SwFmtFld;
41cdf0e10cSrcweir class SwField;
42cdf0e10cSrcweir class SwSetExpField;
43cdf0e10cSrcweir class SwTextAPIObject;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir /* -----------------04.12.98 12:49-------------------
46cdf0e10cSrcweir  *
47cdf0e10cSrcweir  * --------------------------------------------------*/
48cdf0e10cSrcweir class SwXFieldMaster : public cppu::WeakImplHelper4
49cdf0e10cSrcweir <
50cdf0e10cSrcweir     ::com::sun::star::beans::XPropertySet,
51cdf0e10cSrcweir     ::com::sun::star::lang::XServiceInfo,
52cdf0e10cSrcweir     ::com::sun::star::lang::XUnoTunnel,
53cdf0e10cSrcweir     ::com::sun::star::lang::XComponent
54cdf0e10cSrcweir >,
55cdf0e10cSrcweir     public SwClient
56cdf0e10cSrcweir {
57cdf0e10cSrcweir     SwEventListenerContainer    aLstnrCntnr;
58cdf0e10cSrcweir     sal_uInt16                  nResTypeId;
59cdf0e10cSrcweir     SwDoc*                      m_pDoc;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     sal_Bool                    m_bIsDescriptor;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     String                      sParam1;    //Content / Database / NumberingSeparator
64cdf0e10cSrcweir     String                      sParam2;    // -    /DataTablename
65cdf0e10cSrcweir     String                      sParam3;    // -    /DataFieldName
66cdf0e10cSrcweir     String                      sParam4;
67cdf0e10cSrcweir     String                      sParam5;    // -    /DataBaseURL
68cdf0e10cSrcweir     String                      sParam6;    // -    /DataBaseResource
69cdf0e10cSrcweir     double                      fParam1;    // Value / -
70cdf0e10cSrcweir     sal_Int8                    nParam1;    // ChapterNumberingLevel
71cdf0e10cSrcweir     sal_Bool                    bParam1;    // IsExpression
72cdf0e10cSrcweir     sal_Int32                   nParam2;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir protected:
75cdf0e10cSrcweir     virtual ~SwXFieldMaster();
76cdf0e10cSrcweir     //SwClient
77cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir public:
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId);
82cdf0e10cSrcweir     SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc);
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     TYPEINFO();
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     //XUnoTunnel
90cdf0e10cSrcweir     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     //XPropertySet
93cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
94cdf0e10cSrcweir     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
95cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
97cdf0e10cSrcweir     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
98cdf0e10cSrcweir     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
99cdf0e10cSrcweir     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     //XComponent
102cdf0e10cSrcweir     virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
103cdf0e10cSrcweir     virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
104cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     //XServiceInfo
107cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
108cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
109cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     static rtl::OUString GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc);
112cdf0e10cSrcweir     static rtl::OUString LocalizeFormula(const SwSetExpField& rFld, const rtl::OUString& rFormula, sal_Bool bQuery);
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     SwFieldType* GetFldType(sal_Bool bDontCreate = sal_False) const;
115cdf0e10cSrcweir     SwDoc*      GetDoc() {return m_pDoc;}
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     sal_Bool        IsDescriptor()const  {return m_bIsDescriptor;}
118cdf0e10cSrcweir     sal_uInt16      GetResId() const {return nResTypeId;}
119cdf0e10cSrcweir };
120cdf0e10cSrcweir 
121cdf0e10cSrcweir struct SwFieldProperties_Impl;
122cdf0e10cSrcweir class SwXTextField : public cppu::WeakImplHelper5
123cdf0e10cSrcweir <
124cdf0e10cSrcweir     ::com::sun::star::text::XDependentTextField,
125cdf0e10cSrcweir     ::com::sun::star::lang::XServiceInfo,
126cdf0e10cSrcweir     ::com::sun::star::beans::XPropertySet,
127cdf0e10cSrcweir     ::com::sun::star::lang::XUnoTunnel,
128cdf0e10cSrcweir     ::com::sun::star::util::XUpdatable
129cdf0e10cSrcweir >,
130cdf0e10cSrcweir             public SwClient
131cdf0e10cSrcweir {
132cdf0e10cSrcweir     SwEventListenerContainer    aLstnrCntnr;
133cdf0e10cSrcweir     const SwFmtFld*             pFmtFld;
134cdf0e10cSrcweir     SwDoc*                      m_pDoc;
135cdf0e10cSrcweir     SwTextAPIObject*            m_pTextObject;
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     sal_Bool                        m_bIsDescriptor;
138cdf0e10cSrcweir     SwClient                        m_aFieldTypeClient; // required to access field master of not yet inserted fields
139cdf0e10cSrcweir     sal_Bool                        m_bCallUpdate;
140cdf0e10cSrcweir     sal_uInt16                      m_nServiceId;
141cdf0e10cSrcweir     SwFieldProperties_Impl*     m_pProps;
142cdf0e10cSrcweir     String                      m_sTypeName;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     //SwFieldType* GetFldType() const { return (SwFieldType*)GetRegisteredIn(); }
146cdf0e10cSrcweir     SwDoc*       GetDoc() {return m_pDoc;}
147cdf0e10cSrcweir protected:
148cdf0e10cSrcweir     virtual ~SwXTextField();
149cdf0e10cSrcweir     //SwClient
150cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
151cdf0e10cSrcweir 
152cdf0e10cSrcweir public:
153cdf0e10cSrcweir     SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc=0);
154cdf0e10cSrcweir     SwXTextField(const SwFmtFld& rFmt, SwDoc* pDoc);
155cdf0e10cSrcweir 
156cdf0e10cSrcweir 
157cdf0e10cSrcweir     TYPEINFO();
158cdf0e10cSrcweir 
159cdf0e10cSrcweir     static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
160cdf0e10cSrcweir 
161cdf0e10cSrcweir     //XUnoTunnel
162cdf0e10cSrcweir     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     //XDependentTextField
165cdf0e10cSrcweir     virtual void SAL_CALL attachTextFieldMaster(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xFieldMaster) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
166cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  SAL_CALL getTextFieldMaster(void) throw( ::com::sun::star::uno::RuntimeException );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir     //XTextField
169cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getPresentation(sal_Bool bShowCommand) throw( ::com::sun::star::uno::RuntimeException );
170cdf0e10cSrcweir 
171cdf0e10cSrcweir     //XTextContent
172cdf0e10cSrcweir     virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
173cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >  SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException );
174cdf0e10cSrcweir 
175cdf0e10cSrcweir     //XComponent
176cdf0e10cSrcweir     virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
177cdf0e10cSrcweir     virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
178cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
179cdf0e10cSrcweir 
180cdf0e10cSrcweir     //XPropertySet
181cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
182cdf0e10cSrcweir     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
183cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
184cdf0e10cSrcweir     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
185cdf0e10cSrcweir     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
186cdf0e10cSrcweir     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
187cdf0e10cSrcweir     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
188cdf0e10cSrcweir 
189cdf0e10cSrcweir     //XServiceInfo
190cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
191cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
192cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     //XUpdatable
195cdf0e10cSrcweir     virtual void SAL_CALL update(  ) throw (::com::sun::star::uno::RuntimeException);
196cdf0e10cSrcweir 
197cdf0e10cSrcweir     void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
198cdf0e10cSrcweir 
199cdf0e10cSrcweir     const SwField*      GetField() const;
200cdf0e10cSrcweir     const SwFmtFld*     GetFldFmt(){return GetField() ? pFmtFld : 0; };
201cdf0e10cSrcweir 
202cdf0e10cSrcweir     void Invalidate();
203cdf0e10cSrcweir 
204cdf0e10cSrcweir     /// @return an SwXTextField, either an already existing one or a new one
205cdf0e10cSrcweir     static SwXTextField* CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt);
206cdf0e10cSrcweir };
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 
209cdf0e10cSrcweir typedef
210cdf0e10cSrcweir cppu::WeakImplHelper2
211cdf0e10cSrcweir <
212cdf0e10cSrcweir     ::com::sun::star::container::XNameAccess,
213cdf0e10cSrcweir     ::com::sun::star::lang::XServiceInfo
214cdf0e10cSrcweir >
215cdf0e10cSrcweir SwXTextFieldMastersBaseClass;
216cdf0e10cSrcweir class SwXTextFieldMasters : public SwXTextFieldMastersBaseClass,
217cdf0e10cSrcweir     public SwUnoCollection
218cdf0e10cSrcweir {
219cdf0e10cSrcweir protected:
220cdf0e10cSrcweir     virtual ~SwXTextFieldMasters();
221cdf0e10cSrcweir public:
222cdf0e10cSrcweir     SwXTextFieldMasters(SwDoc* pDoc);
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 
225cdf0e10cSrcweir     //XNameAccess
226cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
227cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException );
228cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException );
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     //XElementAccess
231cdf0e10cSrcweir     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
232cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     //XServiceInfo
235cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
236cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
237cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 
240cdf0e10cSrcweir     static sal_Bool getInstanceName(const SwFieldType& rFldType, String& rName);
241cdf0e10cSrcweir };
242cdf0e10cSrcweir 
243cdf0e10cSrcweir /* -----------------21.12.98 10:26-------------------
244cdf0e10cSrcweir  *
245cdf0e10cSrcweir  * --------------------------------------------------*/
246cdf0e10cSrcweir typedef
247cdf0e10cSrcweir cppu::WeakImplHelper3
248cdf0e10cSrcweir <
249cdf0e10cSrcweir     ::com::sun::star::container::XEnumerationAccess,
250cdf0e10cSrcweir     ::com::sun::star::lang::XServiceInfo,
251cdf0e10cSrcweir     ::com::sun::star::util::XRefreshable
252cdf0e10cSrcweir >
253cdf0e10cSrcweir SwXTextFieldTypesBaseClass;
254cdf0e10cSrcweir class SwXTextFieldTypes : public SwXTextFieldTypesBaseClass,
255cdf0e10cSrcweir         public SwUnoCollection
256cdf0e10cSrcweir {
257cdf0e10cSrcweir     SwRefreshListenerContainer      aRefreshCont;
258cdf0e10cSrcweir protected:
259cdf0e10cSrcweir     virtual ~SwXTextFieldTypes();
260cdf0e10cSrcweir public:
261cdf0e10cSrcweir     SwXTextFieldTypes(SwDoc* pDoc);
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 
264cdf0e10cSrcweir     //XEnumerationAccess
265cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
266cdf0e10cSrcweir 
267cdf0e10cSrcweir     //XElementAccess
268cdf0e10cSrcweir     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
269cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
270cdf0e10cSrcweir 
271cdf0e10cSrcweir     // ::com::sun::star::util::XRefreshable
272cdf0e10cSrcweir     virtual void SAL_CALL refresh(  ) throw(::com::sun::star::uno::RuntimeException);
273cdf0e10cSrcweir     virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException);
274cdf0e10cSrcweir     virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException);
275cdf0e10cSrcweir 
276cdf0e10cSrcweir     //XServiceInfo
277cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
278cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
279cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
280cdf0e10cSrcweir 
281cdf0e10cSrcweir     // SwUnoCollection
282cdf0e10cSrcweir     virtual void    Invalidate();
283cdf0e10cSrcweir };
284cdf0e10cSrcweir 
285cdf0e10cSrcweir class SwXFieldEnumeration : public cppu::WeakImplHelper2
286cdf0e10cSrcweir <
287cdf0e10cSrcweir     ::com::sun::star::container::XEnumeration,
288cdf0e10cSrcweir     ::com::sun::star::lang::XServiceInfo
289cdf0e10cSrcweir >,
290cdf0e10cSrcweir     public SwClient
291cdf0e10cSrcweir {
292cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > > aItems;
293cdf0e10cSrcweir     sal_Int32       nNextIndex;     // index of next element to be returned
294cdf0e10cSrcweir 
295cdf0e10cSrcweir     SwDoc* pDoc;
296cdf0e10cSrcweir 
297cdf0e10cSrcweir protected:
298cdf0e10cSrcweir     virtual ~SwXFieldEnumeration();
299cdf0e10cSrcweir     //SwClient
300cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
301cdf0e10cSrcweir public:
302cdf0e10cSrcweir     SwXFieldEnumeration(SwDoc* pDoc);
303cdf0e10cSrcweir 
304cdf0e10cSrcweir     //XEnumeration
305cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException );
306cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
307cdf0e10cSrcweir 
308cdf0e10cSrcweir     //XServiceInfo
309cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
310cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
311cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
312cdf0e10cSrcweir 
313cdf0e10cSrcweir };
314cdf0e10cSrcweir #endif
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 
318