Branch data 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/lang/WrappedTargetException.hpp"
9 : : #include "com/sun/star/uno/RuntimeException.hpp"
10 : : #include "com/sun/star/container/NoSuchElementException.hpp"
11 : : #include "com/sun/star/container/XElementAccess.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 : 348 : ::com::sun::star::uno::Type * operator()() const
27 : : {
28 [ + - ]: 348 : ::rtl::OUString sTypeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameAccess") );
29 : :
30 : : // Start inline typedescription generation
31 : 348 : typelib_InterfaceTypeDescription * pTD = 0;
32 : :
33 : : typelib_TypeDescriptionReference * aSuperTypes[1];
34 [ + - ]: 348 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::container::XElementAccess > >::get().getTypeLibType();
35 : 348 : typelib_TypeDescriptionReference * pMembers[3] = { 0,0,0 };
36 [ + - ]: 348 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameAccess::getByName") );
37 : : typelib_typedescriptionreference_new( &pMembers[0],
38 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
39 : 348 : sMethodName0.pData );
40 [ + - ]: 348 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameAccess::getElementNames") );
41 : : typelib_typedescriptionreference_new( &pMembers[1],
42 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
43 : 348 : sMethodName1.pData );
44 [ + - ]: 348 : ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameAccess::hasByName") );
45 : : typelib_typedescriptionreference_new( &pMembers[2],
46 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
47 : 348 : sMethodName2.pData );
48 : :
49 : : typelib_typedescription_newMIInterface(
50 : : &pTD,
51 : : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
52 : : 1, aSuperTypes,
53 : : 3,
54 : 348 : pMembers );
55 : :
56 : 348 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
57 : 348 : typelib_typedescriptionreference_release( pMembers[0] );
58 : 348 : typelib_typedescriptionreference_release( pMembers[1] );
59 : 348 : typelib_typedescriptionreference_release( pMembers[2] );
60 : 348 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
61 : :
62 : 348 : 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 : 348 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::com::sun::star::container::XNameAccess const *) {
71 : 348 : const ::com::sun::star::uno::Type &rRet = *detail::theXNameAccessType::get();
72 : : // End inline typedescription generation
73 : : static bool bInitStarted = false;
74 [ + - ]: 348 : if (!bInitStarted)
75 : : {
76 [ + - ][ + - ]: 348 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
77 [ + - ]: 348 : if (!bInitStarted)
78 : : {
79 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
80 : 348 : bInitStarted = true;
81 [ + - ]: 348 : ::cppu::UnoType< ::com::sun::star::uno::RuntimeException >::get();
82 [ + - ]: 348 : ::cppu::UnoType< ::com::sun::star::container::NoSuchElementException >::get();
83 [ + - ]: 348 : ::cppu::UnoType< ::com::sun::star::lang::WrappedTargetException >::get();
84 [ + - ]: 348 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::rtl::OUString > >::get();
85 : :
86 : 348 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
87 : : {
88 : : typelib_Parameter_Init aParameters[1];
89 [ + - ]: 348 : ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("aName") );
90 [ + - ]: 348 : ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
91 : 348 : aParameters[0].pParamName = sParamName0.pData;
92 : 348 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
93 : 348 : aParameters[0].pTypeName = sParamType0.pData;
94 : 348 : aParameters[0].bIn = sal_True;
95 : 348 : aParameters[0].bOut = sal_False;
96 [ + - ]: 348 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.NoSuchElementException"));
97 [ + - ]: 348 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.WrappedTargetException"));
98 [ + - ]: 348 : ::rtl::OUString the_ExceptionName2(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
99 : 348 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData, the_ExceptionName2.pData };
100 [ + - ]: 348 : ::rtl::OUString sReturnType0( RTL_CONSTASCII_USTRINGPARAM("any") );
101 [ + - ]: 348 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("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 : 348 : 3, the_Exceptions );
108 : 348 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
109 : : }
110 : : {
111 [ + - ]: 348 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
112 : 348 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
113 [ + - ]: 348 : ::rtl::OUString sReturnType1( RTL_CONSTASCII_USTRINGPARAM("[]string") );
114 [ + - ]: 348 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("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 : 348 : 1, the_Exceptions );
121 : 348 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
122 : : }
123 : : {
124 : : typelib_Parameter_Init aParameters[1];
125 [ + - ]: 348 : ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("aName") );
126 [ + - ]: 348 : ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
127 : 348 : aParameters[0].pParamName = sParamName0.pData;
128 : 348 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
129 : 348 : aParameters[0].pTypeName = sParamType0.pData;
130 : 348 : aParameters[0].bIn = sal_True;
131 : 348 : aParameters[0].bOut = sal_False;
132 [ + - ]: 348 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
133 : 348 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
134 [ + - ]: 348 : ::rtl::OUString sReturnType2( RTL_CONSTASCII_USTRINGPARAM("boolean") );
135 [ + - ]: 348 : ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("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 : 348 : 1, the_Exceptions );
142 : 348 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
143 : : }
144 : 348 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
145 [ + - ]: 348 : }
146 : : }
147 : : else
148 : : {
149 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
150 : : }
151 : 348 : return rRet;
152 : : }
153 : :
154 : : } } } }
155 : :
156 : : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > const *) SAL_THROW(()) {
157 : : return ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > >::get();
158 : : }
159 : :
160 : : ::com::sun::star::uno::Type const & ::com::sun::star::container::XNameAccess::static_type(SAL_UNUSED_PARAMETER void *) {
161 : : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * >(0));
162 : : }
163 : :
164 : : #endif // INCLUDED_COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP
|