LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
typeprovider.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 /*
21  * This file is part of LibreOffice published API.
22  */
23 #ifndef INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
24 #define INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
25 
26 #include "sal/config.h"
27 
28 #include <cstddef>
29 
30 #include "rtl/alloc.h"
33 
34 
35 namespace cppu
36 {
37 
42 {
43  css::uno::Sequence< css::uno::Type > _aTypes;
44 
45 public:
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 * )
55  {}
57 
59  const css::uno::Type & rType1,
60  const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
160 
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
171 };
172 
176 class SAL_DEPRECATED("Uses broken double checked locking") SAL_WARN_UNUSED CPPUHELPER_DLLPUBLIC OImplementationId
177 {
178  mutable css::uno::Sequence< sal_Int8 > * _pSeq;
179  sal_Bool _bUseEthernetAddress;
180 
181 public:
183 
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 * )
192  {}
193 
195 
197 
202  OImplementationId( bool bUseEthernetAddress = true )
203  : _pSeq( NULL )
204  , _bUseEthernetAddress( bUseEthernetAddress )
205  {}
210  OImplementationId( const css::uno::Sequence< sal_Int8 > & rSeq )
211  : _pSeq( new css::uno::Sequence< sal_Int8 >( rSeq ) )
212  , _bUseEthernetAddress( false )
213  {}
216  : _pSeq( new css::uno::Sequence< sal_Int8 >( rId.getImplementationId() ) )
217  , _bUseEthernetAddress( false )
218  {}
220 
225  css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() const;
226 };
227 
228 }
229 
230 #endif
231 
232 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SAL_WNODEPRECATED_DECLARATIONS_PUSH
Use as follows: SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr<X> ...
Definition: types.h:508
css::uno::Sequence< css::uno::Type > getTypes()
Called upon XTypeProvider::getTypes().
Definition: typeprovider.hxx:165
signed char sal_Int8
Definition: types.h:43
#define SAL_WNODEPRECATED_DECLARATIONS_POP
Definition: types.h:509
Helper class to implement css::lang::XTypeProvider.
Definition: typeprovider.hxx:41
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don&#39;t use, it&#39;s evil.") void doit(int nPara);.
Definition: types.h:474
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:587
SAL_WNODEPRECATED_DECLARATIONS_PUSH OImplementationId(const OImplementationId &rId)
Definition: typeprovider.hxx:215
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
OImplementationId(bool bUseEthernetAddress=true)
Constructor.
Definition: typeprovider.hxx:202
unsigned char sal_Bool
Definition: types.h:38
OImplementationId(const css::uno::Sequence< sal_Int8 > &rSeq)
Constructor giving implementation id.
Definition: typeprovider.hxx:210
Definition: Enterable.hxx:30
Helper class to implement IDs for XUnoTunnel.
Definition: typeprovider.hxx:176
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:32
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
Definition: types.h:359