xref: /aoo4110/main/ucb/source/core/ucbprops.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _UCBPROPS_HXX
25 #define _UCBPROPS_HXX
26 
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 #include <com/sun/star/lang/XTypeProvider.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <com/sun/star/beans/XPropertySetInfo.hpp>
31 #include <cppuhelper/weak.hxx>
32 #include <osl/mutex.hxx>
33 #include <ucbhelper/macros.hxx>
34 
35 //=========================================================================
36 
37 #define PROPERTIES_MANAGER_SERVICE_NAME "com.sun.star.ucb.PropertiesManager"
38 
39 //============================================================================
40 //
41 // class UcbPropertiesManager.
42 //
43 //============================================================================
44 
45 class UcbPropertiesManager :
46 				public cppu::OWeakObject,
47 				public com::sun::star::lang::XTypeProvider,
48 				public com::sun::star::lang::XServiceInfo,
49 				public com::sun::star::beans::XPropertySetInfo
50 {
51 	com::sun::star::uno::Sequence< com::sun::star::beans::Property >*
52 								m_pProps;
53 	osl::Mutex					m_aMutex;
54 
55 private:
56     sal_Bool queryProperty( const rtl::OUString& rName,
57 							com::sun::star::beans::Property& rProp );
58 
59 public:
60 	UcbPropertiesManager( const com::sun::star::uno::Reference<
61 							com::sun::star::lang::XMultiServiceFactory >&
62 								rxSMgr );
63 	virtual ~UcbPropertiesManager();
64 
65 	// XInterface
66 	XINTERFACE_DECL()
67 
68 	// XTypeProvider
69 	XTYPEPROVIDER_DECL()
70 
71     // XServiceInfo
72 	XSERVICEINFO_DECL()
73 
74 	// XPropertySetInfo
75     virtual com::sun::star::uno::Sequence<
76 				com::sun::star::beans::Property > SAL_CALL
77 	getProperties()
78 		throw( com::sun::star::uno::RuntimeException );
79     virtual com::sun::star::beans::Property SAL_CALL
80 	getPropertyByName( const rtl::OUString& aName )
81 		throw( com::sun::star::beans::UnknownPropertyException,
82 			   com::sun::star::uno::RuntimeException );
83     virtual sal_Bool SAL_CALL
84 	hasPropertyByName( const rtl::OUString& Name )
85 		throw( com::sun::star::uno::RuntimeException );
86 };
87 
88 #endif /* !_UCBPROPS_HXX */
89 
90