Branch libreoffice-5-0-4
[LibreOffice.git] / include / uno / sequence2.h
blob3b55ba007cf1b598ff511eff0cc54dcc748dedfb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_SEQUENCE2_H
20 #define INCLUDED_UNO_SEQUENCE2_H
22 #include <cppu/cppudllapi.h>
23 #include <uno/data.h>
25 #ifdef __cplusplus
26 extern "C"
28 #endif
30 struct _typelib_TypeDescriptionReference;
31 struct _typelib_TypeDescription;
32 typedef sal_Sequence uno_Sequence;
34 /** Assigns a sequence.
36 @param ppDest destinstaion sequence
37 @param pSource source sequence
38 @param pTypeDescr type description of the sequence and NOT of an element
39 @param release function called each time an interface needs to
40 be released; defaults (0) to uno
42 CPPU_DLLPUBLIC void SAL_CALL uno_sequence_assign(
43 uno_Sequence ** ppDest,
44 uno_Sequence * pSource,
45 struct _typelib_TypeDescription * pTypeDescr,
46 uno_ReleaseFunc release )
47 SAL_THROW_EXTERN_C();
48 /** Assigns a sequence.
50 @param ppDest destinstaion sequence
51 @param pSource source sequence
52 @param pType type of the sequence and NOT of an element
53 @param release function called each time an interface needs to
54 be released; defaults (0) to uno
56 CPPU_DLLPUBLIC void SAL_CALL uno_type_sequence_assign(
57 uno_Sequence ** ppDest,
58 uno_Sequence * pSource,
59 struct _typelib_TypeDescriptionReference * pType,
60 uno_ReleaseFunc release )
61 SAL_THROW_EXTERN_C();
63 /** Constructs a new sequence with given elements.
65 @param ppSequence out parameter sequence;
66 0 if memory allocation has failed
67 @param pTypeDescr type description of the sequence and NOT of an
68 element
69 @param pElements if 0, then all elements are default constructed
70 @param len number of elements
71 @param acquire function called each time an interface needs to
72 be acquired; defaults (0) to uno
73 @return false, if memoray allocation has failed
75 CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_sequence_construct(
76 uno_Sequence ** ppSequence,
77 struct _typelib_TypeDescription * pTypeDescr,
78 void * pElements, sal_Int32 len,
79 uno_AcquireFunc acquire )
80 SAL_THROW_EXTERN_C();
81 /** Constructs a new sequence with given elements.
83 @param ppSequence out parameter sequence;
84 0 if memory allocation has failed
85 @param pType type of the sequence and NOT of an element
86 @param pElements if 0, then all elements are default constructed
87 @param len number of elements
88 @param acquire function called each time an interface needs to
89 be acquired; defaults (0) to uno
90 @return false, if memoray allocation has failed
92 CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_sequence_construct(
93 uno_Sequence ** ppSequence,
94 struct _typelib_TypeDescriptionReference * pType,
95 void * pElements, sal_Int32 len,
96 uno_AcquireFunc acquire )
97 SAL_THROW_EXTERN_C();
99 /** Assures that the reference count of the given sequence is one.
100 Otherwise a new copy of the sequence is created with a reference count
101 of one.
103 @param ppSequence inout sequence
104 @param pTypeDescr type description of sequence
105 @param acquire function called each time an interface needs to
106 be acquired; defaults (0) to uno
107 @param release function called each time an interface needs to
108 be released; defaults (0) to uno
109 @return false, if memoray allocation has failed
111 CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_sequence_reference2One(
112 uno_Sequence ** ppSequence,
113 struct _typelib_TypeDescription * pTypeDescr,
114 uno_AcquireFunc acquire,
115 uno_ReleaseFunc release )
116 SAL_THROW_EXTERN_C();
117 /** Assures that the reference count of the given sequence is one.
118 Otherwise a new copy of the sequence is created with a reference count
119 of one.
121 @param ppSequence inout sequence
122 @param pType type of sequence
123 @param acquire function called each time an interface needs to
124 be acquired; defaults (0) to uno
125 @param release function called each time an interface needs to
126 be released; defaults (0) to uno
127 @return false, if memoray allocation has failed
129 CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_sequence_reference2One(
130 uno_Sequence ** ppSequence,
131 struct _typelib_TypeDescriptionReference * pType,
132 uno_AcquireFunc acquire,
133 uno_ReleaseFunc release )
134 SAL_THROW_EXTERN_C();
136 /** Reallocates length of a sequence. This truncates a sequence or enlarges
137 it default constructing appended elements.
139 @param ppSequence inout sequence
140 @param pTypeDescr type description of sequence
141 @param nSize new size of sequence
142 @param acquire function called each time an interface needs to
143 be acquired; defaults (0) to uno
144 @param release function called each time an interface needs to
145 be released; defaults (0) to uno
146 @return false, if memoray allocation has failed
148 CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_sequence_realloc(
149 uno_Sequence ** ppSequence,
150 struct _typelib_TypeDescription * pTypeDescr,
151 sal_Int32 nSize,
152 uno_AcquireFunc acquire,
153 uno_ReleaseFunc release )
154 SAL_THROW_EXTERN_C();
155 /** Reallocates length of a sequence. This truncates a sequence or enlarges
156 it default constructing appended elements.
158 @param ppSequence inout sequence
159 @param pType type of sequence
160 @param nSize new size of sequence
161 @param acquire function called each time an interface needs to
162 be acquired; defaults (0) to uno
163 @param release function called each time an interface needs to
164 be released; defaults (0) to uno
165 @return false, if memoray allocation has failed
167 CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_sequence_realloc(
168 uno_Sequence ** ppSequence,
169 struct _typelib_TypeDescriptionReference * pType,
170 sal_Int32 nSize,
171 uno_AcquireFunc acquire,
172 uno_ReleaseFunc release )
173 SAL_THROW_EXTERN_C();
175 /** Destroy a sequence whose reference count has dropped to zero.
177 @param sequence must be non-null, sequence->nRefCount must be zero
178 @param type the type of the sequence, must be non-null
179 @param release function called each time an interface needs to be release,
180 must be non-null
182 @since LibreOffice 4.4
184 CPPU_DLLPUBLIC void SAL_CALL uno_type_sequence_destroy(
185 uno_Sequence * sequence, struct _typelib_TypeDescriptionReference * type,
186 uno_ReleaseFunc release)
187 SAL_THROW_EXTERN_C();
189 #ifdef __cplusplus
191 #endif
193 #endif
195 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */