xref: /aoo42x/main/sc/inc/fielduno.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_FIELDUNO_HXX
25cdf0e10cSrcweir #define SC_FIELDUNO_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "address.hxx"
28cdf0e10cSrcweir #include "mutexhlp.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <svl/lstner.hxx>
31cdf0e10cSrcweir #include <svl/itemprop.hxx>
32cdf0e10cSrcweir #include <editeng/editdata.hxx>
33cdf0e10cSrcweir #include <com/sun/star/text/XTextField.hpp>
34cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
35cdf0e10cSrcweir #include <com/sun/star/container/XContainer.hpp>
36cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp>
37cdf0e10cSrcweir #include <com/sun/star/container/XEnumerationAccess.hpp>
38cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp>
39cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
40cdf0e10cSrcweir #include <com/sun/star/util/XRefreshable.hpp>
41cdf0e10cSrcweir #include <cppuhelper/component.hxx>
42cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx>
43cdf0e10cSrcweir #include <osl/mutex.hxx>
44cdf0e10cSrcweir 
45cdf0e10cSrcweir class SvxEditSource;
46cdf0e10cSrcweir class SvxFieldItem;
47cdf0e10cSrcweir class ScCellFieldObj;
48cdf0e10cSrcweir class ScHeaderFieldObj;
49cdf0e10cSrcweir class ScHeaderFooterContentObj;
50cdf0e10cSrcweir class ScDocShell;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir 
53cdf0e10cSrcweir //------------------------------------------------------------------
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 
56cdf0e10cSrcweir class ScCellFieldsObj : public cppu::WeakImplHelper5<
57cdf0e10cSrcweir 							com::sun::star::container::XEnumerationAccess,
58cdf0e10cSrcweir 							com::sun::star::container::XIndexAccess,
59cdf0e10cSrcweir 							com::sun::star::container::XContainer,
60cdf0e10cSrcweir                             com::sun::star::util::XRefreshable,
61cdf0e10cSrcweir 							com::sun::star::lang::XServiceInfo >,
62cdf0e10cSrcweir 						public SfxListener
63cdf0e10cSrcweir {
64cdf0e10cSrcweir private:
65cdf0e10cSrcweir 	ScDocShell*				pDocShell;
66cdf0e10cSrcweir 	ScAddress				aCellPos;
67cdf0e10cSrcweir 	SvxEditSource*			pEditSource;
68cdf0e10cSrcweir     ///	List of refresh listeners.
69cdf0e10cSrcweir 	cppu::OInterfaceContainerHelper* mpRefreshListeners;
70cdf0e10cSrcweir     /// mutex to lock the InterfaceContainerHelper
71cdf0e10cSrcweir     osl::Mutex              aMutex;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	ScCellFieldObj*			GetObjectByIndex_Impl(sal_Int32 Index) const;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir public:
76cdf0e10cSrcweir 							ScCellFieldsObj(ScDocShell* pDocSh, const ScAddress& rPos);
77cdf0e10cSrcweir 	virtual					~ScCellFieldsObj();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 							// XIndexAccess
82cdf0e10cSrcweir 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
83cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
84cdf0e10cSrcweir 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
85cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
86cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 							// XEnumerationAccess
89cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
90cdf0e10cSrcweir 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 							// XElementAccess
93cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
94cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
95cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 							// XContainer
98cdf0e10cSrcweir 	virtual void SAL_CALL	addContainerListener( const ::com::sun::star::uno::Reference<
99cdf0e10cSrcweir 								::com::sun::star::container::XContainerListener >& xListener )
100cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
101cdf0e10cSrcweir 	virtual void SAL_CALL	removeContainerListener( const ::com::sun::star::uno::Reference<
102cdf0e10cSrcweir 								::com::sun::star::container::XContainerListener >& xListener )
103cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
104cdf0e10cSrcweir 
105cdf0e10cSrcweir                             // XRefreshable
106cdf0e10cSrcweir     virtual void SAL_CALL refresh(  )
107cdf0e10cSrcweir                                     throw (::com::sun::star::uno::RuntimeException);
108cdf0e10cSrcweir     virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference<
109cdf0e10cSrcweir                                 ::com::sun::star::util::XRefreshListener >& l )
110cdf0e10cSrcweir                                     throw (::com::sun::star::uno::RuntimeException);
111cdf0e10cSrcweir     virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference<
112cdf0e10cSrcweir                                 ::com::sun::star::util::XRefreshListener >& l )
113cdf0e10cSrcweir                                     throw (::com::sun::star::uno::RuntimeException);
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 							// XServiceInfo
116cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getImplementationName()
117cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
118cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
119cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
120cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
121cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
122cdf0e10cSrcweir };
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 
125cdf0e10cSrcweir class ScCellFieldObj : public ScMutexHelper,
126cdf0e10cSrcweir 						public ::cppu::OComponentHelper,
127cdf0e10cSrcweir 						public ::com::sun::star::text::XTextField,
128cdf0e10cSrcweir 						public ::com::sun::star::beans::XPropertySet,
129cdf0e10cSrcweir 						public ::com::sun::star::lang::XUnoTunnel,
130cdf0e10cSrcweir 						public ::com::sun::star::lang::XServiceInfo,
131cdf0e10cSrcweir 						public SfxListener
132cdf0e10cSrcweir {
133cdf0e10cSrcweir private:
134cdf0e10cSrcweir 	const SfxItemPropertySet*		pPropSet;
135cdf0e10cSrcweir 	ScDocShell*				pDocShell;
136cdf0e10cSrcweir 	ScAddress				aCellPos;
137cdf0e10cSrcweir 	SvxEditSource*			pEditSource;
138cdf0e10cSrcweir 	ESelection				aSelection;
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 	String					aUrl;				// Inhalt, wenn noch nicht eingefuegt (nur dann!)
141cdf0e10cSrcweir 	String					aRepresentation;
142cdf0e10cSrcweir 	String					aTarget;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	ScCellFieldObj(); // disabled
145cdf0e10cSrcweir public:
146cdf0e10cSrcweir 							ScCellFieldObj(ScDocShell* pDocSh, const ScAddress& rPos,
147cdf0e10cSrcweir 											const ESelection& rSel);
148cdf0e10cSrcweir 	virtual					~ScCellFieldObj();
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 							// per getImplementation gerufen:
153cdf0e10cSrcweir 	void					DeleteField();
IsInserted() const154cdf0e10cSrcweir 	sal_Bool					IsInserted() const		{ return pEditSource != NULL; }
155cdf0e10cSrcweir 	SvxFieldItem			CreateFieldItem();
156cdf0e10cSrcweir 	void					InitDoc( ScDocShell* pDocSh, const ScAddress& rPos,
157cdf0e10cSrcweir 										const ESelection& rSel );
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(
160cdf0e10cSrcweir 								const ::com::sun::star::uno::Type & rType )
161cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
162cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
163cdf0e10cSrcweir 								const ::com::sun::star::uno::Type & rType )
164cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
165cdf0e10cSrcweir 	virtual void SAL_CALL	acquire() throw();
166cdf0e10cSrcweir 	virtual void SAL_CALL	release() throw();
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 							// XTextField
169cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getPresentation( sal_Bool bShowCommand )
170cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 							// XTextContent
173cdf0e10cSrcweir 	virtual void SAL_CALL	attach( const ::com::sun::star::uno::Reference<
174cdf0e10cSrcweir 								::com::sun::star::text::XTextRange >& xTextRange )
175cdf0e10cSrcweir 									throw(::com::sun::star::lang::IllegalArgumentException,
176cdf0e10cSrcweir 											::com::sun::star::uno::RuntimeException);
177cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
178cdf0e10cSrcweir 							getAnchor() throw(::com::sun::star::uno::RuntimeException);
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 							// XComponent
181cdf0e10cSrcweir 	virtual void SAL_CALL	dispose() throw(::com::sun::star::uno::RuntimeException);
182cdf0e10cSrcweir 	virtual void SAL_CALL	addEventListener( const ::com::sun::star::uno::Reference<
183cdf0e10cSrcweir 								::com::sun::star::lang::XEventListener >& xListener )
184cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
185cdf0e10cSrcweir 	virtual void SAL_CALL	removeEventListener( const ::com::sun::star::uno::Reference<
186cdf0e10cSrcweir 								::com::sun::star::lang::XEventListener >& aListener )
187cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 							// XPropertySet
190cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
191cdf0e10cSrcweir 							SAL_CALL getPropertySetInfo()
192cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
193cdf0e10cSrcweir 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
194cdf0e10cSrcweir 									const ::com::sun::star::uno::Any& aValue )
195cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
196cdf0e10cSrcweir 									::com::sun::star::beans::PropertyVetoException,
197cdf0e10cSrcweir 									::com::sun::star::lang::IllegalArgumentException,
198cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
199cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
200cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
201cdf0e10cSrcweir 									const ::rtl::OUString& PropertyName )
202cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
203cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
204cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
205cdf0e10cSrcweir 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
206cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference<
207cdf0e10cSrcweir 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
208cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
209cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
210cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
211cdf0e10cSrcweir 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
212cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference<
213cdf0e10cSrcweir 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
214cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
215cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
216cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
217cdf0e10cSrcweir 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
218cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference<
219cdf0e10cSrcweir 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
220cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
221cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
222cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
223cdf0e10cSrcweir 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
224cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference<
225cdf0e10cSrcweir 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
226cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
227cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
228cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
229cdf0e10cSrcweir 
230cdf0e10cSrcweir 							// XUnoTunnel
231cdf0e10cSrcweir 	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
232cdf0e10cSrcweir 									sal_Int8 >& aIdentifier )
233cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
234cdf0e10cSrcweir 
235cdf0e10cSrcweir 	static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
236cdf0e10cSrcweir 	static ScCellFieldObj* getImplementation( const com::sun::star::uno::Reference<
237cdf0e10cSrcweir 									com::sun::star::text::XTextContent> xObj );
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 							// XServiceInfo
240cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getImplementationName()
241cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
242cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
243cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
244cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
245cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 							// XTypeProvider
248cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
249cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
250cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
251cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
252cdf0e10cSrcweir };
253cdf0e10cSrcweir 
254cdf0e10cSrcweir //------------------------------------------------------------------
255cdf0e10cSrcweir 
256cdf0e10cSrcweir class ScHeaderFieldsObj : public cppu::WeakImplHelper5<
257cdf0e10cSrcweir 							com::sun::star::container::XEnumerationAccess,
258cdf0e10cSrcweir 							com::sun::star::container::XIndexAccess,
259cdf0e10cSrcweir 							com::sun::star::container::XContainer,
260cdf0e10cSrcweir                             com::sun::star::util::XRefreshable,
261cdf0e10cSrcweir 							com::sun::star::lang::XServiceInfo >
262cdf0e10cSrcweir {
263cdf0e10cSrcweir private:
264cdf0e10cSrcweir 	ScHeaderFooterContentObj*	pContentObj;
265cdf0e10cSrcweir 	sal_uInt16						nPart;
266cdf0e10cSrcweir 	sal_uInt16						nType;
267cdf0e10cSrcweir 	SvxEditSource*				pEditSource;
268cdf0e10cSrcweir 
269cdf0e10cSrcweir     ///	List of refresh listeners.
270cdf0e10cSrcweir 	cppu::OInterfaceContainerHelper* mpRefreshListeners;
271cdf0e10cSrcweir     /// mutex to lock the InterfaceContainerHelper
272cdf0e10cSrcweir     osl::Mutex                  aMutex;
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 	ScHeaderFieldObj*		GetObjectByIndex_Impl(sal_Int32 Index) const;
275cdf0e10cSrcweir 
276cdf0e10cSrcweir public:
277cdf0e10cSrcweir 							ScHeaderFieldsObj(ScHeaderFooterContentObj* pContent,
278cdf0e10cSrcweir 												sal_uInt16 nP, sal_uInt16 nT);
279cdf0e10cSrcweir 	virtual					~ScHeaderFieldsObj();
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 							// XIndexAccess
282cdf0e10cSrcweir 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
283cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
284cdf0e10cSrcweir 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
285cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
286cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 							// XEnumerationAccess
289cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
290cdf0e10cSrcweir 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 							// XElementAccess
293cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
294cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
295cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
296cdf0e10cSrcweir 
297cdf0e10cSrcweir 							// XContainer
298cdf0e10cSrcweir 	virtual void SAL_CALL	addContainerListener( const ::com::sun::star::uno::Reference<
299cdf0e10cSrcweir 								::com::sun::star::container::XContainerListener >& xListener )
300cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
301cdf0e10cSrcweir 	virtual void SAL_CALL	removeContainerListener( const ::com::sun::star::uno::Reference<
302cdf0e10cSrcweir 								::com::sun::star::container::XContainerListener >& xListener )
303cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
304cdf0e10cSrcweir 
305cdf0e10cSrcweir                             // XRefreshable
306cdf0e10cSrcweir     virtual void SAL_CALL refresh(  )
307cdf0e10cSrcweir                                     throw (::com::sun::star::uno::RuntimeException);
308cdf0e10cSrcweir     virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference<
309cdf0e10cSrcweir                                 ::com::sun::star::util::XRefreshListener >& l )
310cdf0e10cSrcweir                                     throw (::com::sun::star::uno::RuntimeException);
311cdf0e10cSrcweir     virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference<
312cdf0e10cSrcweir                                 ::com::sun::star::util::XRefreshListener >& l )
313cdf0e10cSrcweir                                     throw (::com::sun::star::uno::RuntimeException);
314cdf0e10cSrcweir 
315cdf0e10cSrcweir                             // XServiceInfo
316cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getImplementationName()
317cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
318cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
319cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
320cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
321cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
322cdf0e10cSrcweir };
323cdf0e10cSrcweir 
324cdf0e10cSrcweir 
325cdf0e10cSrcweir class ScHeaderFieldObj : public ScMutexHelper,
326cdf0e10cSrcweir 							public ::cppu::OComponentHelper,
327cdf0e10cSrcweir 							public ::com::sun::star::text::XTextField,
328cdf0e10cSrcweir 							public ::com::sun::star::beans::XPropertySet,
329cdf0e10cSrcweir 							public ::com::sun::star::lang::XUnoTunnel,
330cdf0e10cSrcweir 							public ::com::sun::star::lang::XServiceInfo
331cdf0e10cSrcweir {
332cdf0e10cSrcweir private:
333cdf0e10cSrcweir 	const SfxItemPropertySet*   pPropSet;
334cdf0e10cSrcweir 	ScHeaderFooterContentObj*	pContentObj;
335cdf0e10cSrcweir 	sal_uInt16						nPart;
336cdf0e10cSrcweir 	sal_uInt16						nType;
337cdf0e10cSrcweir 	SvxEditSource*				pEditSource;
338cdf0e10cSrcweir 	ESelection					aSelection;
339cdf0e10cSrcweir 	sal_Int16					nFileFormat;		// enum SvxFileFormat, valid if not inserted
340cdf0e10cSrcweir 
341cdf0e10cSrcweir     ScHeaderFieldObj(); // disabled
342cdf0e10cSrcweir public:
343cdf0e10cSrcweir 							ScHeaderFieldObj(ScHeaderFooterContentObj* pContent, sal_uInt16 nP,
344cdf0e10cSrcweir 											sal_uInt16 nT, const ESelection& rSel);
345cdf0e10cSrcweir 	virtual					~ScHeaderFieldObj();
346cdf0e10cSrcweir 
347cdf0e10cSrcweir 							// per getImplementation gerufen:
348cdf0e10cSrcweir 	void					DeleteField();
IsInserted() const349cdf0e10cSrcweir 	sal_Bool					IsInserted() const		{ return pEditSource != NULL; }
350cdf0e10cSrcweir 	SvxFieldItem			CreateFieldItem();
351cdf0e10cSrcweir 	void					InitDoc( ScHeaderFooterContentObj* pContent, sal_uInt16 nP,
352cdf0e10cSrcweir 										const ESelection& rSel );
353cdf0e10cSrcweir 
354cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(
355cdf0e10cSrcweir 								const ::com::sun::star::uno::Type & rType )
356cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
357cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
358cdf0e10cSrcweir 								const ::com::sun::star::uno::Type & rType )
359cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
360cdf0e10cSrcweir 	virtual void SAL_CALL	acquire() throw();
361cdf0e10cSrcweir 	virtual void SAL_CALL	release() throw();
362cdf0e10cSrcweir 
363cdf0e10cSrcweir 							// XTextField
364cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getPresentation( sal_Bool bShowCommand )
365cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
366cdf0e10cSrcweir 
367cdf0e10cSrcweir 							// XTextContent
368cdf0e10cSrcweir 	virtual void SAL_CALL	attach( const ::com::sun::star::uno::Reference<
369cdf0e10cSrcweir 								::com::sun::star::text::XTextRange >& xTextRange )
370cdf0e10cSrcweir 									throw(::com::sun::star::lang::IllegalArgumentException,
371cdf0e10cSrcweir 											::com::sun::star::uno::RuntimeException);
372cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
373cdf0e10cSrcweir 							getAnchor() throw(::com::sun::star::uno::RuntimeException);
374cdf0e10cSrcweir 
375cdf0e10cSrcweir 							// XComponent
376cdf0e10cSrcweir 	virtual void SAL_CALL	dispose() throw(::com::sun::star::uno::RuntimeException);
377cdf0e10cSrcweir 	virtual void SAL_CALL	addEventListener( const ::com::sun::star::uno::Reference<
378cdf0e10cSrcweir 								::com::sun::star::lang::XEventListener >& xListener )
379cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
380cdf0e10cSrcweir 	virtual void SAL_CALL	removeEventListener( const ::com::sun::star::uno::Reference<
381cdf0e10cSrcweir 								::com::sun::star::lang::XEventListener >& aListener )
382cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
383cdf0e10cSrcweir 
384cdf0e10cSrcweir 							// XPropertySet
385cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
386cdf0e10cSrcweir 							SAL_CALL getPropertySetInfo()
387cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
388cdf0e10cSrcweir 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
389cdf0e10cSrcweir 									const ::com::sun::star::uno::Any& aValue )
390cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
391cdf0e10cSrcweir 									::com::sun::star::beans::PropertyVetoException,
392cdf0e10cSrcweir 									::com::sun::star::lang::IllegalArgumentException,
393cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
394cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
395cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
396cdf0e10cSrcweir 									const ::rtl::OUString& PropertyName )
397cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
398cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
399cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
400cdf0e10cSrcweir 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
401cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference<
402cdf0e10cSrcweir 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
403cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
404cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
405cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
406cdf0e10cSrcweir 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
407cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference<
408cdf0e10cSrcweir 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
409cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
410cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
411cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
412cdf0e10cSrcweir 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
413cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference<
414cdf0e10cSrcweir 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
415cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
416cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
417cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
418cdf0e10cSrcweir 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
419cdf0e10cSrcweir 									const ::com::sun::star::uno::Reference<
420cdf0e10cSrcweir 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
421cdf0e10cSrcweir 								throw(::com::sun::star::beans::UnknownPropertyException,
422cdf0e10cSrcweir 									::com::sun::star::lang::WrappedTargetException,
423cdf0e10cSrcweir 									::com::sun::star::uno::RuntimeException);
424cdf0e10cSrcweir 
425cdf0e10cSrcweir 							// XUnoTunnel
426cdf0e10cSrcweir 	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
427cdf0e10cSrcweir 									sal_Int8 >& aIdentifier )
428cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
429cdf0e10cSrcweir 
430cdf0e10cSrcweir 	static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
431cdf0e10cSrcweir 	static ScHeaderFieldObj* getImplementation( const com::sun::star::uno::Reference<
432cdf0e10cSrcweir 									com::sun::star::text::XTextContent> xObj );
433cdf0e10cSrcweir 
434cdf0e10cSrcweir 							// XServiceInfo
435cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getImplementationName()
436cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
437cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
438cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
439cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
440cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
441cdf0e10cSrcweir 
442cdf0e10cSrcweir 							// XTypeProvider
443cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
444cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
445cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
446cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
447cdf0e10cSrcweir };
448cdf0e10cSrcweir 
449cdf0e10cSrcweir #endif
450cdf0e10cSrcweir 
451