Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / uno / any2.h
blobe5dbfea2bcd077c64e0b9fb936bf98f7df1418dc
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_UNO_ANY2_H
24 #define INCLUDED_UNO_ANY2_H
26 #include "cppu/cppudllapi.h"
27 #include "uno/data.h"
29 #ifdef __cplusplus
30 extern "C"
32 #endif
34 #if defined( _WIN32)
35 #pragma pack(push, 8)
36 #endif
38 struct _typelib_TypeDescriptionReference;
39 struct _typelib_TypeDescription;
40 struct _uno_Mapping;
42 /** This is the binary specification of a UNO any.
44 typedef struct SAL_DLLPUBLIC_RTTI _uno_Any
46 /** type of value
48 struct _typelib_TypeDescriptionReference * pType;
49 /** pointer to value; this may point to pReserved and thus the uno_Any is not anytime
50 mem-copyable! You may have to correct the pData pointer to pReserved. Otherwise you need
51 not, because the data is stored in heap space.
53 void * pData;
54 /** reserved space for storing value
56 void * pReserved;
57 } uno_Any;
59 #if defined( _WIN32)
60 #pragma pack(pop)
61 #endif
63 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
64 functions.
66 @param pDest pointer memory of destination any
67 @param pSource pointer to source value; defaults (0) to default constructed value
68 @param pTypeDescr type description of value; defaults (0) to void
69 @param acquire function called each time an interface needs to be acquired;
70 defaults (0) to uno
71 @param release function called each time an interface needs to be released;
72 defaults (0) to uno
74 CPPU_DLLPUBLIC void SAL_CALL uno_any_assign(
75 uno_Any * pDest, void * pSource,
76 struct _typelib_TypeDescription * pTypeDescr,
77 uno_AcquireFunc acquire, uno_ReleaseFunc release )
78 SAL_THROW_EXTERN_C();
79 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
80 functions.
82 @param pDest pointer memory of destination any
83 @param pSource pointer to source value; defaults (0) to default constructed value
84 @param pType type description of value; defaults (0) to void
85 @param acquire function called each time an interface needs to be acquired;
86 defaults (0) to uno
87 @param release function called each time an interface needs to be released;
88 defaults (0) to uno
90 CPPU_DLLPUBLIC void SAL_CALL uno_type_any_assign(
91 uno_Any * pDest, void * pSource,
92 struct _typelib_TypeDescriptionReference * pType,
93 uno_AcquireFunc acquire, uno_ReleaseFunc release )
94 SAL_THROW_EXTERN_C();
96 /** Constructs an any with a given value. Interfaces are acquired by the given callback function.
98 @param pDest pointer memory of destination any
99 @param pSource pointer to source value; defaults (0) to default constructed value
100 @param pTypeDescr type description of value; defaults (0) to void
101 @param acquire function called each time an interface needs to be acquired;
102 defaults (0) to uno
104 CPPU_DLLPUBLIC void SAL_CALL uno_any_construct(
105 uno_Any * pDest, void * pSource,
106 struct _typelib_TypeDescription * pTypeDescr,
107 uno_AcquireFunc acquire )
108 SAL_THROW_EXTERN_C();
109 /** Constructs an any with a given value. Interfaces are acquired by the given callback function.
111 @param pDest pointer memory of destination any
112 @param pSource pointer to source value; defaults (0) to default constructed value
113 @param pType type of value; defaults (0) to void
114 @param acquire function called each time an interface needs to be acquired;
115 defaults (0) to uno
117 CPPU_DLLPUBLIC void SAL_CALL uno_type_any_construct(
118 uno_Any * pDest, void * pSource,
119 struct _typelib_TypeDescriptionReference * pType,
120 uno_AcquireFunc acquire )
121 SAL_THROW_EXTERN_C();
123 /** Constructs an any with a given value and converts/ maps interfaces.
125 @param pDest pointer memory of destination any
126 @param pSource pointer to source value; defaults (0) to default constructed value
127 @param pTypeDescr type description of value; defaults (0) to void
128 @param mapping mapping to convert/ map interfaces
130 CPPU_DLLPUBLIC void SAL_CALL uno_any_constructAndConvert(
131 uno_Any * pDest, void * pSource,
132 struct _typelib_TypeDescription * pTypeDescr,
133 struct _uno_Mapping * mapping )
134 SAL_THROW_EXTERN_C();
135 /** Constructs an any with a given value and converts/ maps interfaces.
137 @param pDest pointer memory of destination any
138 @param pSource pointer to source value; defaults (0) to default constructed value
139 @param pType type of value; defaults (0) to void
140 @param mapping mapping to convert/ map interfaces
142 CPPU_DLLPUBLIC void SAL_CALL uno_type_any_constructAndConvert(
143 uno_Any * pDest, void * pSource,
144 struct _typelib_TypeDescriptionReference * pType,
145 struct _uno_Mapping * mapping )
146 SAL_THROW_EXTERN_C();
148 /** Destructs an any.
150 @param pValue pointer to any
151 @param release function called each time an interface needs to be released;
152 defaults (0) to uno
154 CPPU_DLLPUBLIC void SAL_CALL uno_any_destruct(
155 uno_Any * pValue, uno_ReleaseFunc release )
156 SAL_THROW_EXTERN_C();
158 /** Sets value to void.
160 @param pValue pointer to any
161 @param release function called each time an interface needs to be released;
162 defaults (0) to uno
164 CPPU_DLLPUBLIC void SAL_CALL uno_any_clear(
165 uno_Any * pValue, uno_ReleaseFunc release )
166 SAL_THROW_EXTERN_C();
168 #ifdef __cplusplus
170 #endif
172 #endif
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */