1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hierarchydatasource.hxx,v $
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
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
;
62 HierarchyDataSource( const com::sun::star::uno::Reference
<
63 com::sun::star::lang::XMultiServiceFactory
> &
65 virtual ~HierarchyDataSource();
79 throw ( com::sun::star::uno::RuntimeException
);
81 addEventListener( const com::sun::star::uno::Reference
<
82 com::sun::star::lang::XEventListener
> & xListener
)
83 throw ( com::sun::star::uno::RuntimeException
);
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
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
,
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
>
123 createConfigPath( const rtl::OUString
& rInPath
, rtl::OUString
& rOutPath
);
126 } // namespace hierarchy_ucp
128 #endif /* !_HIERARCHYDATASOURCE_HXX */