Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / cppu / inc / uno / any2.h
blobd10da63c0b422bdcfe6f289d262748e9340f2553
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _UNO_ANY2_H_
29 #define _UNO_ANY2_H_
31 #include <cppu/cppudllapi.h>
32 #include <uno/data.h>
34 #ifdef __cplusplus
35 extern "C"
37 #endif
39 #if defined( SAL_W32)
40 #pragma pack(push, 8)
41 #endif
43 struct _typelib_TypeDescriptionReference;
44 struct _typelib_TypeDescription;
45 struct _uno_Mapping;
47 /** This is the binary specification of an UNO any.
49 typedef struct _uno_Any
51 /** type of value
53 struct _typelib_TypeDescriptionReference * pType;
54 /** pointer to value; this may point to pReserved and thus the uno_Any is not anytime
55 mem-copyable! You may have to correct the pData pointer to pReserved. Otherwise you need
56 not, because the data is stored in heap space.
58 void * pData;
59 /** reserved space for storing value
61 void * pReserved;
62 } uno_Any;
64 #if defined( SAL_W32)
65 #pragma pack(pop)
66 #endif
68 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
69 functions.
71 @param pDest pointer memory of destination any
72 @param pSource pointer to source value; defaults (0) to default constructed value
73 @param pTypeDescr type description of value; defaults (0) to void
74 @param acquire function called each time an interface needs to be acquired;
75 defaults (0) to uno
76 @param release function called each time an interface needs to be released;
77 defaults (0) to uno
79 CPPU_DLLPUBLIC void SAL_CALL uno_any_assign(
80 uno_Any * pDest, void * pSource,
81 struct _typelib_TypeDescription * pTypeDescr,
82 uno_AcquireFunc acquire, uno_ReleaseFunc release )
83 SAL_THROW_EXTERN_C();
84 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
85 functions.
87 @param pDest pointer memory of destination any
88 @param pSource pointer to source value; defaults (0) to default constructed value
89 @param pType type description of value; defaults (0) to void
90 @param acquire function called each time an interface needs to be acquired;
91 defaults (0) to uno
92 @param release function called each time an interface needs to be released;
93 defaults (0) to uno
95 CPPU_DLLPUBLIC void SAL_CALL uno_type_any_assign(
96 uno_Any * pDest, void * pSource,
97 struct _typelib_TypeDescriptionReference * pType,
98 uno_AcquireFunc acquire, uno_ReleaseFunc release )
99 SAL_THROW_EXTERN_C();
101 /** Constructs an any with a given value. Interfaces are acquired by the given callback function.
103 @param pDest pointer memory of destination any
104 @param pSource pointer to source value; defaults (0) to default constructed value
105 @param pTypeDescr type description of value; defaults (0) to void
106 @param acquire function called each time an interface needs to be acquired;
107 defaults (0) to uno
109 CPPU_DLLPUBLIC void SAL_CALL uno_any_construct(
110 uno_Any * pDest, void * pSource,
111 struct _typelib_TypeDescription * pTypeDescr,
112 uno_AcquireFunc acquire )
113 SAL_THROW_EXTERN_C();
114 /** Constructs an any with a given value. Interfaces are acquired by the given callback function.
116 @param pDest pointer memory of destination any
117 @param pSource pointer to source value; defaults (0) to default constructed value
118 @param pType type of value; defaults (0) to void
119 @param acquire function called each time an interface needs to be acquired;
120 defaults (0) to uno
122 CPPU_DLLPUBLIC void SAL_CALL uno_type_any_construct(
123 uno_Any * pDest, void * pSource,
124 struct _typelib_TypeDescriptionReference * pType,
125 uno_AcquireFunc acquire )
126 SAL_THROW_EXTERN_C();
128 /** Constructs an any with a given value and converts/ maps interfaces.
130 @param pDest pointer memory of destination any
131 @param pSource pointer to source value; defaults (0) to default constructed value
132 @param pTypeDescr type description of value; defaults (0) to void
133 @param mapping mapping to convert/ map interfaces
135 CPPU_DLLPUBLIC void SAL_CALL uno_any_constructAndConvert(
136 uno_Any * pDest, void * pSource,
137 struct _typelib_TypeDescription * pTypeDescr,
138 struct _uno_Mapping * mapping )
139 SAL_THROW_EXTERN_C();
140 /** Constructs an any with a given value and converts/ maps interfaces.
142 @param pDest pointer memory of destination any
143 @param pSource pointer to source value; defaults (0) to default constructed value
144 @param pType type of value; defaults (0) to void
145 @param mapping mapping to convert/ map interfaces
147 CPPU_DLLPUBLIC void SAL_CALL uno_type_any_constructAndConvert(
148 uno_Any * pDest, void * pSource,
149 struct _typelib_TypeDescriptionReference * pType,
150 struct _uno_Mapping * mapping )
151 SAL_THROW_EXTERN_C();
153 /** Destructs an any.
155 @param pValue pointer to any
156 @param release function called each time an interface needs to be released;
157 defaults (0) to uno
159 CPPU_DLLPUBLIC void SAL_CALL uno_any_destruct(
160 uno_Any * pValue, uno_ReleaseFunc release )
161 SAL_THROW_EXTERN_C();
163 /** Sets value to void.
165 @param pValue pointer to any
166 @param release function called each time an interface needs to be released;
167 defaults (0) to uno
169 CPPU_DLLPUBLIC void SAL_CALL uno_any_clear(
170 uno_Any * pValue, uno_ReleaseFunc release )
171 SAL_THROW_EXTERN_C();
173 #ifdef __cplusplus
175 #endif
177 #endif
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */