Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_SECURITY_XACCESSCONTROLLER_HPP
2 : #define INCLUDED_COM_SUN_STAR_SECURITY_XACCESSCONTROLLER_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "com/sun/star/security/XAccessController.hdl"
7 :
8 : #include "com/sun/star/uno/RuntimeException.hpp"
9 : #include "com/sun/star/security/XAccessControlContext.hpp"
10 : #include "com/sun/star/uno/Exception.hpp"
11 : #include "com/sun/star/security/XAction.hpp"
12 : #include "com/sun/star/security/AccessControlException.hpp"
13 : #include "com/sun/star/uno/XInterface.hpp"
14 : #include "com/sun/star/uno/Any.hxx"
15 : #include "com/sun/star/uno/Reference.hxx"
16 : #include "com/sun/star/uno/Type.hxx"
17 : #include "cppu/unotype.hxx"
18 : #include "osl/mutex.hxx"
19 : #include "rtl/instance.hxx"
20 :
21 : namespace com { namespace sun { namespace star { namespace security { namespace detail {
22 :
23 : struct theXAccessControllerType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXAccessControllerType >
24 : {
25 0 : ::com::sun::star::uno::Type * operator()() const
26 : {
27 0 : ::rtl::OUString sTypeName( "com.sun.star.security.XAccessController" );
28 :
29 : // Start inline typedescription generation
30 0 : typelib_InterfaceTypeDescription * pTD = 0;
31 :
32 : typelib_TypeDescriptionReference * aSuperTypes[1];
33 0 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get().getTypeLibType();
34 0 : typelib_TypeDescriptionReference * pMembers[4] = { 0,0,0,0 };
35 0 : ::rtl::OUString sMethodName0( "com.sun.star.security.XAccessController::checkPermission" );
36 : typelib_typedescriptionreference_new( &pMembers[0],
37 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
38 0 : sMethodName0.pData );
39 0 : ::rtl::OUString sMethodName1( "com.sun.star.security.XAccessController::doRestricted" );
40 : typelib_typedescriptionreference_new( &pMembers[1],
41 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
42 0 : sMethodName1.pData );
43 0 : ::rtl::OUString sMethodName2( "com.sun.star.security.XAccessController::doPrivileged" );
44 : typelib_typedescriptionreference_new( &pMembers[2],
45 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
46 0 : sMethodName2.pData );
47 0 : ::rtl::OUString sMethodName3( "com.sun.star.security.XAccessController::getContext" );
48 : typelib_typedescriptionreference_new( &pMembers[3],
49 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
50 0 : sMethodName3.pData );
51 :
52 : typelib_typedescription_newMIInterface(
53 : &pTD,
54 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
55 : 1, aSuperTypes,
56 : 4,
57 0 : pMembers );
58 :
59 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
60 0 : typelib_typedescriptionreference_release( pMembers[0] );
61 0 : typelib_typedescriptionreference_release( pMembers[1] );
62 0 : typelib_typedescriptionreference_release( pMembers[2] );
63 0 : typelib_typedescriptionreference_release( pMembers[3] );
64 0 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
65 :
66 0 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
67 : }
68 : };
69 :
70 : } } } } }
71 :
72 : namespace com { namespace sun { namespace star { namespace security {
73 :
74 0 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::security::XAccessController const *) {
75 0 : const ::com::sun::star::uno::Type &rRet = *detail::theXAccessControllerType::get();
76 : // End inline typedescription generation
77 : static bool bInitStarted = false;
78 0 : if (!bInitStarted)
79 : {
80 0 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
81 0 : if (!bInitStarted)
82 : {
83 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
84 0 : bInitStarted = true;
85 0 : ::cppu::UnoType< css::uno::RuntimeException >::get();
86 0 : ::cppu::UnoType< css::security::AccessControlException >::get();
87 0 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::security::XAction > >::get();
88 0 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::security::XAccessControlContext > >::get();
89 0 : ::cppu::UnoType< css::uno::Exception >::get();
90 :
91 0 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
92 : {
93 : typelib_Parameter_Init aParameters[1];
94 0 : ::rtl::OUString sParamName0( "perm" );
95 0 : ::rtl::OUString sParamType0( "any" );
96 0 : aParameters[0].pParamName = sParamName0.pData;
97 0 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_ANY;
98 0 : aParameters[0].pTypeName = sParamType0.pData;
99 0 : aParameters[0].bIn = sal_True;
100 0 : aParameters[0].bOut = sal_False;
101 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.security.AccessControlException" );
102 0 : ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
103 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
104 0 : ::rtl::OUString sReturnType0( "void" );
105 0 : ::rtl::OUString sMethodName0( "com.sun.star.security.XAccessController::checkPermission" );
106 : typelib_typedescription_newInterfaceMethod( &pMethod,
107 : 3, sal_False,
108 : sMethodName0.pData,
109 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_VOID, sReturnType0.pData,
110 : 1, aParameters,
111 0 : 2, the_Exceptions );
112 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
113 : }
114 : {
115 : typelib_Parameter_Init aParameters[2];
116 0 : ::rtl::OUString sParamName0( "action" );
117 0 : ::rtl::OUString sParamType0( "com.sun.star.security.XAction" );
118 0 : aParameters[0].pParamName = sParamName0.pData;
119 0 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
120 0 : aParameters[0].pTypeName = sParamType0.pData;
121 0 : aParameters[0].bIn = sal_True;
122 0 : aParameters[0].bOut = sal_False;
123 0 : ::rtl::OUString sParamName1( "restriction" );
124 0 : ::rtl::OUString sParamType1( "com.sun.star.security.XAccessControlContext" );
125 0 : aParameters[1].pParamName = sParamName1.pData;
126 0 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
127 0 : aParameters[1].pTypeName = sParamType1.pData;
128 0 : aParameters[1].bIn = sal_True;
129 0 : aParameters[1].bOut = sal_False;
130 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.Exception" );
131 0 : ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
132 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
133 0 : ::rtl::OUString sReturnType1( "any" );
134 0 : ::rtl::OUString sMethodName1( "com.sun.star.security.XAccessController::doRestricted" );
135 : typelib_typedescription_newInterfaceMethod( &pMethod,
136 : 4, sal_False,
137 : sMethodName1.pData,
138 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_ANY, sReturnType1.pData,
139 : 2, aParameters,
140 0 : 2, the_Exceptions );
141 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
142 : }
143 : {
144 : typelib_Parameter_Init aParameters[2];
145 0 : ::rtl::OUString sParamName0( "action" );
146 0 : ::rtl::OUString sParamType0( "com.sun.star.security.XAction" );
147 0 : aParameters[0].pParamName = sParamName0.pData;
148 0 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
149 0 : aParameters[0].pTypeName = sParamType0.pData;
150 0 : aParameters[0].bIn = sal_True;
151 0 : aParameters[0].bOut = sal_False;
152 0 : ::rtl::OUString sParamName1( "restriction" );
153 0 : ::rtl::OUString sParamType1( "com.sun.star.security.XAccessControlContext" );
154 0 : aParameters[1].pParamName = sParamName1.pData;
155 0 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
156 0 : aParameters[1].pTypeName = sParamType1.pData;
157 0 : aParameters[1].bIn = sal_True;
158 0 : aParameters[1].bOut = sal_False;
159 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.Exception" );
160 0 : ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
161 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
162 0 : ::rtl::OUString sReturnType2( "any" );
163 0 : ::rtl::OUString sMethodName2( "com.sun.star.security.XAccessController::doPrivileged" );
164 : typelib_typedescription_newInterfaceMethod( &pMethod,
165 : 5, sal_False,
166 : sMethodName2.pData,
167 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_ANY, sReturnType2.pData,
168 : 2, aParameters,
169 0 : 2, the_Exceptions );
170 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
171 : }
172 : {
173 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
174 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
175 0 : ::rtl::OUString sReturnType3( "com.sun.star.security.XAccessControlContext" );
176 0 : ::rtl::OUString sMethodName3( "com.sun.star.security.XAccessController::getContext" );
177 : typelib_typedescription_newInterfaceMethod( &pMethod,
178 : 6, sal_False,
179 : sMethodName3.pData,
180 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE, sReturnType3.pData,
181 : 0, 0,
182 0 : 1, the_Exceptions );
183 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
184 : }
185 0 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
186 0 : }
187 : }
188 : else
189 : {
190 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
191 : }
192 0 : return rRet;
193 : }
194 :
195 : } } } }
196 :
197 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::security::XAccessController > const *) SAL_THROW(()) {
198 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::security::XAccessController > >::get();
199 : }
200 :
201 : ::com::sun::star::uno::Type const & css::security::XAccessController::static_type(SAL_UNUSED_PARAMETER void *) {
202 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::security::XAccessController > * >(0));
203 : }
204 :
205 : #endif // INCLUDED_COM_SUN_STAR_SECURITY_XACCESSCONTROLLER_HPP
|