Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP
2 : #define INCLUDED_COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "com/sun/star/container/XNameAccess.hdl"
7 :
8 : #include "com/sun/star/container/NoSuchElementException.hpp"
9 : #include "com/sun/star/container/XElementAccess.hpp"
10 : #include "com/sun/star/lang/WrappedTargetException.hpp"
11 : #include "com/sun/star/uno/RuntimeException.hpp"
12 : #include "com/sun/star/uno/Any.hxx"
13 : #include "com/sun/star/uno/Reference.hxx"
14 : #include "com/sun/star/uno/Sequence.hxx"
15 : #include "com/sun/star/uno/Type.hxx"
16 : #include "cppu/unotype.hxx"
17 : #include "osl/mutex.hxx"
18 : #include "rtl/ustring.hxx"
19 : #include "rtl/instance.hxx"
20 : #include "sal/types.h"
21 :
22 : namespace com { namespace sun { namespace star { namespace container { namespace detail {
23 :
24 : struct theXNameAccessType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXNameAccessType >
25 : {
26 1961 : ::com::sun::star::uno::Type * operator()() const
27 : {
28 1961 : ::rtl::OUString sTypeName( "com.sun.star.container.XNameAccess" );
29 :
30 : // Start inline typedescription generation
31 1961 : typelib_InterfaceTypeDescription * pTD = 0;
32 :
33 : typelib_TypeDescriptionReference * aSuperTypes[1];
34 1961 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::container::XElementAccess > >::get().getTypeLibType();
35 1961 : typelib_TypeDescriptionReference * pMembers[3] = { 0,0,0 };
36 3922 : ::rtl::OUString sMethodName0( "com.sun.star.container.XNameAccess::getByName" );
37 : typelib_typedescriptionreference_new( &pMembers[0],
38 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
39 1961 : sMethodName0.pData );
40 3922 : ::rtl::OUString sMethodName1( "com.sun.star.container.XNameAccess::getElementNames" );
41 : typelib_typedescriptionreference_new( &pMembers[1],
42 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
43 1961 : sMethodName1.pData );
44 3922 : ::rtl::OUString sMethodName2( "com.sun.star.container.XNameAccess::hasByName" );
45 : typelib_typedescriptionreference_new( &pMembers[2],
46 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
47 1961 : sMethodName2.pData );
48 :
49 : typelib_typedescription_newMIInterface(
50 : &pTD,
51 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
52 : 1, aSuperTypes,
53 : 3,
54 1961 : pMembers );
55 :
56 1961 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
57 1961 : typelib_typedescriptionreference_release( pMembers[0] );
58 1961 : typelib_typedescriptionreference_release( pMembers[1] );
59 1961 : typelib_typedescriptionreference_release( pMembers[2] );
60 1961 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
61 :
62 3922 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
63 : }
64 : };
65 :
66 : } } } } }
67 :
68 : namespace com { namespace sun { namespace star { namespace container {
69 :
70 1101341 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::container::XNameAccess const *) {
71 1101341 : const ::com::sun::star::uno::Type &rRet = *detail::theXNameAccessType::get();
72 : // End inline typedescription generation
73 : static bool bInitStarted = false;
74 1101341 : if (!bInitStarted)
75 : {
76 1961 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
77 1961 : if (!bInitStarted)
78 : {
79 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
80 1961 : bInitStarted = true;
81 1961 : ::cppu::UnoType< css::uno::RuntimeException >::get();
82 1961 : ::cppu::UnoType< css::container::NoSuchElementException >::get();
83 1961 : ::cppu::UnoType< css::lang::WrappedTargetException >::get();
84 1961 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::rtl::OUString > >::get();
85 :
86 1961 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
87 : {
88 : typelib_Parameter_Init aParameters[1];
89 1961 : ::rtl::OUString sParamName0( "aName" );
90 3922 : ::rtl::OUString sParamType0( "string" );
91 1961 : aParameters[0].pParamName = sParamName0.pData;
92 1961 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
93 1961 : aParameters[0].pTypeName = sParamType0.pData;
94 1961 : aParameters[0].bIn = sal_True;
95 1961 : aParameters[0].bOut = sal_False;
96 3922 : ::rtl::OUString the_ExceptionName0( "com.sun.star.container.NoSuchElementException" );
97 3922 : ::rtl::OUString the_ExceptionName1( "com.sun.star.lang.WrappedTargetException" );
98 3922 : ::rtl::OUString the_ExceptionName2( "com.sun.star.uno.RuntimeException" );
99 1961 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData, the_ExceptionName2.pData };
100 3922 : ::rtl::OUString sReturnType0( "any" );
101 3922 : ::rtl::OUString sMethodName0( "com.sun.star.container.XNameAccess::getByName" );
102 : typelib_typedescription_newInterfaceMethod( &pMethod,
103 : 5, sal_False,
104 : sMethodName0.pData,
105 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_ANY, sReturnType0.pData,
106 : 1, aParameters,
107 1961 : 3, the_Exceptions );
108 3922 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
109 : }
110 : {
111 1961 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
112 1961 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
113 3922 : ::rtl::OUString sReturnType1( "[]string" );
114 3922 : ::rtl::OUString sMethodName1( "com.sun.star.container.XNameAccess::getElementNames" );
115 : typelib_typedescription_newInterfaceMethod( &pMethod,
116 : 6, sal_False,
117 : sMethodName1.pData,
118 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType1.pData,
119 : 0, 0,
120 1961 : 1, the_Exceptions );
121 3922 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
122 : }
123 : {
124 : typelib_Parameter_Init aParameters[1];
125 1961 : ::rtl::OUString sParamName0( "aName" );
126 3922 : ::rtl::OUString sParamType0( "string" );
127 1961 : aParameters[0].pParamName = sParamName0.pData;
128 1961 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
129 1961 : aParameters[0].pTypeName = sParamType0.pData;
130 1961 : aParameters[0].bIn = sal_True;
131 1961 : aParameters[0].bOut = sal_False;
132 3922 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
133 1961 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
134 3922 : ::rtl::OUString sReturnType2( "boolean" );
135 3922 : ::rtl::OUString sMethodName2( "com.sun.star.container.XNameAccess::hasByName" );
136 : typelib_typedescription_newInterfaceMethod( &pMethod,
137 : 7, sal_False,
138 : sMethodName2.pData,
139 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_BOOLEAN, sReturnType2.pData,
140 : 1, aParameters,
141 1961 : 1, the_Exceptions );
142 3922 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
143 : }
144 1961 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
145 1961 : }
146 : }
147 : else
148 : {
149 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
150 : }
151 1101341 : return rRet;
152 : }
153 :
154 : } } } }
155 :
156 821221 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::container::XNameAccess > const *) SAL_THROW(()) {
157 821221 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::container::XNameAccess > >::get();
158 : }
159 :
160 816738 : ::com::sun::star::uno::Type const & css::container::XNameAccess::static_type(SAL_UNUSED_PARAMETER void *) {
161 816738 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::container::XNameAccess > * >(0));
162 : }
163 :
164 : #endif // INCLUDED_COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP
|