1 /* 2 * ==================================================================== 3 * The Apache Software License, Version 1.1 4 * 5 * Copyright (c) 2000 The Apache Software Foundation. All rights 6 * reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in 17 * the documentation and/or other materials provided with the 18 * distribution. 19 * 20 * 3. The end-user documentation included with the redistribution, 21 * if any, must include the following acknowledgment: 22 * "This product includes software developed by the 23 * Apache Software Foundation (http://www.apache.org/)." 24 * Alternately, this acknowledgment may appear in the software itself, 25 * if and wherever such third-party acknowledgments normally appear. 26 * 27 * 4. The names "Apache" and "Apache Software Foundation" must 28 * not be used to endorse or promote products derived from this 29 * software without prior written permission. For written 30 * permission, please contact apache@apache.org. 31 * 32 * 5. Products derived from this software may not be called "Apache", 33 * nor may "Apache" appear in their name, without prior written 34 * permission of the Apache Software Foundation. 35 * 36 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 37 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 38 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 39 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 40 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 42 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 43 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 45 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 46 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 47 * SUCH DAMAGE. 48 * ==================================================================== 49 * 50 * This software consists of voluntary contributions made by many 51 * individuals on behalf of the Apache Software Foundation. For more 52 * information on the Apache Software Foundation, please see 53 * <http://www.apache.org/>. 54 */ 55 package org.apache.poi.hpsf; 56 57 /** 58 * <p> 59 * 60 * The <em>Variant</em> types as defined by Microsoft's COM. I found this 61 * information in <a href="http://www.marin.clara.net/COM/variant_type_definitions.htm"> 62 * http://www.marin.clara.net/COM/variant_type_definitions.htm</a> .</p> <p> 63 * 64 * In the variant types descriptions the following shortcuts are used: <strong> 65 * [V]</strong> - may appear in a VARIANT, <strong>[T]</strong> - may appear in 66 * a TYPEDESC, <strong>[P]</strong> - may appear in an OLE property set, 67 * <strong>[S]</strong> - may appear in a Safe Array.</p> 68 * 69 *@author Rainer Klute (klute@rainer-klute.de) 70 *@created May 10, 2002 71 *@version $Id: Variant.java,v 1.4 2002/05/11 14:47:23 acoliver Exp $ 72 *@since 2002-02-09 73 */ 74 public class Variant { 75 76 /** 77 * <p> 78 * 79 * [V][P] Nothing.</p> 80 */ 81 public final static int VT_EMPTY = 0; 82 83 /** 84 * <p> 85 * 86 * [V][P] SQL style Null.</p> 87 */ 88 public final static int VT_NULL = 1; 89 90 /** 91 * <p> 92 * 93 * [V][T][P][S] 2 byte signed int.</p> 94 */ 95 public final static int VT_I2 = 2; 96 97 /** 98 * <p> 99 * 100 * [V][T][P][S] 4 byte signed int.</p> 101 */ 102 public final static int VT_I4 = 3; 103 104 /** 105 * <p> 106 * 107 * [V][T][P][S] 4 byte real.</p> 108 */ 109 public final static int VT_R4 = 4; 110 111 /** 112 * <p> 113 * 114 * [V][T][P][S] 8 byte real.</p> 115 */ 116 public final static int VT_R8 = 5; 117 118 /** 119 * <p> 120 * 121 * [V][T][P][S] currency. <span style="background-color: #ffff00">How long 122 * is this? How is it to be interpreted?</span> </p> 123 */ 124 public final static int VT_CY = 6; 125 126 /** 127 * <p> 128 * 129 * [V][T][P][S] date. <span style="background-color: #ffff00">How long is 130 * this? How is it to be interpreted?</span> </p> 131 */ 132 public final static int VT_DATE = 7; 133 134 /** 135 * <p> 136 * 137 * [V][T][P][S] OLE Automation string. <span style="background-color: 138 * #ffff00">How long is this? How is it to be interpreted?</span> </p> 139 */ 140 public final static int VT_BSTR = 8; 141 142 /** 143 * <p> 144 * 145 * [V][T][P][S] IDispatch *. <span style="background-color: #ffff00">How 146 * long is this? How is it to be interpreted?</span> </p> 147 */ 148 public final static int VT_DISPATCH = 9; 149 150 /** 151 * <p> 152 * 153 * [V][T][S] SCODE. <span style="background-color: #ffff00">How long is 154 * this? How is it to be interpreted?</span> </p> 155 */ 156 public final static int VT_ERROR = 10; 157 158 /** 159 * <p> 160 * 161 * [V][T][P][S] True=-1, False=0.</p> 162 */ 163 public final static int VT_BOOL = 11; 164 165 /** 166 * <p> 167 * 168 * [V][T][P][S] VARIANT *. <span style="background-color: #ffff00">How long 169 * is this? How is it to be interpreted?</span> </p> 170 */ 171 public final static int VT_VARIANT = 12; 172 173 /** 174 * <p> 175 * 176 * [V][T][S] IUnknown *. <span style="background-color: #ffff00">How long 177 * is this? How is it to be interpreted?</span> </p> 178 */ 179 public final static int VT_UNKNOWN = 13; 180 181 /** 182 * <p> 183 * 184 * [V][T][S] 16 byte fixed point.</p> 185 */ 186 public final static int VT_DECIMAL = 14; 187 188 /** 189 * <p> 190 * 191 * [T] signed char.</p> 192 */ 193 public final static int VT_I1 = 16; 194 195 /** 196 * <p> 197 * 198 * [V][T][P][S] unsigned char.</p> 199 */ 200 public final static int VT_UI1 = 17; 201 202 /** 203 * <p> 204 * 205 * [T][P] unsigned short.</p> 206 */ 207 public final static int VT_UI2 = 18; 208 209 /** 210 * <p> 211 * 212 * [T][P] unsigned int.</p> 213 */ 214 public final static int VT_UI4 = 19; 215 216 /** 217 * <p> 218 * 219 * [T][P] signed 64-bit int.</p> 220 */ 221 public final static int VT_I8 = 20; 222 223 /** 224 * <p> 225 * 226 * [T][P] unsigned 64-bit int.</p> 227 */ 228 public final static int VT_UI8 = 21; 229 230 /** 231 * <p> 232 * 233 * [T] signed machine int.</p> 234 */ 235 public final static int VT_INT = 22; 236 237 /** 238 * <p> 239 * 240 * [T] unsigned machine int.</p> 241 */ 242 public final static int VT_UINT = 23; 243 244 /** 245 * <p> 246 * 247 * [T] C style void.</p> 248 */ 249 public final static int VT_VOID = 24; 250 251 /** 252 * <p> 253 * 254 * [T] Standard return type. <span style="background-color: #ffff00">How 255 * long is this? How is it to be interpreted?</span> </p> 256 */ 257 public final static int VT_HRESULT = 25; 258 259 /** 260 * <p> 261 * 262 * [T] pointer type. <span style="background-color: #ffff00">How long is 263 * this? How is it to be interpreted?</span> </p> 264 */ 265 public final static int VT_PTR = 26; 266 267 /** 268 * <p> 269 * 270 * [T] (use VT_ARRAY in VARIANT).</p> 271 */ 272 public final static int VT_SAFEARRAY = 27; 273 274 /** 275 * <p> 276 * 277 * [T] C style array. <span style="background-color: #ffff00">How long is 278 * this? How is it to be interpreted?</span> </p> 279 */ 280 public final static int VT_CARRAY = 28; 281 282 /** 283 * <p> 284 * 285 * [T] user defined type. <span style="background-color: #ffff00">How long 286 * is this? How is it to be interpreted?</span> </p> 287 */ 288 public final static int VT_USERDEFINED = 29; 289 290 /** 291 * <p> 292 * 293 * [T][P] null terminated string.</p> 294 */ 295 public final static int VT_LPSTR = 30; 296 297 /** 298 * <p> 299 * 300 * [T][P] wide (Unicode) null terminated string.</p> 301 */ 302 public final static int VT_LPWSTR = 31; 303 304 /** 305 * <p> 306 * 307 * [P] FILETIME. The FILETIME structure holds a date and time associated 308 * with a file. The structure identifies a 64-bit integer specifying the 309 * number of 100-nanosecond intervals which have passed since January 1, 310 * 1601. This 64-bit value is split into the two dwords stored in the 311 * structure.</p> 312 */ 313 public final static int VT_FILETIME = 64; 314 315 /** 316 * <p> 317 * 318 * [P] Length prefixed bytes.</p> 319 */ 320 public final static int VT_BLOB = 65; 321 322 /** 323 * <p> 324 * 325 * [P] Name of the stream follows.</p> 326 */ 327 public final static int VT_STREAM = 66; 328 329 /** 330 * <p> 331 * 332 * [P] Name of the storage follows.</p> 333 */ 334 public final static int VT_STORAGE = 67; 335 336 /** 337 * <p> 338 * 339 * [P] Stream contains an object. <span style="background-color: #ffff00"> 340 * How long is this? How is it to be interpreted?</span> </p> 341 */ 342 public final static int VT_STREAMED_OBJECT = 68; 343 344 /** 345 * <p> 346 * 347 * [P] Storage contains an object. <span style="background-color: #ffff00"> 348 * How long is this? How is it to be interpreted?</span> </p> 349 */ 350 public final static int VT_STORED_OBJECT = 69; 351 352 /** 353 * <p> 354 * 355 * [P] Blob contains an object. <span style="background-color: #ffff00">How 356 * long is this? How is it to be interpreted?</span> </p> 357 */ 358 public final static int VT_BLOB_OBJECT = 70; 359 360 /** 361 * <p> 362 * 363 * [P] Clipboard format. <span style="background-color: #ffff00">How long 364 * is this? How is it to be interpreted?</span> </p> 365 */ 366 public final static int VT_CF = 71; 367 368 /** 369 * <p> 370 * 371 * [P] A Class ID.</p> <p> 372 * 373 * It consists of a 32 bit unsigned integer indicating the size of the 374 * structure, a 32 bit signed integer indicating (Clipboard Format Tag) 375 * indicating the type of data that it contains, and then a byte array 376 * containing the data.</p> <p> 377 * 378 * The valid Clipboard Format Tags are: 379 * <ul> 380 * <li> {@link Thumbnail#CFTAG_WINDOWS}</li> 381 * <li> {@link Thumbnail#CFTAG_MACINTOSH}</li> 382 * <li> {@link Thumbnail#CFTAG_NODATA}</li> 383 * <li> {@link Thumbnail#CFTAG_FMTID}</li> 384 * </ul> 385 * </p> <p> 386 * 387 * <pre>typedef struct tagCLIPDATA { 388 * // cbSize is the size of the buffer pointed to 389 * // by pClipData, plus sizeof(ulClipFmt) 390 * ULONG cbSize; 391 * long ulClipFmt; 392 * BYTE* pClipData; 393 * } CLIPDATA;</pre> See <a href="msdn.microsoft.com/library/en-us/com/stgrstrc_0uwk.asp" 394 * target="_blank"> msdn.microsoft.com/library/en-us/com/stgrstrc_0uwk.asp 395 * </a> </p> 396 */ 397 public final static int VT_CLSID = 72; 398 399 /** 400 * <p> 401 * 402 * [P] simple counted array. <span style="background-color: #ffff00">How 403 * long is this? How is it to be interpreted?</span> </p> 404 */ 405 public final static int VT_VECTOR = 0x1000; 406 407 /** 408 * <p> 409 * 410 * [V] SAFEARRAY*. <span style="background-color: #ffff00">How long is 411 * this? How is it to be interpreted?</span> </p> 412 */ 413 public final static int VT_ARRAY = 0x2000; 414 415 /** 416 * <p> 417 * 418 * [V] void* for local use. <span style="background-color: #ffff00">How 419 * long is this? How is it to be interpreted?</span> </p> 420 */ 421 public final static int VT_BYREF = 0x4000; 422 423 /** 424 * Description of the Field 425 */ 426 public final static int VT_RESERVED = 0x8000; 427 428 /** 429 * Description of the Field 430 */ 431 public final static int VT_ILLEGAL = 0xFFFF; 432 433 /** 434 * Description of the Field 435 */ 436 public final static int VT_ILLEGALMASKED = 0xFFF; 437 438 /** 439 * Description of the Field 440 */ 441 public final static int VT_TYPEMASK = 0xFFF; 442 443 } 444