1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
20 #define INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
22 #include <rtl/alloc.h>
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <cppuhelper/cppuhelperdllapi.h>
30 /** Helper class to implement com::sun::star::lang::XTypeProvider. Construct a static object
31 of this class with your UNO object's supported types.
33 class CPPUHELPER_DLLPUBLIC OTypeCollection
35 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> _aTypes
;
39 // these are here to force memory de/allocation to sal lib.
40 inline static void * SAL_CALL
operator new( size_t nSize
)
41 { return ::rtl_allocateMemory( nSize
); }
42 inline static void SAL_CALL
operator delete( void * pMem
)
43 { ::rtl_freeMemory( pMem
); }
44 inline static void * SAL_CALL
operator new( size_t, void * pMem
)
46 inline static void SAL_CALL
operator delete( void *, void * )
50 inline OTypeCollection( const OTypeCollection
& rCollection
)
51 : _aTypes( rCollection
._aTypes
)
54 const ::com::sun::star::uno::Type
& rType1
,
55 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
57 const ::com::sun::star::uno::Type
& rType1
,
58 const ::com::sun::star::uno::Type
& rType2
,
59 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
61 const ::com::sun::star::uno::Type
& rType1
,
62 const ::com::sun::star::uno::Type
& rType2
,
63 const ::com::sun::star::uno::Type
& rType3
,
64 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
66 const ::com::sun::star::uno::Type
& rType1
,
67 const ::com::sun::star::uno::Type
& rType2
,
68 const ::com::sun::star::uno::Type
& rType3
,
69 const ::com::sun::star::uno::Type
& rType4
,
70 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
72 const ::com::sun::star::uno::Type
& rType1
,
73 const ::com::sun::star::uno::Type
& rType2
,
74 const ::com::sun::star::uno::Type
& rType3
,
75 const ::com::sun::star::uno::Type
& rType4
,
76 const ::com::sun::star::uno::Type
& rType5
,
77 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
79 const ::com::sun::star::uno::Type
& rType1
,
80 const ::com::sun::star::uno::Type
& rType2
,
81 const ::com::sun::star::uno::Type
& rType3
,
82 const ::com::sun::star::uno::Type
& rType4
,
83 const ::com::sun::star::uno::Type
& rType5
,
84 const ::com::sun::star::uno::Type
& rType6
,
85 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
87 const ::com::sun::star::uno::Type
& rType1
,
88 const ::com::sun::star::uno::Type
& rType2
,
89 const ::com::sun::star::uno::Type
& rType3
,
90 const ::com::sun::star::uno::Type
& rType4
,
91 const ::com::sun::star::uno::Type
& rType5
,
92 const ::com::sun::star::uno::Type
& rType6
,
93 const ::com::sun::star::uno::Type
& rType7
,
94 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
96 const ::com::sun::star::uno::Type
& rType1
,
97 const ::com::sun::star::uno::Type
& rType2
,
98 const ::com::sun::star::uno::Type
& rType3
,
99 const ::com::sun::star::uno::Type
& rType4
,
100 const ::com::sun::star::uno::Type
& rType5
,
101 const ::com::sun::star::uno::Type
& rType6
,
102 const ::com::sun::star::uno::Type
& rType7
,
103 const ::com::sun::star::uno::Type
& rType8
,
104 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
106 const ::com::sun::star::uno::Type
& rType1
,
107 const ::com::sun::star::uno::Type
& rType2
,
108 const ::com::sun::star::uno::Type
& rType3
,
109 const ::com::sun::star::uno::Type
& rType4
,
110 const ::com::sun::star::uno::Type
& rType5
,
111 const ::com::sun::star::uno::Type
& rType6
,
112 const ::com::sun::star::uno::Type
& rType7
,
113 const ::com::sun::star::uno::Type
& rType8
,
114 const ::com::sun::star::uno::Type
& rType9
,
115 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
117 const ::com::sun::star::uno::Type
& rType1
,
118 const ::com::sun::star::uno::Type
& rType2
,
119 const ::com::sun::star::uno::Type
& rType3
,
120 const ::com::sun::star::uno::Type
& rType4
,
121 const ::com::sun::star::uno::Type
& rType5
,
122 const ::com::sun::star::uno::Type
& rType6
,
123 const ::com::sun::star::uno::Type
& rType7
,
124 const ::com::sun::star::uno::Type
& rType8
,
125 const ::com::sun::star::uno::Type
& rType9
,
126 const ::com::sun::star::uno::Type
& rType10
,
127 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
129 const ::com::sun::star::uno::Type
& rType1
,
130 const ::com::sun::star::uno::Type
& rType2
,
131 const ::com::sun::star::uno::Type
& rType3
,
132 const ::com::sun::star::uno::Type
& rType4
,
133 const ::com::sun::star::uno::Type
& rType5
,
134 const ::com::sun::star::uno::Type
& rType6
,
135 const ::com::sun::star::uno::Type
& rType7
,
136 const ::com::sun::star::uno::Type
& rType8
,
137 const ::com::sun::star::uno::Type
& rType9
,
138 const ::com::sun::star::uno::Type
& rType10
,
139 const ::com::sun::star::uno::Type
& rType11
,
140 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
142 const ::com::sun::star::uno::Type
& rType1
,
143 const ::com::sun::star::uno::Type
& rType2
,
144 const ::com::sun::star::uno::Type
& rType3
,
145 const ::com::sun::star::uno::Type
& rType4
,
146 const ::com::sun::star::uno::Type
& rType5
,
147 const ::com::sun::star::uno::Type
& rType6
,
148 const ::com::sun::star::uno::Type
& rType7
,
149 const ::com::sun::star::uno::Type
& rType8
,
150 const ::com::sun::star::uno::Type
& rType9
,
151 const ::com::sun::star::uno::Type
& rType10
,
152 const ::com::sun::star::uno::Type
& rType11
,
153 const ::com::sun::star::uno::Type
& rType12
,
154 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> & rAddTypes
= ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>() );
156 /** Called upon XTypeProvider::getTypes().
158 @return type collection
160 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes()
164 /** Helper class to implement IDs for XUnoTunnel. Construct a static object
165 of this class for your UNO object's implementation id.
167 class CPPUHELPER_DLLPUBLIC OImplementationId
169 mutable ::com::sun::star::uno::Sequence
< sal_Int8
> * _pSeq
;
170 sal_Bool _bUseEthernetAddress
;
175 // these are here to force memory de/allocation to sal lib.
176 inline static void * SAL_CALL
operator new( size_t nSize
)
177 { return ::rtl_allocateMemory( nSize
); }
178 inline static void SAL_CALL
operator delete( void * pMem
)
179 { ::rtl_freeMemory( pMem
); }
180 inline static void * SAL_CALL
operator new( size_t, void * pMem
)
182 inline static void SAL_CALL
operator delete( void *, void * )
185 ~OImplementationId();
191 @param bUseEthernetAddress whether an ethernet mac address should be taken into account
193 inline OImplementationId( bool bUseEthernetAddress
= true )
195 , _bUseEthernetAddress( bUseEthernetAddress
)
197 /** Constructor giving implementation id.
199 @param rSeq implementation id
201 inline OImplementationId( const ::com::sun::star::uno::Sequence
< sal_Int8
> & rSeq
)
202 : _pSeq( new ::com::sun::star::uno::Sequence
< sal_Int8
>( rSeq
) )
203 , _bUseEthernetAddress( false )
205 inline OImplementationId( const OImplementationId
& rId
)
206 : _pSeq( new ::com::sun::star::uno::Sequence
< sal_Int8
>( rId
.getImplementationId() ) )
207 , _bUseEthernetAddress( false )
210 /** Get implementation id.
212 @return implementation id
214 ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() const;
221 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */