1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_UNO_ANY2_H
20 #define INCLUDED_UNO_ANY2_H
22 #include <cppu/cppudllapi.h>
34 struct _typelib_TypeDescriptionReference
;
35 struct _typelib_TypeDescription
;
38 /** This is the binary specification of an UNO any.
40 typedef struct SAL_DLLPUBLIC_RTTI _uno_Any
44 struct _typelib_TypeDescriptionReference
* pType
;
45 /** pointer to value; this may point to pReserved and thus the uno_Any is not anytime
46 mem-copyable! You may have to correct the pData pointer to pReserved. Otherwise you need
47 not, because the data is stored in heap space.
50 /** reserved space for storing value
59 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
62 @param pDest pointer memory of destination any
63 @param pSource pointer to source value; defaults (0) to default constructed value
64 @param pTypeDescr type description of value; defaults (0) to void
65 @param acquire function called each time an interface needs to be acquired;
67 @param release function called each time an interface needs to be released;
70 CPPU_DLLPUBLIC
void SAL_CALL
uno_any_assign(
71 uno_Any
* pDest
, void * pSource
,
72 struct _typelib_TypeDescription
* pTypeDescr
,
73 uno_AcquireFunc acquire
, uno_ReleaseFunc release
)
75 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
78 @param pDest pointer memory of destination any
79 @param pSource pointer to source value; defaults (0) to default constructed value
80 @param pType type description of value; defaults (0) to void
81 @param acquire function called each time an interface needs to be acquired;
83 @param release function called each time an interface needs to be released;
86 CPPU_DLLPUBLIC
void SAL_CALL
uno_type_any_assign(
87 uno_Any
* pDest
, void * pSource
,
88 struct _typelib_TypeDescriptionReference
* pType
,
89 uno_AcquireFunc acquire
, uno_ReleaseFunc release
)
92 /** Constructs an any with a given value. Interfaces are acquired by the given callback function.
94 @param pDest pointer memory of destination any
95 @param pSource pointer to source value; defaults (0) to default constructed value
96 @param pTypeDescr type description of value; defaults (0) to void
97 @param acquire function called each time an interface needs to be acquired;
100 CPPU_DLLPUBLIC
void SAL_CALL
uno_any_construct(
101 uno_Any
* pDest
, void * pSource
,
102 struct _typelib_TypeDescription
* pTypeDescr
,
103 uno_AcquireFunc acquire
)
104 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 pType type of value; defaults (0) to void
110 @param acquire function called each time an interface needs to be acquired;
113 CPPU_DLLPUBLIC
void SAL_CALL
uno_type_any_construct(
114 uno_Any
* pDest
, void * pSource
,
115 struct _typelib_TypeDescriptionReference
* pType
,
116 uno_AcquireFunc acquire
)
117 SAL_THROW_EXTERN_C();
119 /** Constructs an any with a given value and converts/ maps interfaces.
121 @param pDest pointer memory of destination any
122 @param pSource pointer to source value; defaults (0) to default constructed value
123 @param pTypeDescr type description of value; defaults (0) to void
124 @param mapping mapping to convert/ map interfaces
126 CPPU_DLLPUBLIC
void SAL_CALL
uno_any_constructAndConvert(
127 uno_Any
* pDest
, void * pSource
,
128 struct _typelib_TypeDescription
* pTypeDescr
,
129 struct _uno_Mapping
* mapping
)
130 SAL_THROW_EXTERN_C();
131 /** Constructs an any with a given value and converts/ maps interfaces.
133 @param pDest pointer memory of destination any
134 @param pSource pointer to source value; defaults (0) to default constructed value
135 @param pType type of value; defaults (0) to void
136 @param mapping mapping to convert/ map interfaces
138 CPPU_DLLPUBLIC
void SAL_CALL
uno_type_any_constructAndConvert(
139 uno_Any
* pDest
, void * pSource
,
140 struct _typelib_TypeDescriptionReference
* pType
,
141 struct _uno_Mapping
* mapping
)
142 SAL_THROW_EXTERN_C();
144 /** Destructs an any.
146 @param pValue pointer to any
147 @param release function called each time an interface needs to be released;
150 CPPU_DLLPUBLIC
void SAL_CALL
uno_any_destruct(
151 uno_Any
* pValue
, uno_ReleaseFunc release
)
152 SAL_THROW_EXTERN_C();
154 /** Sets value to void.
156 @param pValue pointer to any
157 @param release function called each time an interface needs to be released;
160 CPPU_DLLPUBLIC
void SAL_CALL
uno_any_clear(
161 uno_Any
* pValue
, uno_ReleaseFunc release
)
162 SAL_THROW_EXTERN_C();
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */