Update ooo320-m1
[ooovba.git] / ucb / source / ucp / hierarchy / hierarchydatasource.hxx
blob4681a53df233bf92be1fae086439575c595538f3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hierarchydatasource.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _HIERARCHYDATASOURCE_HXX
32 #define _HIERARCHYDATASOURCE_HXX
34 #include <osl/mutex.hxx>
35 #include <com/sun/star/lang/XComponent.hpp>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/lang/XTypeProvider.hpp>
39 #include <cppuhelper/weak.hxx>
40 #include <ucbhelper/macros.hxx>
42 namespace cppu { class OInterfaceContainerHelper; }
44 namespace hierarchy_ucp {
46 //=========================================================================
48 class HierarchyDataSource : public cppu::OWeakObject,
49 public com::sun::star::lang::XServiceInfo,
50 public com::sun::star::lang::XTypeProvider,
51 public com::sun::star::lang::XComponent,
52 public com::sun::star::lang::XMultiServiceFactory
54 osl::Mutex m_aMutex;
55 com::sun::star::uno::Reference<
56 com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
57 com::sun::star::uno::Reference<
58 com::sun::star::lang::XMultiServiceFactory > m_xConfigProvider;
59 cppu::OInterfaceContainerHelper * m_pDisposeEventListeners;
61 public:
62 HierarchyDataSource( const com::sun::star::uno::Reference<
63 com::sun::star::lang::XMultiServiceFactory > &
64 rxServiceMgr );
65 virtual ~HierarchyDataSource();
67 // XInterface
68 XINTERFACE_DECL()
70 // XServiceInfo
71 XSERVICEINFO_DECL()
73 // XTypeProvider
74 XTYPEPROVIDER_DECL()
76 // XComponent
77 virtual void SAL_CALL
78 dispose()
79 throw ( com::sun::star::uno::RuntimeException );
80 virtual void SAL_CALL
81 addEventListener( const com::sun::star::uno::Reference<
82 com::sun::star::lang::XEventListener > & xListener )
83 throw ( com::sun::star::uno::RuntimeException );
84 virtual void SAL_CALL
85 removeEventListener( const com::sun::star::uno::Reference<
86 com::sun::star::lang::XEventListener > & aListener )
87 throw ( com::sun::star::uno::RuntimeException );
89 // XMultiServiceFactory
90 virtual com::sun::star::uno::Reference<
91 com::sun::star::uno::XInterface > SAL_CALL
92 createInstance( const rtl::OUString & aServiceSpecifier )
93 throw ( com::sun::star::uno::Exception,
94 com::sun::star::uno::RuntimeException );
95 virtual com::sun::star::uno::Reference<
96 com::sun::star::uno::XInterface > SAL_CALL
97 createInstanceWithArguments( const rtl::OUString & ServiceSpecifier,
98 const com::sun::star::uno::Sequence<
99 com::sun::star::uno::Any > & Arguments )
100 throw ( com::sun::star::uno::Exception,
101 com::sun::star::uno::RuntimeException );
102 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
103 getAvailableServiceNames()
104 throw ( com::sun::star::uno::RuntimeException );
106 // Non-Interface methods
108 private:
109 com::sun::star::uno::Reference<
110 com::sun::star::uno::XInterface > SAL_CALL
111 createInstanceWithArguments( const rtl::OUString & ServiceSpecifier,
112 const com::sun::star::uno::Sequence<
113 com::sun::star::uno::Any > & Arguments,
114 bool bCheckArgs )
115 throw ( com::sun::star::uno::Exception,
116 com::sun::star::uno::RuntimeException );
118 com::sun::star::uno::Reference<
119 com::sun::star::lang::XMultiServiceFactory >
120 getConfigProvider();
122 bool
123 createConfigPath( const rtl::OUString & rInPath, rtl::OUString & rOutPath );
126 } // namespace hierarchy_ucp
128 #endif /* !_HIERARCHYDATASOURCE_HXX */