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 .
20 #ifndef INCLUDED_REGISTRY_WRITER_H
21 #define INCLUDED_REGISTRY_WRITER_H
23 #include <registry/regdllapi.h>
24 #include <registry/types.hxx>
25 #include <registry/version.h>
27 #include <rtl/ustring.h>
28 #include <sal/types.h>
35 Creates a type writer working on a binary blob that represents a UNOIDL type.
37 <p>Operations on a returned handle are not multi-thread–safe.</p>
39 @param version the version of the created type writer; must not be negative
41 @param documentation the documentation; must not be null
43 @param fileName the file name; must not be null (deprecated, use an empty string)
45 @param typeClass the type class of the created type writer
47 @param published whether the created type writer is published; for a type
48 class that cannot be published, this should be false
50 @param typeName the type name of the created type writer; must not be null
52 @param superTypeCount the number of super types of the created type writer
54 @param fieldCount the number of fields of the created type writer
56 @param methodCount the number of methods of the created type writer
58 @param referenceCount the number of references of the created type writer
60 @return a handle on the type writer; if an out-of-memory condition occurs,
61 null is returned, and no type writer is created
65 REG_DLLPUBLIC
void * typereg_writer_create(
66 typereg_Version version
, rtl_uString
const * documentation
,
67 rtl_uString
const * fileName
, RTTypeClass typeClass
, sal_Bool published
,
68 rtl_uString
const * typeName
, sal_uInt16 superTypeCount
,
69 sal_uInt16 fieldCount
, sal_uInt16 methodCount
, sal_uInt16 referenceCount
)
73 Destroys a type writer.
75 @param handle a handle on a type writer obtained from a call to
76 <code>typereg_writer_create</code>; must not be null
80 REG_DLLPUBLIC
void typereg_writer_destroy(void * handle
) SAL_THROW_EXTERN_C();
83 Sets the type name of a super type of a type writer.
85 @param handle a handle on a type writer; must not be null
87 @param index a valid index into the range of super types of the given type
90 @param typeName the super type name; must not be null
92 @return false iff an out-of-memory condition occurred, in which case the type
93 writer is not modified
97 REG_DLLPUBLIC sal_Bool
typereg_writer_setSuperTypeName(
98 void const * handle
, sal_uInt16 index
, rtl_uString
const * typeName
)
102 Sets the data of a field of a type writer.
104 @param handle a handle on a type writer; must not be null
106 @param index a valid index into the range of fields of the given type writer
108 @param documentation the documentation of the field; must not be null
110 @param fileName the file name of the field; must not be null (deprecated, use an empty string)
112 @param flags the flags of the field
114 @param name the name of the field; must not be null
116 @param typeName the type name of the field; must not be null
118 @param valueType the type of the value of the field
120 @param valueValue the value of the value of the field
122 @return false iff an out-of-memory condition occurred, in which case the type
123 writer is not modified
127 REG_DLLPUBLIC sal_Bool
typereg_writer_setFieldData(
128 void * handle
, sal_uInt16 index
, rtl_uString
const * documentation
,
129 rtl_uString
const * fileName
, RTFieldAccess flags
, rtl_uString
const * name
,
130 rtl_uString
const * typeName
, RTValueType valueType
,
131 RTConstValueUnion valueValue
)
132 SAL_THROW_EXTERN_C();
135 Sets the data of a method of a type writer.
137 @param handle a handle on a type writer; must not be null
139 @param index a valid index into the range of methods of the given type writer
141 @param documentation the documentation of the method; must not be null
143 @param flags the flags of the method
145 @param name the name of the method; must not be null
147 @param returnTypeName the return type name of the method; must not be null
149 @param parameterCount the number of parameters of the method
151 @param exceptionCount the number of exceptions of the method
153 @return false iff an out-of-memory condition occurred, in which case the type
154 writer is not modified
158 REG_DLLPUBLIC sal_Bool
typereg_writer_setMethodData(
159 void * handle
, sal_uInt16 index
, rtl_uString
const * documentation
,
160 RTMethodMode flags
, rtl_uString
const * name
,
161 rtl_uString
const * returnTypeName
, sal_uInt16 parameterCount
,
162 sal_uInt16 exceptionCount
)
163 SAL_THROW_EXTERN_C();
166 Sets the data of a parameter of a method of a type writer.
168 @param handle a handle on a type writer; must not be null
170 @param methodIndex a valid index into the range of methods of the given type
173 @param parameterIndex a valid index into the range of parameters of the given
176 @param flags the flags of the parameter
178 @param name the name of the parameter; must not be null
180 @param typeName the type name of the parameter; must not be null
182 @return false iff an out-of-memory condition occurred, in which case the type
183 writer is not modified
187 REG_DLLPUBLIC sal_Bool
typereg_writer_setMethodParameterData(
188 void const * handle
, sal_uInt16 methodIndex
, sal_uInt16 parameterIndex
,
189 RTParamMode flags
, rtl_uString
const * name
, rtl_uString
const * typeName
)
190 SAL_THROW_EXTERN_C();
193 Sets an exception type name of a method of a type writer.
195 @param handle a handle on a type writer; must not be null
197 @param methodIndex a valid index into the range of methods of the given type
200 @param exceptionIndex a valid index into the range of exceptions of the given
203 @param typeName the exception type name; must not be null
205 @return false iff an out-of-memory condition occurred, in which case the type
206 writer is not modified
210 REG_DLLPUBLIC sal_Bool
typereg_writer_setMethodExceptionTypeName(
211 void const * handle
, sal_uInt16 methodIndex
, sal_uInt16 exceptionIndex
,
212 rtl_uString
const * typeName
)
213 SAL_THROW_EXTERN_C();
216 Sets the data of a reference of a type writer.
218 @param handle a handle on a type writer; must not be null
220 @param index a valid index into the range of references of the given type
223 @param documentation the documentation of the reference; must not be null
225 @param sort the sort of the reference
227 @param flags the flags of the reference
229 @param typeName the type name of the reference; must not be null
231 @return false iff an out-of-memory condition occurred, in which case the type
232 writer is not modified
236 REG_DLLPUBLIC sal_Bool
typereg_writer_setReferenceData(
237 void * handle
, sal_uInt16 index
, rtl_uString
const * documentation
,
238 RTReferenceType sort
, RTFieldAccess flags
, rtl_uString
const * typeName
)
239 SAL_THROW_EXTERN_C();
242 Returns the blob of a type writer.
244 @param handle a handle on a type writer; must not be null
246 @param size an out-parameter obtaining the size of the blob; must not be null
248 @return a (byte-aligned) pointer to the blob; the returned pointer and the
249 returned <code>size</code> remain valid until the next function is called on
250 the given type writer; if an out-of-memory condition occurs, null is returned
251 and <code>size</code> is not modified
253 REG_DLLPUBLIC
void const * typereg_writer_getBlob(void * handle
, sal_uInt32
* size
)
254 SAL_THROW_EXTERN_C();
262 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */