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