1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef INCLUDED_registry_writer_h 25 #define INCLUDED_registry_writer_h 26 27 #include "registry/types.h" 28 #include "registry/version.h" 29 30 #include "rtl/ustring.h" 31 #include "sal/types.h" 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 /// @HTML 38 39 /** 40 Creates a type writer working on a binary blob that represents a UNOIDL type. 41 42 <p>Operations on a returned handle are not multi-thread–safe.</p> 43 44 @param version the version of the created type writer; must not be negative 45 46 @param documentation the documentation; must not be null 47 48 @param fileName the file name; must not be null (deprecated, use an empty string) 49 50 @param typeClass the type class of the created type writer 51 52 @param published whether the created type writer is published; for a type 53 class that cannot be published, this should be false 54 55 @param typeName the type name of the created type writer; must not be null 56 57 @param superTypeCount the number of super types of the created type writer 58 59 @param fieldCount the number of fields of the created type writer 60 61 @param methodCount the number of methods of the created type writer 62 63 @param referenceCount the number of references of the created type writer 64 65 @return a handle on the type writer; if an out-of-memory condition occurs, 66 null is returned, and no type writer is created 67 68 @since UDK 3.2.0 69 */ 70 void * SAL_CALL typereg_writer_create( 71 typereg_Version version, rtl_uString const * documentation, 72 rtl_uString const * fileName, RTTypeClass typeClass, sal_Bool published, 73 rtl_uString const * typeName, sal_uInt16 superTypeCount, 74 sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount) 75 SAL_THROW_EXTERN_C(); 76 77 /** 78 Destroys a type writer. 79 80 @param handle a handle on a type writer obtained from a call to 81 <code>typereg_writer_create</code>; must not be null 82 83 @since UDK 3.2.0 84 */ 85 void SAL_CALL typereg_writer_destroy(void * handle) SAL_THROW_EXTERN_C(); 86 87 /** 88 Sets the type name of a super type of a type writer. 89 90 @param handle a handle on a type writer; must not be null 91 92 @param index a valid index into the range of super types of the given type 93 writer 94 95 @param typeName the super type name; must not be null 96 97 @return false iff an out-of-memory condition ocurred, in which case the type 98 writer is not modified 99 100 @since UDK 3.2.0 101 */ 102 sal_Bool SAL_CALL typereg_writer_setSuperTypeName( 103 void * handle, sal_uInt16 index, rtl_uString const * typeName) 104 SAL_THROW_EXTERN_C(); 105 106 /** 107 Sets the data of a field of a type writer. 108 109 @param handle a handle on a type writer; must not be null 110 111 @param index a valid index into the range of fields of the given type writer 112 113 @param documentation the documentation of the field; must not be null 114 115 @param fileName the file name of the field; must not be null (deprecated, use an empty string) 116 117 @param flags the flags of the field 118 119 @param name the name of the field; must not be null 120 121 @param typeName the type name of the field; must not be null 122 123 @param valueType the type of the value of the field 124 125 @param valueValue the value of the value of the field 126 127 @return false iff an out-of-memory condition ocurred, in which case the type 128 writer is not modified 129 130 @since UDK 3.2.0 131 */ 132 sal_Bool SAL_CALL typereg_writer_setFieldData( 133 void * handle, sal_uInt16 index, rtl_uString const * documentation, 134 rtl_uString const * fileName, RTFieldAccess flags, rtl_uString const * name, 135 rtl_uString const * typeName, RTValueType valueType, 136 RTConstValueUnion valueValue) 137 SAL_THROW_EXTERN_C(); 138 139 /** 140 Sets the data of a method of a type writer. 141 142 @param handle a handle on a type writer; must not be null 143 144 @param index a valid index into the range of methods of the given type writer 145 146 @param documentation the documentation of the method; must not be null 147 148 @param flags the flags of the method 149 150 @param name the name of the method; must not be null 151 152 @param returnTypeName the return type name of the method; must not be null 153 154 @param parameterCount the number of parameters of the method 155 156 @param exceptionCount the number of exceptions of the method 157 158 @return false iff an out-of-memory condition ocurred, in which case the type 159 writer is not modified 160 161 @since UDK 3.2.0 162 */ 163 sal_Bool SAL_CALL typereg_writer_setMethodData( 164 void * handle, sal_uInt16 index, rtl_uString const * documentation, 165 RTMethodMode flags, rtl_uString const * name, 166 rtl_uString const * returnTypeName, sal_uInt16 parameterCount, 167 sal_uInt16 exceptionCount) 168 SAL_THROW_EXTERN_C(); 169 170 /** 171 Sets the data of a parameter of a method of a type writer. 172 173 @param handle a handle on a type writer; must not be null 174 175 @param methodIndex a valid index into the range of methods of the given type 176 writer 177 178 @param parameterIndex a valid index into the range of parameters of the given 179 method 180 181 @param flags the flags of the parameter 182 183 @param name the name of the parameter; must not be null 184 185 @param typeName the type name of the parameter; must not be null 186 187 @return false iff an out-of-memory condition ocurred, in which case the type 188 writer is not modified 189 190 @since UDK 3.2.0 191 */ 192 sal_Bool SAL_CALL typereg_writer_setMethodParameterData( 193 void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex, 194 RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName) 195 SAL_THROW_EXTERN_C(); 196 197 /** 198 Sets an exception type name of a method of a type writer. 199 200 @param handle a handle on a type writer; must not be null 201 202 @param methodIndex a valid index into the range of methods of the given type 203 writer 204 205 @param exceptionIndex a valid index into the range of exceptions of the given 206 method 207 208 @param typeName the exception type name; must not be null 209 210 @return false iff an out-of-memory condition ocurred, in which case the type 211 writer is not modified 212 213 @since UDK 3.2.0 214 */ 215 sal_Bool SAL_CALL typereg_writer_setMethodExceptionTypeName( 216 void * handle, sal_uInt16 methodIndex, sal_uInt16 exceptionIndex, 217 rtl_uString const * typeName) 218 SAL_THROW_EXTERN_C(); 219 220 /** 221 Sets the data of a reference of a type writer. 222 223 @param handle a handle on a type writer; must not be null 224 225 @param index a valid index into the range of references of the given type 226 writer 227 228 @param documentation the documentation of the reference; must not be null 229 230 @param sort the sort of the reference 231 232 @param flags the flags of the reference 233 234 @param typeName the type name of the reference; must not be null 235 236 @return false iff an out-of-memory condition ocurred, in which case the type 237 writer is not modified 238 239 @since UDK 3.2.0 240 */ 241 sal_Bool SAL_CALL typereg_writer_setReferenceData( 242 void * handle, sal_uInt16 index, rtl_uString const * documentation, 243 RTReferenceType sort, RTFieldAccess flags, rtl_uString const * typeName) 244 SAL_THROW_EXTERN_C(); 245 246 /** 247 Returns the blob of a type writer. 248 249 @param handle a handle on a type writer; must not be null 250 251 @param size an out-parameter obtaining the size of the blob; must not be null 252 253 @return a (byte-aligned) pointer to the blob; the returned pointer and the 254 returned <code>size</code> remain valid until the next function is called on 255 the given type writer; if an out-of-memory condition occurs, null is returned 256 and <code>size</code> is not modified 257 */ 258 void const * SAL_CALL typereg_writer_getBlob(void * handle, sal_uInt32 * size) 259 SAL_THROW_EXTERN_C(); 260 261 #ifdef __cplusplus 262 } 263 #endif 264 265 #endif 266