]> source.dussan.org Git - poi.git/commitdiff
Added Drew's thumbnail enhancements.
authorRainer Klute <klute@apache.org>
Wed, 1 May 2002 09:31:52 +0000 (09:31 +0000)
committerRainer Klute <klute@apache.org>
Wed, 1 May 2002 09:31:52 +0000 (09:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352578 13f79535-47bb-0310-9956-ffa450edef68

18 files changed:
src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java
src/java/org/apache/poi/hpsf/HPSFException.java
src/java/org/apache/poi/hpsf/HPSFRuntimeException.java
src/java/org/apache/poi/hpsf/MarkUnsupportedException.java
src/java/org/apache/poi/hpsf/NoPropertySetStreamException.java
src/java/org/apache/poi/hpsf/NoSingleSectionException.java
src/java/org/apache/poi/hpsf/Property.java
src/java/org/apache/poi/hpsf/PropertySet.java
src/java/org/apache/poi/hpsf/PropertySetFactory.java
src/java/org/apache/poi/hpsf/Section.java
src/java/org/apache/poi/hpsf/SpecialPropertySet.java
src/java/org/apache/poi/hpsf/SummaryInformation.java
src/java/org/apache/poi/hpsf/Thumbnail.java [new file with mode: 0644]
src/java/org/apache/poi/hpsf/UnexpectedPropertySetTypeException.java
src/java/org/apache/poi/hpsf/Util.java
src/java/org/apache/poi/hpsf/Variant.java
src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java
src/java/org/apache/poi/hpsf/wellknown/SectionIDMap.java

index 73d185340bcd297819b8726890b51f0ceea212d8..8c3576ac791a30003f50f0569e377221261d50f3 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index 7461fef9ead74d50ffc0164f2424337d130a1abf..2856579ac21b565bf5a087092fb28adeda395f0d 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index c84b2e50f3120f2ab8296ab7fdfb44162341ba95..12bce3be02bc7137c34125d195b41f65f8d52c7c 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index 7dc153e7d3692c47dfef4a70ea1de170a6de6a9a..9695053d0008f7f306f45a1d1412d8a4dbcbe22e 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index e52b3068c8ef6ea1840bd3d0cc810aa2725d5565..c1770897e1196b33a287c30e86896cbfe86cc618 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index d8c37a8526d82a212a4d556bb7f4fbf9badb934b..7e97df7b4c2cf7879309fec2d9b929661fbe72be 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index 20e149fd46b4fbb778df400d775d39083885fe10..28265580285bf1df1a32803273cbfbd5ee4f7686 100644 (file)
@@ -89,6 +89,7 @@ import org.apache.poi.hpsf.littleendian.*;
  * @see Variant
  *
  * @author Rainer Klute (klute@rainer-klute.de)
+ * @author Drew Varner (Drew.Varner InAndAround sc.edu)
  * @version $Id$
  * @since 2002-02-09
  */
@@ -204,6 +205,23 @@ public class Property
                 value = new String(src, first, last - first + 1);
                 break;
             }
+            case Variant.VT_CF:
+            {
+                // the first four bytes in src, from
+                // src[offset] to src[offset + 3] contain
+                // the DWord for VT_CF, so skip it, we don't
+                // need it
+
+                // truncate the length of the return array by
+                // a DWord length (4 bytes)
+                length = length - DWord.LENGTH;
+
+                final byte[] v = new byte[length];
+                for (int i = 0; i < length; i++)
+                    v[i] = src[offset + i + DWord.LENGTH];
+                value = v;
+                break;
+            }
             default:
             {
                 final byte[] v = new byte[length];
index ad1a0cd0001601f6d5a6e1ee6e2f7cc67e15300c..b328993298e7c0d979c9f0d6ecbc9eae65316565 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
@@ -385,7 +377,7 @@ public class PropertySet
         offset += ClassID.LENGTH;
         sectionCount = new DWord(src, offset).intValue();
         offset += DWord.LENGTH;
-        
+
         /* Read the sections, which are following the header. They
          * start with an array of section descriptions. Each one
          * consists of a format ID telling what the section contains
index cc7a3e8bf9074312537471d4a8b4683d84f27841..10da676f6d94c5af3a250b7a04a9effd10410fbd 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index 39c4b11dab7c1c0199992cb81f48f95fc2fea505..cc0c68230ae911d7cac6b73520f0f7c1db539b61 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index 8044a1170c90ee7a0332d9b8a683bcfa6824b991..0d92e6fdba8d1c05d4ed07ef0954ce2ec376cd7f 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index 327046a6b399df186eb2a1350720652221b683fc..78402fbe51eae12897d3f808026dc7466ae7a74d 100644 (file)
@@ -276,8 +276,6 @@ public class SummaryInformation extends SpecialPropertySet
      */
     public byte[] getThumbnail()
     {
-        if (true)
-            throw new UnsupportedOperationException("FIXME");
         return (byte[]) getProperty(PropertyIDMap.PID_THUMBNAIL);
     }
 
diff --git a/src/java/org/apache/poi/hpsf/Thumbnail.java b/src/java/org/apache/poi/hpsf/Thumbnail.java
new file mode 100644 (file)
index 0000000..006d7d1
--- /dev/null
@@ -0,0 +1,369 @@
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+package org.apache.poi.hpsf;
+
+import org.apache.poi.hpsf.littleendian.DWord;
+/**
+ * <p>Class to manipulate  data in the Clipboard Variant
+ * ({@link Variant#VT_CF VT_CF}) format.</p>
+ *
+ * @see SummaryInformation#getThumbnail()
+ *
+ * @author Drew Varner (Drew.Varner inOrAround sc.edu)
+ * @version $Id$
+ * @since 2002-04-29
+ */
+public class Thumbnail
+{
+
+
+
+    /**
+     * <p>Offset in bytes where the Clipboard Format Tag
+     * starts in the <code>byte[]</code> returned by
+     * {@link SummaryInformation#getThumbnail()}</p>
+     */
+    public static int OFFSET_CFTAG = 4;
+
+
+
+    /**
+     * <p>Offset in bytes where the Clipboard Format
+     * starts in the <code>byte[]</code> returned by
+     * {@link SummaryInformation#getThumbnail()}</p>
+     *
+     * <p>This is only valid if the Clipboard Format Tag
+     * is {@link #CFTAG_WINDOWS} </p>
+     */
+    public static int OFFSET_CF = 8;
+
+
+
+    /**
+     * <p>Offset in bytes where the Windows Metafile
+     * (WMF) image data starts in the <code>byte[]</code>
+     * returned by {@link SummaryInformation#getThumbnail()}</p>
+     *
+     * <p>There is only WMF data at this point in the
+     * <code>byte[]</code> if the Clipboard Format Tag is
+     * {@link #CFTAG_WINDOWS} and the Clipboard Format is
+     * {@link #CF_METAFILEPICT}.</p>
+     *
+     * <p>Note: The <code>byte[]</code> that starts at
+     * <code>OFFSET_WMFDATA</code> and ends at
+     * <code>getThumbnail().length - 1</code> forms a
+     * complete WMF image. It can be saved to disk with a
+     * <code>.wmf</code> file type and read using a WMF-capable
+     * image viewer.</p>
+     */
+    public static int OFFSET_WMFDATA = 20;
+
+
+
+    /**
+     * <p>Clipboard Format Tag - Windows clipboard format</p>
+     * <p>A <code>DWORD</code> indicating a built-in Windows clipboard
+     * format value</p>
+     *
+     * <p>See:
+     * <a href="http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp"
+     * target="_blank">
+     * http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp</a>
+     */
+    public static int CFTAG_WINDOWS = -1;
+
+
+
+    /**
+     * <p>Clipboard Format Tag - Macintosh clipboard format</p>
+     * <p>A <code>DWORD</code> indicating a Macintosh clipboard format value</p>
+     *
+     * <p>See:
+     * <a href="http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp"
+     * target="_blank">
+     * http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp</a>
+     */
+    public static int CFTAG_MACINTOSH = -2;
+
+
+
+    /**
+     * <p>Clipboard Format Tag - Format ID</p>
+     * <p>A GUID containing a format identifier (FMTID). This is rarely used.</p>
+     *
+     * <p>See:
+     * <a href="http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp"
+     * target="_blank">
+     * http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp</a>
+     */
+    public static int CFTAG_FMTID = -3;
+
+
+
+    /**
+     * <p>Clipboard Format Tag - No Data</p>
+     * <p>a <code>DWORD</code> indicating No data. This is rarely used.</p>
+     *
+     * <p>See:
+     * <a href="http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp"
+     * target="_blank">
+     * http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp</a>
+     */
+    public static int CFTAG_NODATA = 0;
+
+
+
+    /**
+     * <p>Clipboard Format - Windows metafile format.
+     * This is the recommended way to store thumbnails
+     * in Property Streams.</p>
+     * <p> <strong>Note:</strong> this is not the same
+     * format used in regular WMF images. The clipboard
+     * version of this format has an extra clipboard-specific
+     * header</p>
+     */
+    public static int CF_METAFILEPICT = 3;
+
+
+
+    /**
+     * <p>Clipboard Format - Device Independent Bitmap</p>
+     */
+    public static int CF_DIB = 8;
+
+
+
+    /**
+     * <p>Clipboard Format - Enhanced Windows metafile format</p>
+     */
+    public static int CF_ENHMETAFILE = 14;
+
+
+
+    /**
+     * <p>Clipboard Format - Bitmap</p>
+     * <p>Obsolete, See:
+     * <a href="msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp
+     *    target="_blank">
+     * msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp
+     * </a>
+     * </p>
+     */
+    public static int CF_BITMAP = 2;
+
+
+
+    /**
+     * <p> A <code>byte[]</code> to hold a thumbnail image in
+     * ({@link Variant#VT_CF VT_CF}) format. </p>
+     */
+    private byte[] thumbnailData = null;
+
+
+
+    /**
+     * <p>Default Constructor. If you use then one you'll have to add
+     * the thumbnail <code>byte[]</code> from {@link
+     * SummaryInformation#getThumbnail()} to do any useful
+     * manipulations, otherwise you'll get a
+     * <code>NullPointerException</code>.</p>
+     */
+    public Thumbnail()
+    {
+        super();
+    }
+
+
+
+    /**
+     * <p></p>
+     */
+    public Thumbnail(byte[] thumbnailData)
+    {
+        this.thumbnailData = thumbnailData;
+    }
+
+
+
+    /**
+     * <p>Returns the thumbnail as a <code>byte[]</code> in
+     * {@link Variant#VT_CF VT_CF} format.</p>
+     *
+     * @see SummaryInformation#getThumbnail()
+     */
+    public byte[] getThumbnail() {
+        return thumbnailData;
+    }
+
+
+
+    /**
+     * <p>Sets the Thumbnail's underlying <code>byte[]</code> in
+     * {@link Variant#VT_CF VT_CF} format.</p>
+     *
+     * @see SummaryInformation#getThumbnail()
+     */
+    public void setThumbnail(byte[] thumbnail) {
+        this.thumbnailData = thumbnail;
+    }
+
+
+
+    /**
+     * <p>Returns an <code>int</code> representing the Clipboard
+     * Format Tag</p>
+     * <p>Possible return values are:
+     * <ul>
+     *   <li>{@link #CFTAG_WINDOWS CFTAG_WINDOWS}</li>
+     *   <li>{@link #CFTAG_MACINTOSH CFTAG_MACINTOSH}</li>
+     *   <li>{@link #CFTAG_FMTID CFTAG_FMTID}</li>
+     *   <li>{@link #CFTAG_NODATA CFTAG_NODATA}</li>
+     * </ul>
+     * </p>
+     *
+     * @return a flag indicating the Clipboard Format Tag
+     */
+    public int getClipboardFormatTag()
+    {
+        DWord clipboardFormatTag = new DWord(getThumbnail(),OFFSET_CFTAG);
+        return clipboardFormatTag.intValue();
+    }
+
+
+
+    /**
+     * <p>Returns an <code>int</code> representing the Clipboard
+     * Format</p>
+     *
+     * <p>Will throw an exceptionif the Thumbnail's Clipboard
+     * Format Tag is not
+     * {@link Thumbnail#CFTAG_WINDOWS CFTAG_WINDOWS}
+     * </p>
+     *
+     * <p>Possible return values are:
+     * <ul>
+     *   <li>{@link #CF_METAFILEPICT CF_METAFILEPICT}</li>
+     *   <li>{@link #CF_DIB CF_DIB}</li>
+     *   <li>{@link #CF_ENHMETAFILE CF_ENHMETAFILE}</li>
+     *   <li>{@link #CF_BITMAP CF_BITMAP}</li>
+     * </ul>
+     * </p>
+     *
+     * @return a flag indicating the Clipboard Format
+     *
+     * @throws HPSFException if the Thumbnail isn't CFTAG_WINDOWS
+     *
+     */
+    public int getClipboardFormat() throws HPSFException
+    {
+        if ( !(getClipboardFormatTag() == CFTAG_WINDOWS) )
+        {
+            throw new HPSFException("Clipboard Format Tag of Thumbnail must " +
+                                    "be CFTAG_WINDOWS.");
+        }
+
+        DWord clipboardFormat = new DWord(getThumbnail(),OFFSET_CF);
+        return clipboardFormat.intValue();
+    }
+
+
+
+    /**
+     * <p>Returns the Thumbnail as a <code>byte[]</code>
+     * of WMF data if the Thumbnail's Clipboard Format Tag
+     * is {@link #CFTAG_WINDOWS CFTAG_WINDOWS}
+     * and its Clipboard Format is
+     * {@link #CF_METAFILEPICT CF_METAFILEPICT}</p>
+     *
+     * <p>This <code>byte[]</code> is in the traditional WMF file,
+     * not the clipboard-specific version with special headers.</p>
+     *
+     * <p> See
+     * <a href="http://www.wvware.com/caolan/ora-wmf.html"
+     *    target="_blank">http://www.wvware.com/caolan/ora-wmf.html</a>
+     * for more information on the WMF image format.</p>
+     *
+     * @throws HPSFException if the Thumbnail isn't CFTAG_WINDOWS
+     *                       and CF_METAFILEPICT
+     *
+     * @return a WMF image of the Thumbnail
+     */
+    public byte[] getThumbnailAsWMF() throws HPSFException
+    {
+        if ( !(getClipboardFormatTag() == CFTAG_WINDOWS) )
+        {
+            throw new HPSFException("Clipboard Format Tag of Thumbnail must " +
+                                    "be CFTAG_WINDOWS.");
+        }
+        if ( !(getClipboardFormat() == CF_METAFILEPICT) )
+        {
+            throw new HPSFException("Clipboard Format of Thumbnail must " +
+                                    "be CF_METAFILEPICT.");
+        }
+        else
+        {
+            byte[] thumbnail = getThumbnail();
+            int wmfImageLength = thumbnail.length - OFFSET_WMFDATA;
+            byte[] wmfImage = new byte[wmfImageLength];
+            System.arraycopy(thumbnail,
+                             OFFSET_WMFDATA,
+                             wmfImage,
+                             0,
+                             wmfImageLength);
+            return wmfImage;
+        }
+    }
+
+}
index 1c297fb4d0a542118acae7e3db69e91dc995a6ae..d9da7d8f423991c898411e5ffdca137a798f492d 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index 9bcdba5d73ee5d021470b441b54745390f51ac98..7ea6911cff87ea52b986f3b102ce9983f027aa50 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
index be17579fe18e8330df766e64649f47c12dd8d484..29de83917d1aa635f352ed6a8f22ce72100477b0 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf;
@@ -307,9 +299,34 @@ public class Variant
     public final static int VT_CF = 71;
 
     /**
-     * <p>[P] A Class ID. <span style="background-color:
-     * #ffff00">How long is this? How is it to be
-     * interpreted?</span></p>
+     * <p>[P] A Class ID.</p>
+     * <p>It consists of a 32 bit unsigned integer indicating the size
+     * of the structure, a 32 bit signed integer indicating (Clipboard
+     * Format Tag) indicating the type of data that it contains, and
+     * then a byte array containing the data.</p>
+     *
+     * <p>The valid Clipboard Format Tags are:
+     * <ul>
+     *     <li>{@link Thumbnail#CFTAG_WINDOWS}</li>
+     *     <li>{@link Thumbnail#CFTAG_MACINTOSH}</li>
+     *     <li>{@link Thumbnail#CFTAG_NODATA}</li>
+     *     <li>{@link Thumbnail#CFTAG_FMTID}</li>
+     * </ul></p>
+     *
+     * <p>
+     * <pre>typedef struct  tagCLIPDATA {
+     * // cbSize is the size of the buffer pointed to
+     * // by pClipData, plus sizeof(ulClipFmt)
+     * ULONG              cbSize;
+     * long               ulClipFmt;
+     * BYTE*              pClipData;
+     * } CLIPDATA;</pre>
+     * See
+     * <a href="msdn.microsoft.com/library/en-us/com/stgrstrc_0uwk.asp"
+     *    target="_blank">
+     *   msdn.microsoft.com/library/en-us/com/stgrstrc_0uwk.asp
+     * </a>
+     * </p>
      */
     public final static int VT_CLSID = 72;
 
index 74ebbbe85945ba2f2647ff307820557474bad336..4c0ca189341537bc3d8c1d1dc46065bf993b842c 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf.wellknown;
index d42df09bf3cd54e8d825e6e1db8cc4a57059174f..ae90f9071d238002fa9b2d8f08ca1009404da7b1 100644 (file)
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
-*
-* Portions of this software are based upon public domain software
-* originally written at the National Center for Supercomputing Applications,
-* University of Illinois, Urbana-Champaign.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
  */
 
 package org.apache.poi.hpsf.wellknown;