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 #include "registry/registrydllapi.h" 30 31 #include "rtl/ustring.h" 32 #include "sal/types.h" 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif 37 38 /// @HTML 39 40 /** 41 Creates a type writer working on a binary blob that represents a UNOIDL type. 42 43 <p>Operations on a returned handle are not multi-thread–safe.</p> 44 45 @param version the version of the created type writer; must not be negative 46 47 @param documentation the documentation; must not be null 48 49 @param fileName the file name; must not be null (deprecated, use an empty string) 50 51 @param typeClass the type class of the created type writer 52 53 @param published whether the created type writer is published; for a type 54 class that cannot be published, this should be false 55 56 @param typeName the type name of the created type writer; must not be null 57 58 @param superTypeCount the number of super types of the created type writer 59 60 @param fieldCount the number of fields of the created type writer 61 62 @param methodCount the number of methods of the created type writer 63 64 @param referenceCount the number of references of the created type writer 65 66 @return a handle on the type writer; if an out-of-memory condition occurs, 67 null is returned, and no type writer is created 68 69 @since UDK 3.2.0 70 */ 71 REGISTRY_DLLPUBLIC void * SAL_CALL typereg_writer_create( 72 typereg_Version version, rtl_uString const * documentation, 73 rtl_uString const * fileName, RTTypeClass typeClass, sal_Bool published, 74 rtl_uString const * typeName, sal_uInt16 superTypeCount, 75 sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount) 76 SAL_THROW_EXTERN_C(); 77 78 /** 79 Destroys a type writer. 80 81 @param handle a handle on a type writer obtained from a call to 82 <code>typereg_writer_create</code>; must not be null 83 84 @since UDK 3.2.0 85 */ 86 REGISTRY_DLLPUBLIC void SAL_CALL typereg_writer_destroy(void * handle) SAL_THROW_EXTERN_C(); 87 88 /** 89 Sets the type name of a super type of a type writer. 90 91 @param handle a handle on a type writer; must not be null 92 93 @param index a valid index into the range of super types of the given type 94 writer 95 96 @param typeName the super type name; must not be null 97 98 @return false iff an out-of-memory condition occurred, in which case the type 99 writer is not modified 100 101 @since UDK 3.2.0 102 */ 103 REGISTRY_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setSuperTypeName( 104 void * handle, sal_uInt16 index, rtl_uString const * typeName) 105 SAL_THROW_EXTERN_C(); 106 107 /** 108 Sets the data of a field of a type writer. 109 110 @param handle a handle on a type writer; must not be null 111 112 @param index a valid index into the range of fields of the given type writer 113 114 @param documentation the documentation of the field; must not be null 115 116 @param fileName the file name of the field; must not be null (deprecated, use an empty string) 117 118 @param flags the flags of the field 119 120 @param name the name of the field; must not be null 121 122 @param typeName the type name of the field; must not be null 123 124 @param valueType the type of the value of the field 125 126 @param valueValue the value of the value of the field 127 128 @return false iff an out-of-memory condition occurred, in which case the type 129 writer is not modified 130 131 @since UDK 3.2.0 132 */ 133 REGISTRY_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setFieldData( 134 void * handle, sal_uInt16 index, rtl_uString const * documentation, 135 rtl_uString const * fileName, RTFieldAccess flags, rtl_uString const * name, 136 rtl_uString const * typeName, RTValueType valueType, 137 RTConstValueUnion valueValue) 138 SAL_THROW_EXTERN_C(); 139 140 /** 141 Sets the data of a method of a type writer. 142 143 @param handle a handle on a type writer; must not be null 144 145 @param index a valid index into the range of methods of the given type writer 146 147 @param documentation the documentation of the method; must not be null 148 149 @param flags the flags of the method 150 151 @param name the name of the method; must not be null 152 153 @param returnTypeName the return type name of the method; must not be null 154 155 @param parameterCount the number of parameters of the method 156 157 @param exceptionCount the number of exceptions of the method 158 159 @return false iff an out-of-memory condition occurred, in which case the type 160 writer is not modified 161 162 @since UDK 3.2.0 163 */ 164 REGISTRY_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodData( 165 void * handle, sal_uInt16 index, rtl_uString const * documentation, 166 RTMethodMode flags, rtl_uString const * name, 167 rtl_uString const * returnTypeName, sal_uInt16 parameterCount, 168 sal_uInt16 exceptionCount) 169 SAL_THROW_EXTERN_C(); 170 171 /** 172 Sets the data of a parameter of a method of a type writer. 173 174 @param handle a handle on a type writer; must not be null 175 176 @param methodIndex a valid index into the range of methods of the given type 177 writer 178 179 @param parameterIndex a valid index into the range of parameters of the given 180 method 181 182 @param flags the flags of the parameter 183 184 @param name the name of the parameter; must not be null 185 186 @param typeName the type name of the parameter; must not be null 187 188 @return false iff an out-of-memory condition occurred, in which case the type 189 writer is not modified 190 191 @since UDK 3.2.0 192 */ 193 REGISTRY_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodParameterData( 194 void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex, 195 RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName) 196 SAL_THROW_EXTERN_C(); 197 198 /** 199 Sets an exception type name of a method of a type writer. 200 201 @param handle a handle on a type writer; must not be null 202 203 @param methodIndex a valid index into the range of methods of the given type 204 writer 205 206 @param exceptionIndex a valid index into the range of exceptions of the given 207 method 208 209 @param typeName the exception type name; must not be null 210 211 @return false iff an out-of-memory condition occurred, in which case the type 212 writer is not modified 213 214 @since UDK 3.2.0 215 */ 216 REGISTRY_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodExceptionTypeName( 217 void * handle, sal_uInt16 methodIndex, sal_uInt16 exceptionIndex, 218 rtl_uString const * typeName) 219 SAL_THROW_EXTERN_C(); 220 221 /** 222 Sets the data of a reference of a type writer. 223 224 @param handle a handle on a type writer; must not be null 225 226 @param index a valid index into the range of references of the given type 227 writer 228 229 @param documentation the documentation of the reference; must not be null 230 231 @param sort the sort of the reference 232 233 @param flags the flags of the reference 234 235 @param typeName the type name of the reference; must not be null 236 237 @return false iff an out-of-memory condition occurred, in which case the type 238 writer is not modified 239 240 @since UDK 3.2.0 241 */ 242 REGISTRY_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setReferenceData( 243 void * handle, sal_uInt16 index, rtl_uString const * documentation, 244 RTReferenceType sort, RTFieldAccess flags, rtl_uString const * typeName) 245 SAL_THROW_EXTERN_C(); 246 247 /** 248 Returns the blob of a type writer. 249 250 @param handle a handle on a type writer; must not be null 251 252 @param size an out-parameter obtaining the size of the blob; must not be null 253 254 @return a (byte-aligned) pointer to the blob; the returned pointer and the 255 returned <code>size</code> remain valid until the next function is called on 256 the given type writer; if an out-of-memory condition occurs, null is returned 257 and <code>size</code> is not modified 258 */ 259 REGISTRY_DLLPUBLIC void const * SAL_CALL typereg_writer_getBlob(void * handle, sal_uInt32 * size) 260 SAL_THROW_EXTERN_C(); 261 262 #ifdef __cplusplus 263 } 264 #endif 265 266 #endif 267