Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / cppuhelper / typeprovider.hxx
blob912f90865e0490d50ebe6fdef474626b2530e323
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
24 #include <cstddef>
26 #include <rtl/alloc.h>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <cppuhelper/cppuhelperdllapi.h>
31 namespace cppu
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;
41 public:
42 /// @cond INTERNAL
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 )
49 { return pMem; }
50 static void SAL_CALL operator delete( void *, void * )
52 /// @endcond
54 OTypeCollection( const OTypeCollection & rCollection )
55 : _aTypes( rCollection._aTypes )
57 OTypeCollection(
58 const css::uno::Type & rType1,
59 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
60 OTypeCollection(
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 >() );
64 OTypeCollection(
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 >() );
69 OTypeCollection(
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 >() );
75 OTypeCollection(
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 >() );
82 OTypeCollection(
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 >() );
90 OTypeCollection(
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 >() );
99 OTypeCollection(
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 >() );
109 OTypeCollection(
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 >() );
120 OTypeCollection(
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 >() );
132 OTypeCollection(
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 >() );
145 OTypeCollection(
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()
165 { return _aTypes; }
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;
176 public:
177 /// @cond INTERNAL
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 )
185 { return pMem; }
186 static void SAL_CALL operator delete( void *, void * )
189 ~OImplementationId();
191 /// @endcond
193 /** Constructor.
195 @param bUseEthernetAddress whether an ethernet mac address should be taken into account
197 OImplementationId( bool bUseEthernetAddress = true )
198 : _pSeq( NULL )
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;
223 #endif
225 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */