Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_COM_SUN_STAR_UNO_TYPE_HXX
20 : #define INCLUDED_COM_SUN_STAR_UNO_TYPE_HXX
21 :
22 : #include <com/sun/star/uno/Type.h>
23 : #include <cppu/unotype.hxx>
24 :
25 : namespace com
26 : {
27 : namespace sun
28 : {
29 : namespace star
30 : {
31 : namespace uno
32 : {
33 :
34 :
35 10432881 : inline Type::Type()
36 : {
37 : _pType = reinterpret_cast< const ::com::sun::star::uno::Type * >(
38 10432881 : ::typelib_static_type_getByTypeClass( typelib_TypeClass_VOID ) )->getTypeLibType();
39 10432881 : ::typelib_typedescriptionreference_acquire( _pType );
40 10432881 : }
41 :
42 140239 : inline Type::Type( TypeClass eTypeClass, const ::rtl::OUString & rTypeName )
43 140239 : : _pType( 0 )
44 : {
45 140239 : ::typelib_typedescriptionreference_new( &_pType, (typelib_TypeClass)eTypeClass, rTypeName.pData );
46 140239 : }
47 :
48 : inline Type::Type( TypeClass eTypeClass, const sal_Char * pTypeName )
49 : : _pType( 0 )
50 : {
51 : ::typelib_typedescriptionreference_newByAsciiName( &_pType, (typelib_TypeClass)eTypeClass, pTypeName );
52 : }
53 :
54 777767 : inline Type::Type( typelib_TypeDescriptionReference * pType )
55 777767 : : _pType( pType )
56 : {
57 777767 : ::typelib_typedescriptionreference_acquire( _pType );
58 777767 : }
59 :
60 : inline Type::Type( typelib_TypeDescriptionReference * pType, UnoType_NoAcquire )
61 : : _pType( pType )
62 : {
63 : }
64 :
65 : inline Type::Type( typelib_TypeDescriptionReference * pType, __sal_NoAcquire )
66 : : _pType( pType )
67 : {
68 : }
69 :
70 23554900 : inline Type::Type( const Type & rType )
71 23554900 : : _pType( rType._pType )
72 : {
73 23554900 : ::typelib_typedescriptionreference_acquire( _pType );
74 23554900 : }
75 :
76 1160642 : inline ::rtl::OUString Type::getTypeName() const
77 : {
78 1160642 : return ::rtl::OUString( _pType->pTypeName );
79 : }
80 :
81 11565041 : inline Type & Type::operator = ( const Type & rType )
82 : {
83 11565041 : ::typelib_typedescriptionreference_assign( &_pType, rType._pType );
84 11565041 : return *this;
85 : }
86 :
87 :
88 : template< class T >
89 : typelib_TypeDescriptionReference * Array< T >::s_pType = 0;
90 :
91 : }
92 : }
93 : }
94 : }
95 :
96 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Type * )
97 : {
98 : return ::cppu::UnoType< ::com::sun::star::uno::Type >::get();
99 : }
100 :
101 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuVoidType()
102 : {
103 : return ::cppu::UnoType<void>::get();
104 : }
105 : inline const ::com::sun::star::uno::Type & SAL_CALL getVoidCppuType()
106 : {
107 : return ::cppu::UnoType<void>::get();
108 : }
109 :
110 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuBooleanType()
111 : {
112 : return ::cppu::UnoType< bool >::get();
113 : }
114 : inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType()
115 : {
116 : return ::cppu::UnoType< bool >::get();
117 : }
118 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const sal_Bool * )
119 : {
120 : return ::cppu::UnoType< bool >::get();
121 : }
122 :
123 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType(
124 : SAL_UNUSED_PARAMETER bool const * )
125 : {
126 : return ::cppu::UnoType< bool >::get();
127 : }
128 :
129 : inline const ::com::sun::star::uno::Type & SAL_CALL getCharCppuType()
130 : {
131 : return ::cppu::UnoType< ::cppu::UnoCharType >::get();
132 : }
133 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType()
134 : {
135 : return ::cppu::UnoType< ::cppu::UnoCharType >::get();
136 : }
137 :
138 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const sal_Int8 * )
139 : {
140 : return ::cppu::UnoType< ::sal_Int8 >::get();
141 : }
142 :
143 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const ::rtl::OUString * )
144 : {
145 : return ::cppu::UnoType< ::rtl::OUString >::get();
146 : }
147 :
148 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const sal_Int16 * )
149 : {
150 : return ::cppu::UnoType< ::sal_Int16 >::get();
151 : }
152 :
153 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const sal_uInt16 * )
154 : {
155 : return ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get();
156 : }
157 :
158 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const sal_Int32 * )
159 : {
160 : return ::cppu::UnoType< ::sal_Int32 >::get();
161 : }
162 :
163 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const sal_uInt32 * )
164 : {
165 : return ::cppu::UnoType< ::sal_uInt32 >::get();
166 : }
167 :
168 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const sal_Int64 * )
169 : {
170 : return ::cppu::UnoType< ::sal_Int64 >::get();
171 : }
172 :
173 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const sal_uInt64 * )
174 : {
175 : return ::cppu::UnoType< ::sal_uInt64 >::get();
176 : }
177 :
178 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const float * )
179 : {
180 : return ::cppu::UnoType< float >::get();
181 : }
182 :
183 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( SAL_UNUSED_PARAMETER const double * )
184 : {
185 : return ::cppu::UnoType< double >::get();
186 : }
187 :
188 : template< typename T >
189 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType()
190 : {
191 : return ::cppu::UnoType< T >::get();
192 : }
193 :
194 : template<>
195 : inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType< sal_Unicode >()
196 : {
197 : return ::cppu::UnoType< ::cppu::UnoCharType >::get();
198 : }
199 :
200 : #endif
201 :
202 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|