1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
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 ************************************************************************/
33 #include <sal/types.h>
43 #elif defined(SAL_OS2)
47 struct _typelib_TypeDescriptionReference
;
48 struct _typelib_TypeDescription
;
51 /** This is the binary specification of an UNO any.
53 typedef struct _uno_Any
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.
63 /** reserved space for storing value
68 #if defined( SAL_W32) || defined(SAL_OS2)
72 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
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;
80 @param release function called each time an interface needs to be released;
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
)
88 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
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;
96 @param release function called each time an interface needs to be released;
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;
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;
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;
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;
173 void SAL_CALL
uno_any_clear(
174 uno_Any
* pValue
, uno_ReleaseFunc release
)
175 SAL_THROW_EXTERN_C();