Update ooo320-m1
[ooovba.git] / cppu / inc / uno / any2.h
blob48a4bb9e92ce09e94890f33eaa4c993160fef206
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: any2.h,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _UNO_ANY2_H_
31 #define _UNO_ANY2_H_
33 #include <sal/types.h>
34 #include <uno/data.h>
36 #ifdef __cplusplus
37 extern "C"
39 #endif
41 #if defined( SAL_W32)
42 #pragma pack(push, 8)
43 #elif defined(SAL_OS2)
44 #pragma pack(push, 8)
45 #endif
47 struct _typelib_TypeDescriptionReference;
48 struct _typelib_TypeDescription;
49 struct _uno_Mapping;
51 /** This is the binary specification of an UNO any.
53 typedef struct _uno_Any
55 /** type of value
57 struct _typelib_TypeDescriptionReference * pType;
58 /** pointer to value; this may point to pReserved and thus the uno_Any is not anytime
59 mem-copyable! You may have to correct the pData pointer to pReserved. Otherwise you need
60 not, because the data is stored in heap space.
62 void * pData;
63 /** reserved space for storing value
65 void * pReserved;
66 } uno_Any;
68 #if defined( SAL_W32) || defined(SAL_OS2)
69 #pragma pack(pop)
70 #endif
72 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
73 functions.
75 @param pDest pointer memory of destination any
76 @param pSource pointer to source value; defaults (0) to default constructed value
77 @param pTypeDescr type description of value; defaults (0) to void
78 @param acquire function called each time an interface needs to be acquired;
79 defaults (0) to uno
80 @param release function called each time an interface needs to be released;
81 defaults (0) to uno
83 void SAL_CALL uno_any_assign(
84 uno_Any * pDest, void * pSource,
85 struct _typelib_TypeDescription * pTypeDescr,
86 uno_AcquireFunc acquire, uno_ReleaseFunc release )
87 SAL_THROW_EXTERN_C();
88 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
89 functions.
91 @param pDest pointer memory of destination any
92 @param pSource pointer to source value; defaults (0) to default constructed value
93 @param pTypeDescr type description of value; defaults (0) to void
94 @param acquire function called each time an interface needs to be acquired;
95 defaults (0) to uno
96 @param release function called each time an interface needs to be released;
97 defaults (0) to uno
99 void SAL_CALL uno_type_any_assign(
100 uno_Any * pDest, void * pSource,
101 struct _typelib_TypeDescriptionReference * pType,
102 uno_AcquireFunc acquire, uno_ReleaseFunc release )
103 SAL_THROW_EXTERN_C();
105 /** Constructs an any with a given value. Interfaces are acquired by the given callback function.
107 @param pDest pointer memory of destination any
108 @param pSource pointer to source value; defaults (0) to default constructed value
109 @param pTypeDescr type description of value; defaults (0) to void
110 @param acquire function called each time an interface needs to be acquired;
111 defaults (0) to uno
113 void SAL_CALL uno_any_construct(
114 uno_Any * pDest, void * pSource,
115 struct _typelib_TypeDescription * pTypeDescr,
116 uno_AcquireFunc acquire )
117 SAL_THROW_EXTERN_C();
118 /** Constructs an any with a given value. Interfaces are acquired by the given callback function.
120 @param pDest pointer memory of destination any
121 @param pSource pointer to source value; defaults (0) to default constructed value
122 @param pType type of value; defaults (0) to void
123 @param acquire function called each time an interface needs to be acquired;
124 defaults (0) to uno
126 void SAL_CALL uno_type_any_construct(
127 uno_Any * pDest, void * pSource,
128 struct _typelib_TypeDescriptionReference * pType,
129 uno_AcquireFunc acquire )
130 SAL_THROW_EXTERN_C();
132 /** Constructs an any with a given value and converts/ maps interfaces.
134 @param pDest pointer memory of destination any
135 @param pSource pointer to source value; defaults (0) to default constructed value
136 @param pTypeDescr type description of value; defaults (0) to void
137 @param mapping mapping to convert/ map interfaces
139 void SAL_CALL uno_any_constructAndConvert(
140 uno_Any * pDest, void * pSource,
141 struct _typelib_TypeDescription * pTypeDescr,
142 struct _uno_Mapping * mapping )
143 SAL_THROW_EXTERN_C();
144 /** Constructs an any with a given value and converts/ maps interfaces.
146 @param pDest pointer memory of destination any
147 @param pSource pointer to source value; defaults (0) to default constructed value
148 @param pType type of value; defaults (0) to void
149 @param mapping mapping to convert/ map interfaces
151 void SAL_CALL uno_type_any_constructAndConvert(
152 uno_Any * pDest, void * pSource,
153 struct _typelib_TypeDescriptionReference * pType,
154 struct _uno_Mapping * mapping )
155 SAL_THROW_EXTERN_C();
157 /** Destructs an any.
159 @param pValue pointer to any
160 @param release function called each time an interface needs to be released;
161 defaults (0) to uno
163 void SAL_CALL uno_any_destruct(
164 uno_Any * pValue, uno_ReleaseFunc release )
165 SAL_THROW_EXTERN_C();
167 /** Sets value to void.
169 @param pValue pointer to any
170 @param release function called each time an interface needs to be released;
171 defaults (0) to uno
173 void SAL_CALL uno_any_clear(
174 uno_Any * pValue, uno_ReleaseFunc release )
175 SAL_THROW_EXTERN_C();
177 #ifdef __cplusplus
179 #endif
181 #endif