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