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>The <em>Variant</em> types as defined by Microsoft's COM. I
59    * found this information in <a
60    * href="http://www.marin.clara.net/COM/variant_type_definitions.htm">
61    * http://www.marin.clara.net/COM/variant_type_definitions.htm</a>.</p>
62    *
63    * <p>In the variant types descriptions the following shortcuts are
64    * used: <strong> [V]</strong> - may appear in a VARIANT,
65    * <strong>[T]</strong> - may appear in a TYPEDESC,
66    * <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    * @version $Id: Variant.java,v 1.6 2003/02/01 13:28:28 klute Exp $
71    * @since 2002-02-09
72    */
73   public class Variant
74   {
75   
76       /**
77        * <p>[V][P] Nothing.</p>
78        */
79       public final static int VT_EMPTY = 0;
80   
81       /**
82        * <p>[V][P] SQL style Null.</p>
83        */
84       public final static int VT_NULL = 1;
85   
86       /**
87        * <p>[V][T][P][S] 2 byte signed int.</p>
88        */
89       public final static int VT_I2 = 2;
90   
91       /**
92        * <p>[V][T][P][S] 4 byte signed int.</p>
93        */
94       public final static int VT_I4 = 3;
95   
96       /**
97        * <p>[V][T][P][S] 4 byte real.</p>
98        */
99       public final static int VT_R4 = 4;
100  
101      /**
102       * <p>[V][T][P][S] 8 byte real.</p>
103       */
104      public final static int VT_R8 = 5;
105  
106      /**
107       * <p>[V][T][P][S] currency. <span style="background-color:
108       * #ffff00">How long is this? How is it to be
109       * interpreted?</span></p>
110       */
111      public final static int VT_CY = 6;
112  
113      /**
114       * <p>[V][T][P][S] date. <span style="background-color:
115       * #ffff00">How long is this? How is it to be
116       * interpreted?</span></p>
117       */
118      public final static int VT_DATE = 7;
119  
120      /**
121       * <p>[V][T][P][S] OLE Automation string. <span
122       * style="background-color: #ffff00">How long is this? How is it
123       * to be interpreted?</span></p>
124       */
125      public final static int VT_BSTR = 8;
126  
127      /**
128       * <p>[V][T][P][S] IDispatch *. <span style="background-color:
129       * #ffff00">How long is this? How is it to be
130       * interpreted?</span></p>
131       */
132      public final static int VT_DISPATCH = 9;
133  
134      /**
135       * <p>[V][T][S] SCODE. <span style="background-color: #ffff00">How
136       * long is this? How is it to be interpreted?</span></p>
137       */
138      public final static int VT_ERROR = 10;
139  
140      /**
141       * <p>[V][T][P][S] True=-1, False=0.</p>
142       */
143      public final static int VT_BOOL = 11;
144  
145      /**
146       * <p>[V][T][P][S] VARIANT *. <span style="background-color:
147       * #ffff00">How long is this? How is it to be
148       * interpreted?</span></p>
149       */
150      public final static int VT_VARIANT = 12;
151  
152      /**
153       * <p>[V][T][S] IUnknown *. <span style="background-color:
154       * #ffff00">How long is this? How is it to be
155       * interpreted?</span></p>
156       */
157      public final static int VT_UNKNOWN = 13;
158  
159      /**
160       * <p>[V][T][S] 16 byte fixed point.</p>
161       */
162      public final static int VT_DECIMAL = 14;
163  
164      /**
165       * <p>[T] signed char.</p>
166       */
167      public final static int VT_I1 = 16;
168  
169      /**
170       * <p>[V][T][P][S] unsigned char.</p>
171       */
172      public final static int VT_UI1 = 17;
173  
174      /**
175       * <p>[T][P] unsigned short.</p>
176       */
177      public final static int VT_UI2 = 18;
178  
179      /**
180       * <p>[T][P] unsigned int.</p>
181       */
182      public final static int VT_UI4 = 19;
183  
184      /**
185       * <p>[T][P] signed 64-bit int.</p>
186       */
187      public final static int VT_I8 = 20;
188  
189      /**
190       * <p>[T][P] unsigned 64-bit int.</p>
191       */
192      public final static int VT_UI8 = 21;
193  
194      /**
195       * <p>[T] signed machine int.</p>
196       */
197      public final static int VT_INT = 22;
198  
199      /**
200       * <p>[T] unsigned machine int.</p>
201       */
202      public final static int VT_UINT = 23;
203  
204      /**
205       * <p>[T] C style void.</p>
206       */
207      public final static int VT_VOID = 24;
208  
209      /**
210       * <p>[T] Standard return type. <span style="background-color:
211       * #ffff00">How long is this? How is it to be
212       * interpreted?</span></p>
213       */
214      public final static int VT_HRESULT = 25;
215  
216      /**
217       * <p>[T] pointer type. <span style="background-color:
218       * #ffff00">How long is this? How is it to be
219       * interpreted?</span></p>
220       */
221      public final static int VT_PTR = 26;
222  
223      /**
224       * <p>[T] (use VT_ARRAY in VARIANT).</p>
225       */
226      public final static int VT_SAFEARRAY = 27;
227  
228      /**
229       * <p>[T] C style array. <span style="background-color:
230       * #ffff00">How long is this? How is it to be
231       * interpreted?</span></p>
232       */
233      public final static int VT_CARRAY = 28;
234  
235      /**
236       * <p>[T] user defined type. <span style="background-color:
237       * #ffff00">How long is this? How is it to be
238       * interpreted?</span></p>
239       */
240      public final static int VT_USERDEFINED = 29;
241  
242      /**
243       * <p>[T][P] null terminated string.</p>
244       */
245      public final static int VT_LPSTR = 30;
246  
247      /**
248       * <p>[T][P] wide (Unicode) null terminated string.</p>
249       */
250      public final static int VT_LPWSTR = 31;
251  
252      /**
253       * <p>[P] FILETIME. The FILETIME structure holds a date and time
254       * associated with a file. The structure identifies a 64-bit
255       * integer specifying the number of 100-nanosecond intervals which
256       * have passed since January 1, 1601. This 64-bit value is split
257       * into the two dwords stored in the structure.</p>
258       */
259      public final static int VT_FILETIME = 64;
260  
261      /**
262       * <p>[P] Length prefixed bytes.</p>
263       */
264      public final static int VT_BLOB = 65;
265  
266      /**
267       * <p>[P] Name of the stream follows.</p>
268       */
269      public final static int VT_STREAM = 66;
270  
271      /**
272       * <p>[P] Name of the storage follows.</p>
273       */
274      public final static int VT_STORAGE = 67;
275  
276      /**
277       * <p>[P] Stream contains an object. <span
278       * style="background-color: #ffff00"> How long is this? How is it
279       * to be interpreted?</span></p>
280       */
281      public final static int VT_STREAMED_OBJECT = 68;
282  
283      /**
284       * <p>[P] Storage contains an object. <span
285       * style="background-color: #ffff00"> How long is this? How is it
286       * to be interpreted?</span></p>
287       */
288      public final static int VT_STORED_OBJECT = 69;
289  
290      /**
291       * <p>[P] Blob contains an object. <span style="background-color:
292       * #ffff00">How long is this? How is it to be
293       * interpreted?</span></p>
294       */
295      public final static int VT_BLOB_OBJECT = 70;
296  
297      /**
298       * <p>[P] Clipboard format. <span style="background-color:
299       * #ffff00">How long is this? How is it to be
300       * interpreted?</span></p>
301       */
302      public final static int VT_CF = 71;
303  
304      /**
305       * <p>[P] A Class ID.</p>
306       *
307       * <p>It consists of a 32 bit unsigned integer indicating the size
308       * of the structure, a 32 bit signed integer indicating (Clipboard
309       * Format Tag) indicating the type of data that it contains, and
310       * then a byte array containing the data.</p>
311       *
312       * <p>The valid Clipboard Format Tags are:</p>
313       *
314       * <ul>
315       *  <li>{@link Thumbnail#CFTAG_WINDOWS}</li>
316       *  <li>{@link Thumbnail#CFTAG_MACINTOSH}</li>
317       *  <li>{@link Thumbnail#CFTAG_NODATA}</li>
318       *  <li>{@link Thumbnail#CFTAG_FMTID}</li>
319       * </ul>
320       *
321       * <pre>typedef struct tagCLIPDATA {
322       * // cbSize is the size of the buffer pointed to
323       * // by pClipData, plus sizeof(ulClipFmt)
324       * ULONG              cbSize;
325       * long               ulClipFmt;
326       * BYTE*              pClipData;
327       * } CLIPDATA;</pre>
328       *
329       * <p>See <a
330       * href="msdn.microsoft.com/library/en-us/com/stgrstrc_0uwk.asp"
331       * target="_blank">
332       * msdn.microsoft.com/library/en-us/com/stgrstrc_0uwk.asp</a>.</p>
333       */
334      public final static int VT_CLSID = 72;
335  
336      /**
337       * <p>[P] simple counted array. <span style="background-color:
338       * #ffff00">How long is this? How is it to be
339       * interpreted?</span></p>
340       */
341      public final static int VT_VECTOR = 0x1000;
342  
343      /**
344       * <p>[V] SAFEARRAY*. <span style="background-color: #ffff00">How
345       * long is this? How is it to be interpreted?</span></p>
346       */
347      public final static int VT_ARRAY = 0x2000;
348  
349      /**
350       * <p>[V] void* for local use. <span style="background-color:
351       * #ffff00">How long is this? How is it to be
352       * interpreted?</span></p>
353       */
354      public final static int VT_BYREF = 0x4000;
355  
356      public final static int VT_RESERVED = 0x8000;
357  
358      public final static int VT_ILLEGAL = 0xFFFF;
359  
360      public final static int VT_ILLEGALMASKED = 0xFFF;
361  
362      public final static int VT_TYPEMASK = 0xFFF;
363  
364  }
365