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 10*1d2dbeb0SAndrew Rist * 11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*1d2dbeb0SAndrew Rist * 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. 19*1d2dbeb0SAndrew Rist * 20*1d2dbeb0SAndrew Rist *************************************************************/ 21*1d2dbeb0SAndrew Rist 22*1d2dbeb0SAndrew Rist 23cdf0e10cSrcweir #ifndef _UNOATXT_HXX 24cdf0e10cSrcweir #define _UNOATXT_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <com/sun/star/text/XAutoTextGroup.hpp> 27cdf0e10cSrcweir #include <com/sun/star/text/XAutoTextEntry.hpp> 28cdf0e10cSrcweir #include <com/sun/star/text/XAutoTextContainer.hpp> 29cdf0e10cSrcweir #include <com/sun/star/text/XText.hpp> 30cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 31cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 32cdf0e10cSrcweir #include <com/sun/star/container/XNamed.hpp> 33cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp> 34cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 35cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 36cdf0e10cSrcweir #include <com/sun/star/document/XEventsSupplier.hpp> 37cdf0e10cSrcweir #include <svl/itemprop.hxx> 38cdf0e10cSrcweir #include <svl/lstner.hxx> 39cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> // helper for implementations 40cdf0e10cSrcweir #include <cppuhelper/implbase4.hxx> // helper for implementations 41cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> // helper for implementations 42cdf0e10cSrcweir #include <cppuhelper/implbase6.hxx> // helper for implementations 43cdf0e10cSrcweir #include <svtools/unoevent.hxx> 44cdf0e10cSrcweir class SwTextBlocks; 45cdf0e10cSrcweir class SwGlossaries; 46cdf0e10cSrcweir class SwDoc; 47cdf0e10cSrcweir class SwDocShell; 48cdf0e10cSrcweir class SwXBodyText; 49cdf0e10cSrcweir 50cdf0e10cSrcweir #ifndef SW_DECL_SWDOCSHELL_DEFINED 51cdf0e10cSrcweir #define SW_DECL_SWDOCSHELL_DEFINED 52cdf0e10cSrcweir #include <tools/ref.hxx> 53cdf0e10cSrcweir SV_DECL_REF( SwDocShell ) 54cdf0e10cSrcweir #endif 55cdf0e10cSrcweir 56cdf0e10cSrcweir 57cdf0e10cSrcweir /****************************************************************************** 58cdf0e10cSrcweir * 59cdf0e10cSrcweir ******************************************************************************/ 60cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 61cdf0e10cSrcweir SAL_CALL SwXAutoTextContainer_createInstance( 62cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & ) throw ( ::com::sun::star::uno::Exception ); 63cdf0e10cSrcweir 64cdf0e10cSrcweir class SwXAutoTextContainer : public cppu::WeakImplHelper3 65cdf0e10cSrcweir < 66cdf0e10cSrcweir ::com::sun::star::text::XAutoTextContainer, 67cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo, 68cdf0e10cSrcweir ::com::sun::star::container::XIndexAccess 69cdf0e10cSrcweir > 70cdf0e10cSrcweir { 71cdf0e10cSrcweir SwGlossaries *pGlossaries; 72cdf0e10cSrcweir 73cdf0e10cSrcweir protected: 74cdf0e10cSrcweir virtual ~SwXAutoTextContainer(); // ref-counted objects are not to be deleted from outside -> protected dtor 75cdf0e10cSrcweir 76cdf0e10cSrcweir public: 77cdf0e10cSrcweir SwXAutoTextContainer(); 78cdf0e10cSrcweir 79cdf0e10cSrcweir //XIndexAccess 80cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException); 81cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 82cdf0e10cSrcweir 83cdf0e10cSrcweir //XNameAccess 84cdf0e10cSrcweir 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 ); 85cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); 86cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); 87cdf0e10cSrcweir 88cdf0e10cSrcweir //XElementAccess 89cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 90cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 91cdf0e10cSrcweir 92cdf0e10cSrcweir //XAutoTextContainer 93cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XAutoTextGroup > SAL_CALL insertNewByName(const rtl::OUString& aGroupName) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException ); 94cdf0e10cSrcweir virtual void SAL_CALL removeByName(const rtl::OUString& aGroupName) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException ); 95cdf0e10cSrcweir 96cdf0e10cSrcweir //XServiceInfo 97cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 98cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 99cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 100cdf0e10cSrcweir 101cdf0e10cSrcweir }; 102cdf0e10cSrcweir 103cdf0e10cSrcweir /* -----------------26.05.98 15:55------------------- 104cdf0e10cSrcweir * 105cdf0e10cSrcweir * --------------------------------------------------*/ 106cdf0e10cSrcweir class SwXAutoTextGroup : public cppu::WeakImplHelper6 107cdf0e10cSrcweir < 108cdf0e10cSrcweir ::com::sun::star::text::XAutoTextGroup, 109cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet, 110cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo, 111cdf0e10cSrcweir ::com::sun::star::container::XIndexAccess, 112cdf0e10cSrcweir ::com::sun::star::container::XNamed, 113cdf0e10cSrcweir ::com::sun::star::lang::XUnoTunnel 114cdf0e10cSrcweir > 115cdf0e10cSrcweir { 116cdf0e10cSrcweir const SfxItemPropertySet* pPropSet; 117cdf0e10cSrcweir SwGlossaries* pGlossaries; 118cdf0e10cSrcweir rtl::OUString sName; 119cdf0e10cSrcweir String m_sGroupName; // prefix m_ to disambiguate from some local vars in the implementation 120cdf0e10cSrcweir 121cdf0e10cSrcweir protected: 122cdf0e10cSrcweir virtual ~SwXAutoTextGroup(); // ref-counted objects are not to be deleted from outside -> protected dtor 123cdf0e10cSrcweir 124cdf0e10cSrcweir public: 125cdf0e10cSrcweir SwXAutoTextGroup(const rtl::OUString& rName, SwGlossaries* pGloss/*SwTextBlocks* pGroup*/); 126cdf0e10cSrcweir 127cdf0e10cSrcweir 128cdf0e10cSrcweir static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); 129cdf0e10cSrcweir 130cdf0e10cSrcweir //XUnoTunnel 131cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); 132cdf0e10cSrcweir 133cdf0e10cSrcweir //XAutoTextGroup 134cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getTitles(void) throw( ::com::sun::star::uno::RuntimeException ); 135cdf0e10cSrcweir virtual void SAL_CALL renameByName(const rtl::OUString& aElementName, const rtl::OUString& aNewElementName, const rtl::OUString& aNewElementTitle) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); 136cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XAutoTextEntry > SAL_CALL insertNewByName(const rtl::OUString& aName, const rtl::OUString& aTitle, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException ); 137cdf0e10cSrcweir virtual void SAL_CALL removeByName(const rtl::OUString& aEntryName) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException ); 138cdf0e10cSrcweir 139cdf0e10cSrcweir //XNamed 140cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); 141cdf0e10cSrcweir virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); 142cdf0e10cSrcweir 143cdf0e10cSrcweir //XIndexAccess 144cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException); 145cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 146cdf0e10cSrcweir 147cdf0e10cSrcweir //XNameAccess 148cdf0e10cSrcweir 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 ); 149cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); 150cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); 151cdf0e10cSrcweir 152cdf0e10cSrcweir //XElementAccess 153cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 154cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 155cdf0e10cSrcweir 156cdf0e10cSrcweir //XServiceInfo 157cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 158cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 159cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 160cdf0e10cSrcweir 161cdf0e10cSrcweir //XPropertySet 162cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 163cdf0e10cSrcweir 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); 164cdf0e10cSrcweir 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); 165cdf0e10cSrcweir 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); 166cdf0e10cSrcweir 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); 167cdf0e10cSrcweir 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); 168cdf0e10cSrcweir 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); 169cdf0e10cSrcweir 170cdf0e10cSrcweir // 171cdf0e10cSrcweir void Invalidate(); 172cdf0e10cSrcweir }; 173cdf0e10cSrcweir 174cdf0e10cSrcweir /* -----------------17.06.98 12:03------------------- 175cdf0e10cSrcweir * 176cdf0e10cSrcweir * --------------------------------------------------*/ 177cdf0e10cSrcweir class SwXAutoTextEntry 178cdf0e10cSrcweir :public SfxListener 179cdf0e10cSrcweir ,public cppu::WeakImplHelper5 180cdf0e10cSrcweir < 181cdf0e10cSrcweir ::com::sun::star::text::XAutoTextEntry, 182cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo, 183cdf0e10cSrcweir ::com::sun::star::lang::XUnoTunnel, 184cdf0e10cSrcweir ::com::sun::star::text::XText, 185cdf0e10cSrcweir ::com::sun::star::document::XEventsSupplier 186cdf0e10cSrcweir > 187cdf0e10cSrcweir { 188cdf0e10cSrcweir SwGlossaries* pGlossaries; 189cdf0e10cSrcweir String sGroupName; 190cdf0e10cSrcweir String sEntryName; 191cdf0e10cSrcweir SwDocShellRef xDocSh; 192cdf0e10cSrcweir SwXBodyText* pBodyText; 193cdf0e10cSrcweir com::sun::star::uno::Reference < com::sun::star::lang::XServiceInfo> xBodyText; 194cdf0e10cSrcweir EnsureBodyText()195cdf0e10cSrcweir void EnsureBodyText () 196cdf0e10cSrcweir { 197cdf0e10cSrcweir if ( !pBodyText ) 198cdf0e10cSrcweir GetBodyText(); 199cdf0e10cSrcweir } 200cdf0e10cSrcweir void GetBodyText (); 201cdf0e10cSrcweir 202cdf0e10cSrcweir protected: 203cdf0e10cSrcweir /** ensure that the current content (which may only be in-memory so far) is flushed to the auto text group file 204cdf0e10cSrcweir 205cdf0e10cSrcweir <p>If somebody modifies an auto text via this class, then this is not directly reflected to the respective 206cdf0e10cSrcweir glossaries file (on disk), instead we hold a copy of this text (in [p|x]BodyText). On the other hand, 207cdf0e10cSrcweir in applyTo, we do not work with this _copy_, but just tell the target for the application to insert 208cdf0e10cSrcweir the content which we're responsible for - and this target doesn't know about our copy, but only 209cdf0e10cSrcweir about the persistent version.</br> 210cdf0e10cSrcweir So we need to ensure that before somebody else does something with our auto text, we flush our 211cdf0e10cSrcweir (in-memory) copy to disk.</p> 212cdf0e10cSrcweir 213cdf0e10cSrcweir */ 214cdf0e10cSrcweir void implFlushDocument( bool _bCloseDoc = false ); 215cdf0e10cSrcweir 216cdf0e10cSrcweir // SfxListener overridables 217cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 218cdf0e10cSrcweir 219cdf0e10cSrcweir protected: 220cdf0e10cSrcweir virtual ~SwXAutoTextEntry(); // ref-counted objects are not to be deleted from outside -> protected dtor 221cdf0e10cSrcweir 222cdf0e10cSrcweir public: 223cdf0e10cSrcweir SwXAutoTextEntry(SwGlossaries* , const String& rGroupName, const String& rEntryName); 224cdf0e10cSrcweir 225cdf0e10cSrcweir static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); 226cdf0e10cSrcweir 227cdf0e10cSrcweir //XUnoTunnel 228cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); 229cdf0e10cSrcweir 230cdf0e10cSrcweir //XText 231cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); 232cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); 233cdf0e10cSrcweir virtual void SAL_CALL insertString(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, const rtl::OUString& aString, sal_Bool bAbsorb) throw( ::com::sun::star::uno::RuntimeException ); 234cdf0e10cSrcweir virtual void SAL_CALL insertControlCharacter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); 235cdf0e10cSrcweir virtual void SAL_CALL insertTextContent(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & xContent, sal_Bool bAbsorb) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); 236cdf0e10cSrcweir virtual void SAL_CALL removeTextContent(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & xContent) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); 237cdf0e10cSrcweir 238cdf0e10cSrcweir //XTextRange 239cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); 240cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); 241cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); 242cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); 243cdf0e10cSrcweir virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); 244cdf0e10cSrcweir 245cdf0e10cSrcweir //XAutoTextEntry 246cdf0e10cSrcweir virtual void SAL_CALL applyTo(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange)throw( ::com::sun::star::uno::RuntimeException ); 247cdf0e10cSrcweir 248cdf0e10cSrcweir //XServiceInfo 249cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 250cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 251cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 252cdf0e10cSrcweir 253cdf0e10cSrcweir // XEventsSupplier 254cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw( ::com::sun::star::uno::RuntimeException ); 255cdf0e10cSrcweir Invalidate()256cdf0e10cSrcweir void Invalidate() {pGlossaries = 0;} GetGlossaries()257cdf0e10cSrcweir const SwGlossaries* GetGlossaries() { return pGlossaries; } GetGroupName()258cdf0e10cSrcweir const String& GetGroupName() {return sGroupName;} GetEntryName()259cdf0e10cSrcweir const String& GetEntryName() {return sEntryName;} 260cdf0e10cSrcweir }; 261cdf0e10cSrcweir 262cdf0e10cSrcweir 263cdf0e10cSrcweir /** Implement the XNameAccess for the AutoText events */ 264cdf0e10cSrcweir class SwAutoTextEventDescriptor : public SvBaseEventDescriptor 265cdf0e10cSrcweir { 266cdf0e10cSrcweir ::rtl::OUString sSwAutoTextEventDescriptor; 267cdf0e10cSrcweir 268cdf0e10cSrcweir SwXAutoTextEntry& rAutoTextEntry; 269cdf0e10cSrcweir 270cdf0e10cSrcweir using SvBaseEventDescriptor::replaceByName; 271cdf0e10cSrcweir using SvBaseEventDescriptor::getByName; 272cdf0e10cSrcweir 273cdf0e10cSrcweir public: 274cdf0e10cSrcweir SwAutoTextEventDescriptor( SwXAutoTextEntry& rAutoText ); 275cdf0e10cSrcweir 276cdf0e10cSrcweir ~SwAutoTextEventDescriptor(); 277cdf0e10cSrcweir 278cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName(void) 279cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ); 280cdf0e10cSrcweir 281cdf0e10cSrcweir protected: 282cdf0e10cSrcweir 283cdf0e10cSrcweir virtual void replaceByName( 284cdf0e10cSrcweir const sal_uInt16 nEvent, /// item ID of event 285cdf0e10cSrcweir const SvxMacro& rMacro) /// event (will be copied) 286cdf0e10cSrcweir throw( 287cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 288cdf0e10cSrcweir ::com::sun::star::container::NoSuchElementException, 289cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 290cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 291cdf0e10cSrcweir 292cdf0e10cSrcweir virtual void getByName( 293cdf0e10cSrcweir SvxMacro& rMacro, /// macro to be filled 294cdf0e10cSrcweir const sal_uInt16 nEvent ) /// item ID of event 295cdf0e10cSrcweir throw( 296cdf0e10cSrcweir ::com::sun::star::container::NoSuchElementException, 297cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 298cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 299cdf0e10cSrcweir }; 300cdf0e10cSrcweir 301cdf0e10cSrcweir 302cdf0e10cSrcweir #endif 303