bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / cppuhelper / typeprovider.hxx
blob48528fb921b44acb067434329811994a25248d03
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(
55 const css::uno::Type & rType1,
56 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
57 OTypeCollection(
58 const css::uno::Type & rType1,
59 const css::uno::Type & rType2,
60 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
61 OTypeCollection(
62 const css::uno::Type & rType1,
63 const css::uno::Type & rType2,
64 const css::uno::Type & rType3,
65 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
66 OTypeCollection(
67 const css::uno::Type & rType1,
68 const css::uno::Type & rType2,
69 const css::uno::Type & rType3,
70 const css::uno::Type & rType4,
71 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
72 OTypeCollection(
73 const css::uno::Type & rType1,
74 const css::uno::Type & rType2,
75 const css::uno::Type & rType3,
76 const css::uno::Type & rType4,
77 const css::uno::Type & rType5,
78 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
79 OTypeCollection(
80 const css::uno::Type & rType1,
81 const css::uno::Type & rType2,
82 const css::uno::Type & rType3,
83 const css::uno::Type & rType4,
84 const css::uno::Type & rType5,
85 const css::uno::Type & rType6,
86 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
87 OTypeCollection(
88 const css::uno::Type & rType1,
89 const css::uno::Type & rType2,
90 const css::uno::Type & rType3,
91 const css::uno::Type & rType4,
92 const css::uno::Type & rType5,
93 const css::uno::Type & rType6,
94 const css::uno::Type & rType7,
95 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
96 OTypeCollection(
97 const css::uno::Type & rType1,
98 const css::uno::Type & rType2,
99 const css::uno::Type & rType3,
100 const css::uno::Type & rType4,
101 const css::uno::Type & rType5,
102 const css::uno::Type & rType6,
103 const css::uno::Type & rType7,
104 const css::uno::Type & rType8,
105 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
106 OTypeCollection(
107 const css::uno::Type & rType1,
108 const css::uno::Type & rType2,
109 const css::uno::Type & rType3,
110 const css::uno::Type & rType4,
111 const css::uno::Type & rType5,
112 const css::uno::Type & rType6,
113 const css::uno::Type & rType7,
114 const css::uno::Type & rType8,
115 const css::uno::Type & rType9,
116 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
117 OTypeCollection(
118 const css::uno::Type & rType1,
119 const css::uno::Type & rType2,
120 const css::uno::Type & rType3,
121 const css::uno::Type & rType4,
122 const css::uno::Type & rType5,
123 const css::uno::Type & rType6,
124 const css::uno::Type & rType7,
125 const css::uno::Type & rType8,
126 const css::uno::Type & rType9,
127 const css::uno::Type & rType10,
128 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
129 OTypeCollection(
130 const css::uno::Type & rType1,
131 const css::uno::Type & rType2,
132 const css::uno::Type & rType3,
133 const css::uno::Type & rType4,
134 const css::uno::Type & rType5,
135 const css::uno::Type & rType6,
136 const css::uno::Type & rType7,
137 const css::uno::Type & rType8,
138 const css::uno::Type & rType9,
139 const css::uno::Type & rType10,
140 const css::uno::Type & rType11,
141 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
142 OTypeCollection(
143 const css::uno::Type & rType1,
144 const css::uno::Type & rType2,
145 const css::uno::Type & rType3,
146 const css::uno::Type & rType4,
147 const css::uno::Type & rType5,
148 const css::uno::Type & rType6,
149 const css::uno::Type & rType7,
150 const css::uno::Type & rType8,
151 const css::uno::Type & rType9,
152 const css::uno::Type & rType10,
153 const css::uno::Type & rType11,
154 const css::uno::Type & rType12,
155 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
157 /** Called upon XTypeProvider::getTypes().
159 @return type collection
161 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
162 { return _aTypes; }
163 #if defined LIBO_INTERNAL_ONLY
164 css::uno::Sequence< css::uno::Type > const & SAL_CALL getTypes() const
165 { return _aTypes; }
166 #endif
169 /** Helper class to implement IDs for XUnoTunnel. Construct a static object
170 of this class for your UNO object's implementation id.
172 class SAL_WARN_UNUSED CPPUHELPER_DLLPUBLIC OImplementationId
174 mutable css::uno::Sequence< sal_Int8 > * _pSeq;
175 sal_Bool _bUseEthernetAddress;
177 public:
178 /// @cond INTERNAL
180 // these are here to force memory de/allocation to sal lib.
181 static void * SAL_CALL operator new( size_t nSize )
182 { return ::rtl_allocateMemory( nSize ); }
183 static void SAL_CALL operator delete( void * pMem )
184 { ::rtl_freeMemory( pMem ); }
185 static void * SAL_CALL operator new( size_t, void * pMem )
186 { return pMem; }
187 static void SAL_CALL operator delete( void *, void * )
190 ~OImplementationId();
192 /// @endcond
194 /** Constructor.
196 @param bUseEthernetAddress whether an ethernet mac address should be taken into account
198 OImplementationId( bool bUseEthernetAddress = true )
199 : _pSeq( NULL )
200 , _bUseEthernetAddress( bUseEthernetAddress )
202 /** Constructor giving implementation id.
204 @param rSeq implementation id
206 OImplementationId( const css::uno::Sequence< sal_Int8 > & rSeq )
207 : _pSeq( new css::uno::Sequence< sal_Int8 >( rSeq ) )
208 , _bUseEthernetAddress( false )
210 OImplementationId( const OImplementationId & rId )
211 : _pSeq( new css::uno::Sequence< sal_Int8 >( rId.getImplementationId() ) )
212 , _bUseEthernetAddress( false )
215 /** Get implementation id.
217 @return implementation id
219 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() const;
224 #endif
226 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */