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