LibreOffice
LibreOffice 6.0 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 #ifndef INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
20 #define INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
21 
22 #include <sal/config.h>
23 
24 #include <cstddef>
25 
26 #include <rtl/alloc.h>
29 
30 
31 namespace cppu
32 {
33 
38 {
39  css::uno::Sequence< css::uno::Type > _aTypes;
40 
41 public:
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 * )
51  {}
53 
54  OTypeCollection( const OTypeCollection & rCollection )
55  : _aTypes( rCollection._aTypes )
56  {}
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 >() );
159 
164  css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
165  { return _aTypes; }
166 };
167 
172 {
173  mutable css::uno::Sequence< sal_Int8 > * _pSeq;
174  sal_Bool _bUseEthernetAddress;
175 
176 public:
178 
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 * )
187  {}
188 
190 
192 
197  OImplementationId( bool bUseEthernetAddress = true )
198  : _pSeq( NULL )
199  , _bUseEthernetAddress( bUseEthernetAddress )
200  {}
205  OImplementationId( const css::uno::Sequence< sal_Int8 > & rSeq )
206  : _pSeq( new css::uno::Sequence< sal_Int8 >( rSeq ) )
207  , _bUseEthernetAddress( false )
208  {}
210  : _pSeq( new css::uno::Sequence< sal_Int8 >( rId.getImplementationId() ) )
211  , _bUseEthernetAddress( false )
212  {}
213 
218  css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() const;
219 };
220 
221 }
222 
223 #endif
224 
225 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: Enterable.hxx:26
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:608
OImplementationId(bool bUseEthernetAddress=true)
Constructor.
Definition: typeprovider.hxx:197
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
Definition: types.h:383
OImplementationId(const OImplementationId &rId)
Definition: typeprovider.hxx:209
unsigned char sal_Bool
Definition: types.h:39
signed char sal_Int8
Definition: types.h:44
OTypeCollection(const OTypeCollection &rCollection)
Definition: typeprovider.hxx:54
OImplementationId(const css::uno::Sequence< sal_Int8 > &rSeq)
Constructor giving implementation id.
Definition: typeprovider.hxx:205
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:28
css::uno::Sequence< css::uno::Type > getTypes()
Called upon XTypeProvider::getTypes().
Definition: typeprovider.hxx:164
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
Helper class to implement css::lang::XTypeProvider.
Definition: typeprovider.hxx:37
Helper class to implement IDs for XUnoTunnel.
Definition: typeprovider.hxx:171