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 <sal/config.h>
26 #include <rtl/alloc.h>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <cppuhelper/cppuhelperdllapi.h>
34 /** Helper class to implement css::lang::XTypeProvider. Construct a static object
35 of this class with your UNO object's supported types.
37 class SAL_WARN_UNUSED CPPUHELPER_DLLPUBLIC OTypeCollection
39 css::uno::Sequence
< css::uno::Type
> _aTypes
;
43 // these are here to force memory de/allocation to sal lib.
44 static void * SAL_CALL
operator new( size_t nSize
)
45 { return ::rtl_allocateMemory( nSize
); }
46 static void SAL_CALL
operator delete( void * pMem
)
47 { ::rtl_freeMemory( pMem
); }
48 static void * SAL_CALL
operator new( size_t, void * pMem
)
50 static void SAL_CALL
operator delete( void *, void * )
54 OTypeCollection( const OTypeCollection
& rCollection
)
55 : _aTypes( rCollection
._aTypes
)
58 const css::uno::Type
& rType1
,
59 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
61 const css::uno::Type
& rType1
,
62 const css::uno::Type
& rType2
,
63 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
65 const css::uno::Type
& rType1
,
66 const css::uno::Type
& rType2
,
67 const css::uno::Type
& rType3
,
68 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
70 const css::uno::Type
& rType1
,
71 const css::uno::Type
& rType2
,
72 const css::uno::Type
& rType3
,
73 const css::uno::Type
& rType4
,
74 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
76 const css::uno::Type
& rType1
,
77 const css::uno::Type
& rType2
,
78 const css::uno::Type
& rType3
,
79 const css::uno::Type
& rType4
,
80 const css::uno::Type
& rType5
,
81 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
83 const css::uno::Type
& rType1
,
84 const css::uno::Type
& rType2
,
85 const css::uno::Type
& rType3
,
86 const css::uno::Type
& rType4
,
87 const css::uno::Type
& rType5
,
88 const css::uno::Type
& rType6
,
89 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
91 const css::uno::Type
& rType1
,
92 const css::uno::Type
& rType2
,
93 const css::uno::Type
& rType3
,
94 const css::uno::Type
& rType4
,
95 const css::uno::Type
& rType5
,
96 const css::uno::Type
& rType6
,
97 const css::uno::Type
& rType7
,
98 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
100 const css::uno::Type
& rType1
,
101 const css::uno::Type
& rType2
,
102 const css::uno::Type
& rType3
,
103 const css::uno::Type
& rType4
,
104 const css::uno::Type
& rType5
,
105 const css::uno::Type
& rType6
,
106 const css::uno::Type
& rType7
,
107 const css::uno::Type
& rType8
,
108 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
110 const css::uno::Type
& rType1
,
111 const css::uno::Type
& rType2
,
112 const css::uno::Type
& rType3
,
113 const css::uno::Type
& rType4
,
114 const css::uno::Type
& rType5
,
115 const css::uno::Type
& rType6
,
116 const css::uno::Type
& rType7
,
117 const css::uno::Type
& rType8
,
118 const css::uno::Type
& rType9
,
119 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
121 const css::uno::Type
& rType1
,
122 const css::uno::Type
& rType2
,
123 const css::uno::Type
& rType3
,
124 const css::uno::Type
& rType4
,
125 const css::uno::Type
& rType5
,
126 const css::uno::Type
& rType6
,
127 const css::uno::Type
& rType7
,
128 const css::uno::Type
& rType8
,
129 const css::uno::Type
& rType9
,
130 const css::uno::Type
& rType10
,
131 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
133 const css::uno::Type
& rType1
,
134 const css::uno::Type
& rType2
,
135 const css::uno::Type
& rType3
,
136 const css::uno::Type
& rType4
,
137 const css::uno::Type
& rType5
,
138 const css::uno::Type
& rType6
,
139 const css::uno::Type
& rType7
,
140 const css::uno::Type
& rType8
,
141 const css::uno::Type
& rType9
,
142 const css::uno::Type
& rType10
,
143 const css::uno::Type
& rType11
,
144 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
146 const css::uno::Type
& rType1
,
147 const css::uno::Type
& rType2
,
148 const css::uno::Type
& rType3
,
149 const css::uno::Type
& rType4
,
150 const css::uno::Type
& rType5
,
151 const css::uno::Type
& rType6
,
152 const css::uno::Type
& rType7
,
153 const css::uno::Type
& rType8
,
154 const css::uno::Type
& rType9
,
155 const css::uno::Type
& rType10
,
156 const css::uno::Type
& rType11
,
157 const css::uno::Type
& rType12
,
158 const css::uno::Sequence
< css::uno::Type
> & rAddTypes
= css::uno::Sequence
< css::uno::Type
>() );
160 /** Called upon XTypeProvider::getTypes().
162 @return type collection
164 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes()
168 /** Helper class to implement IDs for XUnoTunnel. Construct a static object
169 of this class for your UNO object's implementation id.
171 class SAL_WARN_UNUSED CPPUHELPER_DLLPUBLIC OImplementationId
173 mutable css::uno::Sequence
< sal_Int8
> * _pSeq
;
174 sal_Bool _bUseEthernetAddress
;
179 // these are here to force memory de/allocation to sal lib.
180 static void * SAL_CALL
operator new( size_t nSize
)
181 { return ::rtl_allocateMemory( nSize
); }
182 static void SAL_CALL
operator delete( void * pMem
)
183 { ::rtl_freeMemory( pMem
); }
184 static void * SAL_CALL
operator new( size_t, void * pMem
)
186 static void SAL_CALL
operator delete( void *, void * )
189 ~OImplementationId();
195 @param bUseEthernetAddress whether an ethernet mac address should be taken into account
197 OImplementationId( bool bUseEthernetAddress
= true )
199 , _bUseEthernetAddress( bUseEthernetAddress
)
201 /** Constructor giving implementation id.
203 @param rSeq implementation id
205 OImplementationId( const css::uno::Sequence
< sal_Int8
> & rSeq
)
206 : _pSeq( new css::uno::Sequence
< sal_Int8
>( rSeq
) )
207 , _bUseEthernetAddress( false )
209 OImplementationId( const OImplementationId
& rId
)
210 : _pSeq( new css::uno::Sequence
< sal_Int8
>( rId
.getImplementationId() ) )
211 , _bUseEthernetAddress( false )
214 /** Get implementation id.
216 @return implementation id
218 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() const;
225 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */