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 101d2dbeb0SAndrew Rist * 111d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 121d2dbeb0SAndrew Rist * 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. 191d2dbeb0SAndrew Rist * 201d2dbeb0SAndrew Rist *************************************************************/ 211d2dbeb0SAndrew Rist 221d2dbeb0SAndrew 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; GetDoc()115cdf0e10cSrcweir SwDoc* GetDoc() {return m_pDoc;} 116cdf0e10cSrcweir IsDescriptor() const117cdf0e10cSrcweir sal_Bool IsDescriptor()const {return m_bIsDescriptor;} GetResId() const118cdf0e10cSrcweir 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 { 132*dec99bbdSOliver-Rainer Wittmann SwEventListenerContainer m_aLstnrCntnr; 133*dec99bbdSOliver-Rainer Wittmann const SwFmtFld* m_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(); } GetDoc()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; GetFldFmt()200*dec99bbdSOliver-Rainer Wittmann const SwFmtFld* GetFldFmt(){return GetField() ? m_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); 2063b32dd21SOliver-Rainer Wittmann sal_uInt16 GetServiceId(); 207cdf0e10cSrcweir }; 208cdf0e10cSrcweir 209cdf0e10cSrcweir 210cdf0e10cSrcweir typedef 211cdf0e10cSrcweir cppu::WeakImplHelper2 212cdf0e10cSrcweir < 213cdf0e10cSrcweir ::com::sun::star::container::XNameAccess, 214cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo 215cdf0e10cSrcweir > 216cdf0e10cSrcweir SwXTextFieldMastersBaseClass; 217cdf0e10cSrcweir class SwXTextFieldMasters : public SwXTextFieldMastersBaseClass, 218cdf0e10cSrcweir public SwUnoCollection 219cdf0e10cSrcweir { 220cdf0e10cSrcweir protected: 221cdf0e10cSrcweir virtual ~SwXTextFieldMasters(); 222cdf0e10cSrcweir public: 223cdf0e10cSrcweir SwXTextFieldMasters(SwDoc* pDoc); 224cdf0e10cSrcweir 225cdf0e10cSrcweir 226cdf0e10cSrcweir //XNameAccess 227cdf0e10cSrcweir 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 ); 228cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); 229cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); 230cdf0e10cSrcweir 231cdf0e10cSrcweir //XElementAccess 232cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 233cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 234cdf0e10cSrcweir 235cdf0e10cSrcweir //XServiceInfo 236cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 237cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 238cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 239cdf0e10cSrcweir 240cdf0e10cSrcweir 241cdf0e10cSrcweir static sal_Bool getInstanceName(const SwFieldType& rFldType, String& rName); 242cdf0e10cSrcweir }; 243cdf0e10cSrcweir 244cdf0e10cSrcweir /* -----------------21.12.98 10:26------------------- 245cdf0e10cSrcweir * 246cdf0e10cSrcweir * --------------------------------------------------*/ 247cdf0e10cSrcweir typedef 248cdf0e10cSrcweir cppu::WeakImplHelper3 249cdf0e10cSrcweir < 250cdf0e10cSrcweir ::com::sun::star::container::XEnumerationAccess, 251cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo, 252cdf0e10cSrcweir ::com::sun::star::util::XRefreshable 253cdf0e10cSrcweir > 254cdf0e10cSrcweir SwXTextFieldTypesBaseClass; 255cdf0e10cSrcweir class SwXTextFieldTypes : public SwXTextFieldTypesBaseClass, 256cdf0e10cSrcweir public SwUnoCollection 257cdf0e10cSrcweir { 258cdf0e10cSrcweir SwRefreshListenerContainer aRefreshCont; 259cdf0e10cSrcweir protected: 260cdf0e10cSrcweir virtual ~SwXTextFieldTypes(); 261cdf0e10cSrcweir public: 262cdf0e10cSrcweir SwXTextFieldTypes(SwDoc* pDoc); 263cdf0e10cSrcweir 264cdf0e10cSrcweir 265cdf0e10cSrcweir //XEnumerationAccess 266cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); 267cdf0e10cSrcweir 268cdf0e10cSrcweir //XElementAccess 269cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 270cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 271cdf0e10cSrcweir 272cdf0e10cSrcweir // ::com::sun::star::util::XRefreshable 273cdf0e10cSrcweir virtual void SAL_CALL refresh( ) throw(::com::sun::star::uno::RuntimeException); 274cdf0e10cSrcweir virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException); 275cdf0e10cSrcweir virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException); 276cdf0e10cSrcweir 277cdf0e10cSrcweir //XServiceInfo 278cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 279cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 280cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 281cdf0e10cSrcweir 282cdf0e10cSrcweir // SwUnoCollection 283cdf0e10cSrcweir virtual void Invalidate(); 284cdf0e10cSrcweir }; 285cdf0e10cSrcweir 286cdf0e10cSrcweir class SwXFieldEnumeration : public cppu::WeakImplHelper2 287cdf0e10cSrcweir < 288cdf0e10cSrcweir ::com::sun::star::container::XEnumeration, 289cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo 290cdf0e10cSrcweir >, 291cdf0e10cSrcweir public SwClient 292cdf0e10cSrcweir { 293cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > > aItems; 294cdf0e10cSrcweir sal_Int32 nNextIndex; // index of next element to be returned 295cdf0e10cSrcweir 296cdf0e10cSrcweir SwDoc* pDoc; 297cdf0e10cSrcweir 298cdf0e10cSrcweir protected: 299cdf0e10cSrcweir virtual ~SwXFieldEnumeration(); 300cdf0e10cSrcweir //SwClient 301cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); 302cdf0e10cSrcweir public: 303cdf0e10cSrcweir SwXFieldEnumeration(SwDoc* pDoc); 304cdf0e10cSrcweir 305cdf0e10cSrcweir //XEnumeration 306cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException ); 307cdf0e10cSrcweir 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 ); 308cdf0e10cSrcweir 309cdf0e10cSrcweir //XServiceInfo 310cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 311cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 312cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 313cdf0e10cSrcweir 314cdf0e10cSrcweir }; 315cdf0e10cSrcweir #endif 316cdf0e10cSrcweir 317cdf0e10cSrcweir 318cdf0e10cSrcweir 319