xref: /AOO41X/main/cppu/inc/uno/sequence2.h (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _UNO_SEQUENCE2_H_
28*cdf0e10cSrcweir #define _UNO_SEQUENCE2_H_
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <sal/types.h>
31*cdf0e10cSrcweir #include <uno/data.h>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #ifdef __cplusplus
34*cdf0e10cSrcweir extern "C"
35*cdf0e10cSrcweir {
36*cdf0e10cSrcweir #endif
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir struct _typelib_TypeDescriptionReference;
39*cdf0e10cSrcweir struct _typelib_TypeDescription;
40*cdf0e10cSrcweir typedef sal_Sequence uno_Sequence;
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir /** Assigns a sequence.
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir 	@param ppDest		destinstaion sequence
45*cdf0e10cSrcweir 	@param pSource		source sequence
46*cdf0e10cSrcweir 	@param pTypeDescr	type description of the sequence and NOT of an element
47*cdf0e10cSrcweir 	@param release		function called each time an interface needs to
48*cdf0e10cSrcweir                         be released; defaults (0) to uno
49*cdf0e10cSrcweir */
50*cdf0e10cSrcweir void SAL_CALL uno_sequence_assign(
51*cdf0e10cSrcweir 	uno_Sequence ** ppDest,
52*cdf0e10cSrcweir 	uno_Sequence * pSource,
53*cdf0e10cSrcweir 	struct _typelib_TypeDescription * pTypeDescr,
54*cdf0e10cSrcweir 	uno_ReleaseFunc release )
55*cdf0e10cSrcweir 	SAL_THROW_EXTERN_C();
56*cdf0e10cSrcweir /** Assigns a sequence.
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir 	@param ppDest		destinstaion sequence
59*cdf0e10cSrcweir 	@param pSource		source sequence
60*cdf0e10cSrcweir 	@param pType		type of the sequence and NOT of an element
61*cdf0e10cSrcweir 	@param release		function called each time an interface needs to
62*cdf0e10cSrcweir                         be released; defaults (0) to uno
63*cdf0e10cSrcweir */
64*cdf0e10cSrcweir void SAL_CALL uno_type_sequence_assign(
65*cdf0e10cSrcweir 	uno_Sequence ** ppDest,
66*cdf0e10cSrcweir 	uno_Sequence * pSource,
67*cdf0e10cSrcweir 	struct _typelib_TypeDescriptionReference * pType,
68*cdf0e10cSrcweir 	uno_ReleaseFunc release )
69*cdf0e10cSrcweir 	SAL_THROW_EXTERN_C();
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir /** Constructs a new sequence with given elements.
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 	@param ppSequence		  out parameter sequence;
74*cdf0e10cSrcweir                               0 if memory allocation has failed
75*cdf0e10cSrcweir 	@param pTypeDescr		  type description of the sequence and NOT of an
76*cdf0e10cSrcweir                               element
77*cdf0e10cSrcweir 	@param pElements		  if 0, then all elements are default constructed
78*cdf0e10cSrcweir 	@param len				  number of elements
79*cdf0e10cSrcweir 	@param acquire			  function called each time an interface needs to
80*cdf0e10cSrcweir                               be acquired; defaults (0) to uno
81*cdf0e10cSrcweir     @return                   false, if memoray allocation has failed
82*cdf0e10cSrcweir */
83*cdf0e10cSrcweir sal_Bool SAL_CALL uno_sequence_construct(
84*cdf0e10cSrcweir 	uno_Sequence ** ppSequence,
85*cdf0e10cSrcweir 	struct _typelib_TypeDescription * pTypeDescr,
86*cdf0e10cSrcweir 	void * pElements, sal_Int32 len,
87*cdf0e10cSrcweir 	uno_AcquireFunc acquire )
88*cdf0e10cSrcweir 	SAL_THROW_EXTERN_C();
89*cdf0e10cSrcweir /** Constructs a new sequence with given elements.
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 	@param ppSequence		  out parameter sequence;
92*cdf0e10cSrcweir                               0 if memory allocation has failed
93*cdf0e10cSrcweir 	@param pType			  type of the sequence and NOT of an element
94*cdf0e10cSrcweir 	@param pElements		  if 0, then all elements are default constructed
95*cdf0e10cSrcweir 	@param len				  number of elements
96*cdf0e10cSrcweir 	@param acquire			  function called each time an interface needs to
97*cdf0e10cSrcweir                               be acquired; defaults (0) to uno
98*cdf0e10cSrcweir     @return                   false, if memoray allocation has failed
99*cdf0e10cSrcweir */
100*cdf0e10cSrcweir sal_Bool SAL_CALL uno_type_sequence_construct(
101*cdf0e10cSrcweir 	uno_Sequence ** ppSequence,
102*cdf0e10cSrcweir 	struct _typelib_TypeDescriptionReference * pType,
103*cdf0e10cSrcweir 	void * pElements, sal_Int32 len,
104*cdf0e10cSrcweir 	uno_AcquireFunc acquire )
105*cdf0e10cSrcweir 	SAL_THROW_EXTERN_C();
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir /** Assures that the reference count of the given sequence is one.
108*cdf0e10cSrcweir     Otherwise a new copy of the sequence is created with a reference count
109*cdf0e10cSrcweir     of one.
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir 	@param ppSequence		inout sequence
112*cdf0e10cSrcweir 	@param pTypeDescr		type description of sequence
113*cdf0e10cSrcweir 	@param acquire			function called each time an interface needs to
114*cdf0e10cSrcweir                             be acquired; defaults (0) to uno
115*cdf0e10cSrcweir 	@param release			function called each time an interface needs to
116*cdf0e10cSrcweir                             be released; defaults (0) to uno
117*cdf0e10cSrcweir     @return                 false, if memoray allocation has failed
118*cdf0e10cSrcweir */
119*cdf0e10cSrcweir sal_Bool SAL_CALL uno_sequence_reference2One(
120*cdf0e10cSrcweir 	uno_Sequence ** ppSequence,
121*cdf0e10cSrcweir 	struct _typelib_TypeDescription * pTypeDescr,
122*cdf0e10cSrcweir 	uno_AcquireFunc acquire,
123*cdf0e10cSrcweir 	uno_ReleaseFunc release )
124*cdf0e10cSrcweir 	SAL_THROW_EXTERN_C();
125*cdf0e10cSrcweir /** Assures that the reference count of the given sequence is one.
126*cdf0e10cSrcweir     Otherwise a new copy of the sequence is created with a reference count
127*cdf0e10cSrcweir     of one.
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 	@param ppSequence		inout sequence
130*cdf0e10cSrcweir 	@param pType			type of sequence
131*cdf0e10cSrcweir 	@param acquire			function called each time an interface needs to
132*cdf0e10cSrcweir                             be acquired; defaults (0) to uno
133*cdf0e10cSrcweir 	@param release			function called each time an interface needs to
134*cdf0e10cSrcweir                             be released; defaults (0) to uno
135*cdf0e10cSrcweir     @return                 false, if memoray allocation has failed
136*cdf0e10cSrcweir */
137*cdf0e10cSrcweir sal_Bool SAL_CALL uno_type_sequence_reference2One(
138*cdf0e10cSrcweir 	uno_Sequence ** ppSequence,
139*cdf0e10cSrcweir 	struct _typelib_TypeDescriptionReference * pType,
140*cdf0e10cSrcweir 	uno_AcquireFunc acquire,
141*cdf0e10cSrcweir 	uno_ReleaseFunc release )
142*cdf0e10cSrcweir 	SAL_THROW_EXTERN_C();
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir /** Reallocates length of a sequence. This truncates a sequence or enlarges
145*cdf0e10cSrcweir     it default constructing appended elements.
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 	@param ppSequence		inout sequence
148*cdf0e10cSrcweir 	@param pTypeDescr		type description of sequence
149*cdf0e10cSrcweir 	@param nSize			new size of sequence
150*cdf0e10cSrcweir 	@param acquire			function called each time an interface needs to
151*cdf0e10cSrcweir                             be acquired; defaults (0) to uno
152*cdf0e10cSrcweir 	@param release			function called each time an interface needs to
153*cdf0e10cSrcweir                             be released; defaults (0) to uno
154*cdf0e10cSrcweir     @return                 false, if memoray allocation has failed
155*cdf0e10cSrcweir */
156*cdf0e10cSrcweir sal_Bool SAL_CALL uno_sequence_realloc(
157*cdf0e10cSrcweir 	uno_Sequence ** ppSequence,
158*cdf0e10cSrcweir 	struct _typelib_TypeDescription * pTypeDescr,
159*cdf0e10cSrcweir 	sal_Int32 nSize,
160*cdf0e10cSrcweir 	uno_AcquireFunc acquire,
161*cdf0e10cSrcweir 	uno_ReleaseFunc release )
162*cdf0e10cSrcweir 	SAL_THROW_EXTERN_C();
163*cdf0e10cSrcweir /** Reallocates length of a sequence. This truncates a sequence or enlarges
164*cdf0e10cSrcweir     it default constructing appended elements.
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 	@param ppSequence		inout sequence
167*cdf0e10cSrcweir 	@param pType			type of sequence
168*cdf0e10cSrcweir 	@param nSize			new size of sequence
169*cdf0e10cSrcweir 	@param acquire			function called each time an interface needs to
170*cdf0e10cSrcweir                             be acquired; defaults (0) to uno
171*cdf0e10cSrcweir 	@param release			function called each time an interface needs to
172*cdf0e10cSrcweir                             be released; defaults (0) to uno
173*cdf0e10cSrcweir     @return                 false, if memoray allocation has failed
174*cdf0e10cSrcweir */
175*cdf0e10cSrcweir sal_Bool SAL_CALL uno_type_sequence_realloc(
176*cdf0e10cSrcweir 	uno_Sequence ** ppSequence,
177*cdf0e10cSrcweir 	struct _typelib_TypeDescriptionReference * pType,
178*cdf0e10cSrcweir 	sal_Int32 nSize,
179*cdf0e10cSrcweir 	uno_AcquireFunc acquire,
180*cdf0e10cSrcweir 	uno_ReleaseFunc release )
181*cdf0e10cSrcweir 	SAL_THROW_EXTERN_C();
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir #ifdef __cplusplus
184*cdf0e10cSrcweir }
185*cdf0e10cSrcweir #endif
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir #endif
188