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 .
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"
38 struct _typelib_TypeDescriptionReference
;
39 struct _typelib_TypeDescription
;
42 /** This is the binary specification of a UNO any.
44 typedef struct SAL_DLLPUBLIC_RTTI _uno_Any
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.
54 /** reserved space for storing value
63 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
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;
71 @param release function called each time an interface needs to be released;
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
)
79 /** Assign an any with a given value. Interfaces are acquired or released by the given callback
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;
87 @param release function called each time an interface needs to be released;
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
)
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;
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;
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;
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;
164 CPPU_DLLPUBLIC
void SAL_CALL
uno_any_clear(
165 uno_Any
* pValue
, uno_ReleaseFunc release
)
166 SAL_THROW_EXTERN_C();
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */