LibreOffice
LibreOffice 6.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 #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 
55  const css::uno::Type & rType1,
56  const css::uno::Sequence< css::uno::Type > & rAddTypes = css::uno::Sequence< css::uno::Type >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
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 >() );
156 
161  css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
162  { return _aTypes; }
163 };
164 
169 {
170  mutable css::uno::Sequence< sal_Int8 > * _pSeq;
171  sal_Bool _bUseEthernetAddress;
172 
173 public:
175 
176  // these are here to force memory de/allocation to sal lib.
177  static void * SAL_CALL operator new( size_t nSize )
178  { return ::rtl_allocateMemory( nSize ); }
179  static void SAL_CALL operator delete( void * pMem )
180  { ::rtl_freeMemory( pMem ); }
181  static void * SAL_CALL operator new( size_t, void * pMem )
182  { return pMem; }
183  static void SAL_CALL operator delete( void *, void * )
184  {}
185 
187 
189 
194  OImplementationId( bool bUseEthernetAddress = true )
195  : _pSeq( NULL )
196  , _bUseEthernetAddress( bUseEthernetAddress )
197  {}
202  OImplementationId( const css::uno::Sequence< sal_Int8 > & rSeq )
203  : _pSeq( new css::uno::Sequence< sal_Int8 >( rSeq ) )
204  , _bUseEthernetAddress( false )
205  {}
207  : _pSeq( new css::uno::Sequence< sal_Int8 >( rId.getImplementationId() ) )
208  , _bUseEthernetAddress( false )
209  {}
210 
215  css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() const;
216 };
217 
218 }
219 
220 #endif
221 
222 /* 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:602
OImplementationId(bool bUseEthernetAddress=true)
Constructor.
Definition: typeprovider.hxx:194
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
Definition: types.h:377
OImplementationId(const OImplementationId &rId)
Definition: typeprovider.hxx:206
unsigned char sal_Bool
Definition: types.h:38
signed char sal_Int8
Definition: types.h:43
OImplementationId(const css::uno::Sequence< sal_Int8 > &rSeq)
Constructor giving implementation id.
Definition: typeprovider.hxx:202
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:28
css::uno::Sequence< css::uno::Type > getTypes()
Called upon XTypeProvider::getTypes().
Definition: typeprovider.hxx:161
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:168