Branch data Line data Source code
1 : : #ifndef INCLUDED_COM_SUN_STAR_REFLECTION_XENUMTYPEDESCRIPTION_HPP
2 : : #define INCLUDED_COM_SUN_STAR_REFLECTION_XENUMTYPEDESCRIPTION_HPP
3 : :
4 : : #include "sal/config.h"
5 : :
6 : : #include "com/sun/star/reflection/XEnumTypeDescription.hdl"
7 : :
8 : : #include "com/sun/star/uno/RuntimeException.hpp"
9 : : #include "com/sun/star/reflection/XTypeDescription.hpp"
10 : : #include "com/sun/star/uno/Reference.hxx"
11 : : #include "com/sun/star/uno/Sequence.hxx"
12 : : #include "com/sun/star/uno/Type.hxx"
13 : : #include "cppu/unotype.hxx"
14 : : #include "osl/mutex.hxx"
15 : : #include "rtl/ustring.hxx"
16 : : #include "rtl/instance.hxx"
17 : : #include "sal/types.h"
18 : :
19 : : namespace com { namespace sun { namespace star { namespace reflection { namespace detail {
20 : :
21 : : struct theXEnumTypeDescriptionType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXEnumTypeDescriptionType >
22 : : {
23 : 326 : ::com::sun::star::uno::Type * operator()() const
24 : : {
25 [ + - ]: 326 : ::rtl::OUString sTypeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XEnumTypeDescription") );
26 : :
27 : : // Start inline typedescription generation
28 : 326 : typelib_InterfaceTypeDescription * pTD = 0;
29 : :
30 : : typelib_TypeDescriptionReference * aSuperTypes[1];
31 [ + - ]: 326 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XTypeDescription > >::get().getTypeLibType();
32 : 326 : typelib_TypeDescriptionReference * pMembers[3] = { 0,0,0 };
33 [ + - ]: 326 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XEnumTypeDescription::getDefaultEnumValue") );
34 : : typelib_typedescriptionreference_new( &pMembers[0],
35 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
36 : 326 : sMethodName0.pData );
37 [ + - ]: 326 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XEnumTypeDescription::getEnumNames") );
38 : : typelib_typedescriptionreference_new( &pMembers[1],
39 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
40 : 326 : sMethodName1.pData );
41 [ + - ]: 326 : ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XEnumTypeDescription::getEnumValues") );
42 : : typelib_typedescriptionreference_new( &pMembers[2],
43 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
44 : 326 : sMethodName2.pData );
45 : :
46 : : typelib_typedescription_newMIInterface(
47 : : &pTD,
48 : : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
49 : : 1, aSuperTypes,
50 : : 3,
51 : 326 : pMembers );
52 : :
53 : 326 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
54 : 326 : typelib_typedescriptionreference_release( pMembers[0] );
55 : 326 : typelib_typedescriptionreference_release( pMembers[1] );
56 : 326 : typelib_typedescriptionreference_release( pMembers[2] );
57 : 326 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
58 : :
59 : 326 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
60 : : }
61 : : };
62 : :
63 : : } } } } }
64 : :
65 : : namespace com { namespace sun { namespace star { namespace reflection {
66 : :
67 : 326 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::com::sun::star::reflection::XEnumTypeDescription const *) {
68 : 326 : const ::com::sun::star::uno::Type &rRet = *detail::theXEnumTypeDescriptionType::get();
69 : : // End inline typedescription generation
70 : : static bool bInitStarted = false;
71 [ + - ]: 326 : if (!bInitStarted)
72 : : {
73 [ + - ][ + - ]: 326 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
74 [ + - ]: 326 : if (!bInitStarted)
75 : : {
76 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
77 : 326 : bInitStarted = true;
78 [ + - ]: 326 : ::cppu::UnoType< ::com::sun::star::uno::RuntimeException >::get();
79 [ + - ]: 326 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::rtl::OUString > >::get();
80 [ + - ]: 326 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::sal_Int32 > >::get();
81 : :
82 : 326 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
83 : : {
84 [ + - ]: 326 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
85 : 326 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
86 [ + - ]: 326 : ::rtl::OUString sReturnType0( RTL_CONSTASCII_USTRINGPARAM("long") );
87 [ + - ]: 326 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XEnumTypeDescription::getDefaultEnumValue") );
88 : : typelib_typedescription_newInterfaceMethod( &pMethod,
89 : : 5, sal_False,
90 : : sMethodName0.pData,
91 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_LONG, sReturnType0.pData,
92 : : 0, 0,
93 : 326 : 1, the_Exceptions );
94 : 326 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
95 : : }
96 : : {
97 [ + - ]: 326 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
98 : 326 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
99 [ + - ]: 326 : ::rtl::OUString sReturnType1( RTL_CONSTASCII_USTRINGPARAM("[]string") );
100 [ + - ]: 326 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XEnumTypeDescription::getEnumNames") );
101 : : typelib_typedescription_newInterfaceMethod( &pMethod,
102 : : 6, sal_False,
103 : : sMethodName1.pData,
104 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType1.pData,
105 : : 0, 0,
106 : 326 : 1, the_Exceptions );
107 : 326 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
108 : : }
109 : : {
110 [ + - ]: 326 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
111 : 326 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
112 [ + - ]: 326 : ::rtl::OUString sReturnType2( RTL_CONSTASCII_USTRINGPARAM("[]long") );
113 [ + - ]: 326 : ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.XEnumTypeDescription::getEnumValues") );
114 : : typelib_typedescription_newInterfaceMethod( &pMethod,
115 : : 7, sal_False,
116 : : sMethodName2.pData,
117 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType2.pData,
118 : : 0, 0,
119 : 326 : 1, the_Exceptions );
120 : 326 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
121 : : }
122 : 326 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
123 [ + - ]: 326 : }
124 : : }
125 : : else
126 : : {
127 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
128 : : }
129 : 326 : return rRet;
130 : : }
131 : :
132 : : } } } }
133 : :
134 : 326 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XEnumTypeDescription > const *) SAL_THROW(()) {
135 : 326 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XEnumTypeDescription > >::get();
136 : : }
137 : :
138 : 326 : ::com::sun::star::uno::Type const & ::com::sun::star::reflection::XEnumTypeDescription::static_type(SAL_UNUSED_PARAMETER void *) {
139 : 326 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XEnumTypeDescription > * >(0));
140 : : }
141 : :
142 : : #endif // INCLUDED_COM_SUN_STAR_REFLECTION_XENUMTYPEDESCRIPTION_HPP
|