1*6df1ea1fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*6df1ea1fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*6df1ea1fSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*6df1ea1fSAndrew Rist * distributed with this work for additional information 6*6df1ea1fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*6df1ea1fSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*6df1ea1fSAndrew Rist * "License"); you may not use this file except in compliance 9*6df1ea1fSAndrew Rist * with the License. You may obtain a copy of the License at 10*6df1ea1fSAndrew Rist * 11*6df1ea1fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*6df1ea1fSAndrew Rist * 13*6df1ea1fSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*6df1ea1fSAndrew Rist * software distributed under the License is distributed on an 15*6df1ea1fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*6df1ea1fSAndrew Rist * KIND, either express or implied. See the License for the 17*6df1ea1fSAndrew Rist * specific language governing permissions and limitations 18*6df1ea1fSAndrew Rist * under the License. 19*6df1ea1fSAndrew Rist * 20*6df1ea1fSAndrew Rist *************************************************************/ 21*6df1ea1fSAndrew Rist 22*6df1ea1fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _HIERARCHYDATASOURCE_HXX 25cdf0e10cSrcweir #define _HIERARCHYDATASOURCE_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <osl/mutex.hxx> 28cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp> 29cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 30cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 31cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp> 32cdf0e10cSrcweir #include <cppuhelper/weak.hxx> 33cdf0e10cSrcweir #include <ucbhelper/macros.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir namespace cppu { class OInterfaceContainerHelper; } 36cdf0e10cSrcweir 37cdf0e10cSrcweir namespace hierarchy_ucp { 38cdf0e10cSrcweir 39cdf0e10cSrcweir //========================================================================= 40cdf0e10cSrcweir 41cdf0e10cSrcweir class HierarchyDataSource : public cppu::OWeakObject, 42cdf0e10cSrcweir public com::sun::star::lang::XServiceInfo, 43cdf0e10cSrcweir public com::sun::star::lang::XTypeProvider, 44cdf0e10cSrcweir public com::sun::star::lang::XComponent, 45cdf0e10cSrcweir public com::sun::star::lang::XMultiServiceFactory 46cdf0e10cSrcweir { 47cdf0e10cSrcweir osl::Mutex m_aMutex; 48cdf0e10cSrcweir com::sun::star::uno::Reference< 49cdf0e10cSrcweir com::sun::star::lang::XMultiServiceFactory > m_xSMgr; 50cdf0e10cSrcweir com::sun::star::uno::Reference< 51cdf0e10cSrcweir com::sun::star::lang::XMultiServiceFactory > m_xConfigProvider; 52cdf0e10cSrcweir cppu::OInterfaceContainerHelper * m_pDisposeEventListeners; 53cdf0e10cSrcweir 54cdf0e10cSrcweir public: 55cdf0e10cSrcweir HierarchyDataSource( const com::sun::star::uno::Reference< 56cdf0e10cSrcweir com::sun::star::lang::XMultiServiceFactory > & 57cdf0e10cSrcweir rxServiceMgr ); 58cdf0e10cSrcweir virtual ~HierarchyDataSource(); 59cdf0e10cSrcweir 60cdf0e10cSrcweir // XInterface 61cdf0e10cSrcweir XINTERFACE_DECL() 62cdf0e10cSrcweir 63cdf0e10cSrcweir // XServiceInfo 64cdf0e10cSrcweir XSERVICEINFO_DECL() 65cdf0e10cSrcweir 66cdf0e10cSrcweir // XTypeProvider 67cdf0e10cSrcweir XTYPEPROVIDER_DECL() 68cdf0e10cSrcweir 69cdf0e10cSrcweir // XComponent 70cdf0e10cSrcweir virtual void SAL_CALL 71cdf0e10cSrcweir dispose() 72cdf0e10cSrcweir throw ( com::sun::star::uno::RuntimeException ); 73cdf0e10cSrcweir virtual void SAL_CALL 74cdf0e10cSrcweir addEventListener( const com::sun::star::uno::Reference< 75cdf0e10cSrcweir com::sun::star::lang::XEventListener > & xListener ) 76cdf0e10cSrcweir throw ( com::sun::star::uno::RuntimeException ); 77cdf0e10cSrcweir virtual void SAL_CALL 78cdf0e10cSrcweir removeEventListener( const com::sun::star::uno::Reference< 79cdf0e10cSrcweir com::sun::star::lang::XEventListener > & aListener ) 80cdf0e10cSrcweir throw ( com::sun::star::uno::RuntimeException ); 81cdf0e10cSrcweir 82cdf0e10cSrcweir // XMultiServiceFactory 83cdf0e10cSrcweir virtual com::sun::star::uno::Reference< 84cdf0e10cSrcweir com::sun::star::uno::XInterface > SAL_CALL 85cdf0e10cSrcweir createInstance( const rtl::OUString & aServiceSpecifier ) 86cdf0e10cSrcweir throw ( com::sun::star::uno::Exception, 87cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 88cdf0e10cSrcweir virtual com::sun::star::uno::Reference< 89cdf0e10cSrcweir com::sun::star::uno::XInterface > SAL_CALL 90cdf0e10cSrcweir createInstanceWithArguments( const rtl::OUString & ServiceSpecifier, 91cdf0e10cSrcweir const com::sun::star::uno::Sequence< 92cdf0e10cSrcweir com::sun::star::uno::Any > & Arguments ) 93cdf0e10cSrcweir throw ( com::sun::star::uno::Exception, 94cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 95cdf0e10cSrcweir virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL 96cdf0e10cSrcweir getAvailableServiceNames() 97cdf0e10cSrcweir throw ( com::sun::star::uno::RuntimeException ); 98cdf0e10cSrcweir 99cdf0e10cSrcweir // Non-Interface methods 100cdf0e10cSrcweir 101cdf0e10cSrcweir private: 102cdf0e10cSrcweir com::sun::star::uno::Reference< 103cdf0e10cSrcweir com::sun::star::uno::XInterface > SAL_CALL 104cdf0e10cSrcweir createInstanceWithArguments( const rtl::OUString & ServiceSpecifier, 105cdf0e10cSrcweir const com::sun::star::uno::Sequence< 106cdf0e10cSrcweir com::sun::star::uno::Any > & Arguments, 107cdf0e10cSrcweir bool bCheckArgs ) 108cdf0e10cSrcweir throw ( com::sun::star::uno::Exception, 109cdf0e10cSrcweir com::sun::star::uno::RuntimeException ); 110cdf0e10cSrcweir 111cdf0e10cSrcweir com::sun::star::uno::Reference< 112cdf0e10cSrcweir com::sun::star::lang::XMultiServiceFactory > 113cdf0e10cSrcweir getConfigProvider(); 114cdf0e10cSrcweir 115cdf0e10cSrcweir bool 116cdf0e10cSrcweir createConfigPath( const rtl::OUString & rInPath, rtl::OUString & rOutPath ); 117cdf0e10cSrcweir }; 118cdf0e10cSrcweir 119cdf0e10cSrcweir } // namespace hierarchy_ucp 120cdf0e10cSrcweir 121cdf0e10cSrcweir #endif /* !_HIERARCHYDATASOURCE_HXX */ 122