2002-05-11 14:47:24 +00:00
|
|
|
/*
|
|
|
|
|
* ====================================================================
|
|
|
|
|
* The Apache Software License, Version 1.1
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* Copyright (c) 2000 The Apache Software Foundation. All rights
|
|
|
|
|
* reserved.
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
|
* are met:
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* 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.
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* 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.
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* 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.
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* 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.
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* 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.
|
|
|
|
|
* ====================================================================
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* 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/>.
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
|
|
|
|
package org.apache.poi.hpsf;
|
|
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import org.apache.poi.hpsf.wellknown.*;
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* Convenience class representing a DocumentSummary Information stream in a
|
|
|
|
|
* Microsoft Office document.</p>
|
2002-05-03 07:29:09 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
*@author Rainer Klute (klute@rainer-klute.de)
|
|
|
|
|
*@author Drew Varner (Drew.Varner closeTo sc.edu)
|
|
|
|
|
*@created May 10, 2002
|
|
|
|
|
*@see SummaryInformation
|
|
|
|
|
*@version $Id: DocumentSummaryInformation.java,v 1.6 2002/05/03 07:29:09
|
|
|
|
|
* klute Exp $
|
|
|
|
|
*@since 2002-02-09
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public class DocumentSummaryInformation extends SpecialPropertySet {
|
2002-02-14 04:00:59 +00:00
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
* Creates a {@link DocumentSummaryInformation} from a given {@link
|
|
|
|
|
* PropertySet}.</p>
|
2002-02-14 04:00:59 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
*@param ps A property set which
|
|
|
|
|
* should be created from a document summary information stream.
|
|
|
|
|
*@exception UnexpectedPropertySetTypeException Description of the
|
|
|
|
|
* Exception
|
|
|
|
|
*@throws UnexpectedPropertySetTypeException if <var>ps</var> does not
|
|
|
|
|
* contain a document summary information stream.
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
|
|
|
|
public DocumentSummaryInformation(final PropertySet ps)
|
2002-05-11 14:47:24 +00:00
|
|
|
throws UnexpectedPropertySetTypeException {
|
2002-02-14 04:00:59 +00:00
|
|
|
super(ps);
|
2002-05-11 14:47:24 +00:00
|
|
|
if (!isDocumentSummaryInformation()) {
|
2002-02-14 04:00:59 +00:00
|
|
|
throw new UnexpectedPropertySetTypeException
|
2002-05-11 14:47:24 +00:00
|
|
|
("Not a " + getClass().getName());
|
|
|
|
|
}
|
2002-02-14 04:00:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's category (or <code>null</code>).</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The category value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public String getCategory() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return (String) getProperty(PropertyIDMap.PID_CATEGORY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's presentation format (or <code>null</code>).</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The presentationFormat value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public String getPresentationFormat() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return (String) getProperty(PropertyIDMap.PID_PRESFORMAT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's byte count or 0 if the {@link
|
|
|
|
|
* DocumentSummaryInformation} does not contain a byte count.</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The byteCount value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public int getByteCount() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return getPropertyIntValue(PropertyIDMap.PID_BYTECOUNT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's line count or 0 if the {@link
|
|
|
|
|
* DocumentSummaryInformation} does not contain a line count.</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The lineCount value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public int getLineCount() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return getPropertyIntValue(PropertyIDMap.PID_LINECOUNT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's par count or 0 if the {@link
|
|
|
|
|
* DocumentSummaryInformation} does not contain a par count.</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The parCount value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public int getParCount() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return getPropertyIntValue(PropertyIDMap.PID_PARCOUNT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's slide count or 0 if the {@link
|
|
|
|
|
* DocumentSummaryInformation} does not contain a slide count.</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The slideCount value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public int getSlideCount() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return getPropertyIntValue(PropertyIDMap.PID_SLIDECOUNT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's note count or 0 if the {@link
|
|
|
|
|
* DocumentSummaryInformation} does not contain a note count.</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The noteCount value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public int getNoteCount() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return getPropertyIntValue(PropertyIDMap.PID_NOTECOUNT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's hidden count or 0 if the {@link
|
|
|
|
|
* DocumentSummaryInformation} does not contain a hidden count.</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The hiddenCount value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public int getHiddenCount() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return getPropertyIntValue(PropertyIDMap.PID_HIDDENCOUNT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's mmclip count or 0 if the {@link
|
|
|
|
|
* DocumentSummaryInformation} does not contain a mmclip count.</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The mMClipCount value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public int getMMClipCount() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return getPropertyIntValue(PropertyIDMap.PID_MMCLIPCOUNT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns <code>true</code> when scaling of the thumbnail is desired,
|
|
|
|
|
* <code>false</code> if cropping is desired.</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The scale value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public boolean getScale() {
|
2002-05-03 07:29:09 +00:00
|
|
|
return getPropertyBooleanValue(PropertyIDMap.PID_SCALE);
|
2002-02-14 04:00:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's heading pair (or <code>null</code>) <strong>when
|
|
|
|
|
* this method is implemented. Please note that the return type is likely
|
|
|
|
|
* to change!</strong>
|
|
|
|
|
*
|
|
|
|
|
*@return The headingPair value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public byte[] getHeadingPair() {
|
|
|
|
|
if (true) {
|
2002-02-14 04:00:59 +00:00
|
|
|
throw new UnsupportedOperationException("FIXME");
|
2002-05-11 14:47:24 +00:00
|
|
|
}
|
2002-02-14 04:00:59 +00:00
|
|
|
return (byte[]) getProperty(PropertyIDMap.PID_HEADINGPAIR);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's doc parts (or <code>null</code>) <strong>when this
|
|
|
|
|
* method is implemented. Please note that the return type is likely to
|
|
|
|
|
* change!</strong>
|
|
|
|
|
*
|
|
|
|
|
*@return The docparts value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public byte[] getDocparts() {
|
|
|
|
|
if (true) {
|
2002-02-14 04:00:59 +00:00
|
|
|
throw new UnsupportedOperationException("FIXME");
|
2002-05-11 14:47:24 +00:00
|
|
|
}
|
2002-02-14 04:00:59 +00:00
|
|
|
return (byte[]) getProperty(PropertyIDMap.PID_DOCPARTS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's manager (or <code>null</code>).</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The manager value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public String getManager() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return (String) getProperty(PropertyIDMap.PID_MANAGER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns the stream's company (or <code>null</code>).</p>
|
|
|
|
|
*
|
|
|
|
|
*@return The company value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public String getCompany() {
|
2002-02-14 04:00:59 +00:00
|
|
|
return (String) getProperty(PropertyIDMap.PID_COMPANY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2002-05-11 14:47:24 +00:00
|
|
|
* <p>
|
|
|
|
|
*
|
|
|
|
|
* Returns <code>true</code> if the custom links are hampered by excessive
|
|
|
|
|
* noise, for all applications.</p> <p>
|
|
|
|
|
*
|
|
|
|
|
* <strong>FIXME:</strong> Explain this some more! I (Rainer) don't
|
|
|
|
|
* understand it.</p>
|
2002-05-03 07:29:09 +00:00
|
|
|
*
|
2002-05-11 14:47:24 +00:00
|
|
|
*@return The linksDirty value
|
2002-02-14 04:00:59 +00:00
|
|
|
*/
|
2002-05-11 14:47:24 +00:00
|
|
|
public boolean getLinksDirty() {
|
2002-05-03 07:29:09 +00:00
|
|
|
return getPropertyBooleanValue(PropertyIDMap.PID_LINKSDIRTY);
|
2002-02-14 04:00:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|