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