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 _CONNECTIVITY_SDBCX_GROUP_HXX_
25 #define _CONNECTIVITY_SDBCX_GROUP_HXX_
26 
27 #include <osl/diagnose.h>
28 
29 
30 #include <com/sun/star/sdbcx/XUsersSupplier.hpp>
31 #include <com/sun/star/sdbcx/XAuthorizable.hpp>
32 #include <com/sun/star/container/XNamed.hpp>
33 #include <comphelper/proparrhlp.hxx>
34 #include <cppuhelper/compbase4.hxx>
35 //#ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
36 //#include "connectivity/CommonTools.hxx"
37 //#endif
38 #include <comphelper/broadcasthelper.hxx>
39 #include "connectivity/sdbcx/VCollection.hxx"
40 #include <comphelper/propertycontainer.hxx>
41 #include "connectivity/sdbcx/IRefreshable.hxx"
42 #include "connectivity/sdbcx/VDescriptor.hxx"
43 #include "connectivity/dbtoolsdllapi.hxx"
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 
46 namespace connectivity
47 {
48 	namespace sdbcx
49 	{
50 		typedef OCollection OUsers;
51 
52 		typedef ::cppu::WeakComponentImplHelper4<	::com::sun::star::sdbcx::XUsersSupplier,
53 													::com::sun::star::sdbcx::XAuthorizable,
54 													::com::sun::star::container::XNamed,
55 													::com::sun::star::lang::XServiceInfo> OGroup_BASE;
56 
57 		class OOO_DLLPUBLIC_DBTOOLS OGroup :
58                         public comphelper::OBaseMutex,
59 						public OGroup_BASE,
60 						public IRefreshableUsers,
61 						public ::comphelper::OPropertyArrayUsageHelper<OGroup>,
62 						public ODescriptor
63 		{
64 		protected:
65 			OUsers*			m_pUsers;
66 
67 			using OGroup_BASE::rBHelper;
68 
69 			// OPropertyArrayUsageHelper
70 			virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
71 			// OPropertySetHelper
72 			virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
73 		public:
74 			OGroup(sal_Bool _bCase);
75 			OGroup( const ::rtl::OUString& _Name,sal_Bool _bCase);
76 			virtual ~OGroup();
77 			DECLARE_SERVICE_INFO();
78 
79 			// XInterface
80             virtual void SAL_CALL acquire() throw();
81 			virtual void SAL_CALL release() throw();
82 
83 			//XInterface
84             virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
85 			//XTypeProvider
86             virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
87 
88 			// ::cppu::OComponentHelper
89 			virtual void SAL_CALL disposing(void);
90 			// XPropertySet
91             virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
92 			// XUsersSupplier
93 			virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getUsers(  ) throw(::com::sun::star::uno::RuntimeException);
94 			// XAuthorizable
95 			virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
96 			virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
97 			virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
98 			virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
99 
100 			// XNamed
101             virtual ::rtl::OUString SAL_CALL getName(  ) throw(::com::sun::star::uno::RuntimeException);
102             virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
103 		};
104 	}
105 }
106 
107 #endif // _CONNECTIVITY_SDBCX_GROUP_HXX_
108 
109 
110