tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / include / cppuhelper / typeprovider.hxx
blob4c3bd99d1bb84a6ca197b98db80ba86e35003b3b
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 .
21 * This file is part of LibreOffice published API.
23 #ifndef INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
24 #define INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
26 #include "sal/config.h"
28 #include <cstddef>
30 #include "rtl/alloc.h"
31 #include "com/sun/star/uno/Sequence.hxx"
32 #include "cppuhelper/cppuhelperdllapi.h"
35 namespace cppu
38 /** Helper class to implement css::lang::XTypeProvider. Construct a static object
39 of this class with your UNO object's supported types.
41 class SAL_WARN_UNUSED CPPUHELPER_DLLPUBLIC OTypeCollection
43 css::uno::Sequence< css::uno::Type > _aTypes;
45 public:
46 /// @cond INTERNAL
47 // these are here to force memory de/allocation to sal lib.
48 static void * SAL_CALL operator new( size_t nSize )
49 { return ::rtl_allocateMemory( nSize ); }
50 static void SAL_CALL operator delete( void * pMem )
51 { ::rtl_freeMemory( pMem ); }
52 static void * SAL_CALL operator new( size_t, void * pMem )
53 { return pMem; }
54 static void SAL_CALL operator delete( void *, void * )
56 /// @endcond
58 OTypeCollection(
59 const css::uno::Type & rType1,
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::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
65 OTypeCollection(
66 const css::uno::Type & rType1,
67 const css::uno::Type & rType2,
68 const css::uno::Type & rType3,
69 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
70 OTypeCollection(
71 const css::uno::Type & rType1,
72 const css::uno::Type & rType2,
73 const css::uno::Type & rType3,
74 const css::uno::Type & rType4,
75 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
76 OTypeCollection(
77 const css::uno::Type & rType1,
78 const css::uno::Type & rType2,
79 const css::uno::Type & rType3,
80 const css::uno::Type & rType4,
81 const css::uno::Type & rType5,
82 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
83 OTypeCollection(
84 const css::uno::Type & rType1,
85 const css::uno::Type & rType2,
86 const css::uno::Type & rType3,
87 const css::uno::Type & rType4,
88 const css::uno::Type & rType5,
89 const css::uno::Type & rType6,
90 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
91 OTypeCollection(
92 const css::uno::Type & rType1,
93 const css::uno::Type & rType2,
94 const css::uno::Type & rType3,
95 const css::uno::Type & rType4,
96 const css::uno::Type & rType5,
97 const css::uno::Type & rType6,
98 const css::uno::Type & rType7,
99 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
100 OTypeCollection(
101 const css::uno::Type & rType1,
102 const css::uno::Type & rType2,
103 const css::uno::Type & rType3,
104 const css::uno::Type & rType4,
105 const css::uno::Type & rType5,
106 const css::uno::Type & rType6,
107 const css::uno::Type & rType7,
108 const css::uno::Type & rType8,
109 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
110 OTypeCollection(
111 const css::uno::Type & rType1,
112 const css::uno::Type & rType2,
113 const css::uno::Type & rType3,
114 const css::uno::Type & rType4,
115 const css::uno::Type & rType5,
116 const css::uno::Type & rType6,
117 const css::uno::Type & rType7,
118 const css::uno::Type & rType8,
119 const css::uno::Type & rType9,
120 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
121 OTypeCollection(
122 const css::uno::Type & rType1,
123 const css::uno::Type & rType2,
124 const css::uno::Type & rType3,
125 const css::uno::Type & rType4,
126 const css::uno::Type & rType5,
127 const css::uno::Type & rType6,
128 const css::uno::Type & rType7,
129 const css::uno::Type & rType8,
130 const css::uno::Type & rType9,
131 const css::uno::Type & rType10,
132 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
133 OTypeCollection(
134 const css::uno::Type & rType1,
135 const css::uno::Type & rType2,
136 const css::uno::Type & rType3,
137 const css::uno::Type & rType4,
138 const css::uno::Type & rType5,
139 const css::uno::Type & rType6,
140 const css::uno::Type & rType7,
141 const css::uno::Type & rType8,
142 const css::uno::Type & rType9,
143 const css::uno::Type & rType10,
144 const css::uno::Type & rType11,
145 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
146 OTypeCollection(
147 const css::uno::Type & rType1,
148 const css::uno::Type & rType2,
149 const css::uno::Type & rType3,
150 const css::uno::Type & rType4,
151 const css::uno::Type & rType5,
152 const css::uno::Type & rType6,
153 const css::uno::Type & rType7,
154 const css::uno::Type & rType8,
155 const css::uno::Type & rType9,
156 const css::uno::Type & rType10,
157 const css::uno::Type & rType11,
158 const css::uno::Type & rType12,
159 const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
161 /** Called upon XTypeProvider::getTypes().
163 @return type collection
165 css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
166 { return _aTypes; }
167 #if defined LIBO_INTERNAL_ONLY
168 css::uno::Sequence< css::uno::Type > const & getTypes() const
169 { return _aTypes; }
170 #endif
173 /** Helper class to implement IDs for XUnoTunnel. Construct a static object
174 of this class for your UNO object's implementation id.
176 class SAL_DEPRECATED("Uses broken double checked locking") SAL_WARN_UNUSED CPPUHELPER_DLLPUBLIC OImplementationId
178 mutable css::uno::Sequence< sal_Int8 > * _pSeq;
179 sal_Bool _bUseEthernetAddress;
181 public:
182 /// @cond INTERNAL
184 // these are here to force memory de/allocation to sal lib.
185 static void * SAL_CALL operator new( size_t nSize )
186 { return ::rtl_allocateMemory( nSize ); }
187 static void SAL_CALL operator delete( void * pMem )
188 { ::rtl_freeMemory( pMem ); }
189 static void * SAL_CALL operator new( size_t, void * pMem )
190 { return pMem; }
191 static void SAL_CALL operator delete( void *, void * )
194 ~OImplementationId();
196 /// @endcond
198 /** Constructor.
200 @param bUseEthernetAddress whether an ethernet mac address should be taken into account
202 OImplementationId( bool bUseEthernetAddress = true )
203 : _pSeq( NULL )
204 , _bUseEthernetAddress( bUseEthernetAddress )
206 /** Constructor giving implementation id.
208 @param rSeq implementation id
210 OImplementationId( const css::uno::Sequence< sal_Int8 > & rSeq )
211 : _pSeq( new css::uno::Sequence< sal_Int8 >( rSeq ) )
212 , _bUseEthernetAddress( false )
214 SAL_WNODEPRECATED_DECLARATIONS_PUSH
215 OImplementationId( const OImplementationId & rId )
216 : _pSeq( new css::uno::Sequence< sal_Int8 >( rId.getImplementationId() ) )
217 , _bUseEthernetAddress( false )
219 SAL_WNODEPRECATED_DECLARATIONS_POP
221 /** Get implementation id.
223 @return implementation id
225 css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() const;
230 #endif
232 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */