xref: /trunk/main/ucb/source/core/ucbprops.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _UCBPROPS_HXX
29 #define _UCBPROPS_HXX
30 
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/lang/XTypeProvider.hpp>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/beans/XPropertySetInfo.hpp>
35 #include <cppuhelper/weak.hxx>
36 #include <osl/mutex.hxx>
37 #include <ucbhelper/macros.hxx>
38 
39 //=========================================================================
40 
41 #define PROPERTIES_MANAGER_SERVICE_NAME "com.sun.star.ucb.PropertiesManager"
42 
43 //============================================================================
44 //
45 // class UcbPropertiesManager.
46 //
47 //============================================================================
48 
49 class UcbPropertiesManager :
50                 public cppu::OWeakObject,
51                 public com::sun::star::lang::XTypeProvider,
52                 public com::sun::star::lang::XServiceInfo,
53                 public com::sun::star::beans::XPropertySetInfo
54 {
55     com::sun::star::uno::Sequence< com::sun::star::beans::Property >*
56                                 m_pProps;
57     osl::Mutex                  m_aMutex;
58 
59 private:
60     sal_Bool queryProperty( const rtl::OUString& rName,
61                             com::sun::star::beans::Property& rProp );
62 
63 public:
64     UcbPropertiesManager( const com::sun::star::uno::Reference<
65                             com::sun::star::lang::XMultiServiceFactory >&
66                                 rxSMgr );
67     virtual ~UcbPropertiesManager();
68 
69     // XInterface
70     XINTERFACE_DECL()
71 
72     // XTypeProvider
73     XTYPEPROVIDER_DECL()
74 
75     // XServiceInfo
76     XSERVICEINFO_DECL()
77 
78     // XPropertySetInfo
79     virtual com::sun::star::uno::Sequence<
80                 com::sun::star::beans::Property > SAL_CALL
81     getProperties()
82         throw( com::sun::star::uno::RuntimeException );
83     virtual com::sun::star::beans::Property SAL_CALL
84     getPropertyByName( const rtl::OUString& aName )
85         throw( com::sun::star::beans::UnknownPropertyException,
86                com::sun::star::uno::RuntimeException );
87     virtual sal_Bool SAL_CALL
88     hasPropertyByName( const rtl::OUString& Name )
89         throw( com::sun::star::uno::RuntimeException );
90 };
91 
92 #endif /* !_UCBPROPS_HXX */
93 
94