/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: XDocumentProperties.idl,v $ * $Revision: 1.5 $ * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. * ************************************************************************/ #ifndef __com_sun_star_document_XDocumentProperties_idl__ #define __com_sun_star_document_XDocumentProperties_idl__ #ifndef __com_sun_star_beans_PropertyValue_idl__ #include #endif #ifndef __com_sun_star_util_DateTime_idl__ #include #endif #ifndef __com_sun_star_lang_Locale_idl__ #include #endif #ifndef __com_sun_star_beans_NamedValue_idl__ #include #endif #ifndef __com_sun_star_embed_XStorage_idl__ #include #endif #ifndef __com_sun_star_io_IOException_idl__ #include #endif #ifndef __com_sun_star_io_WrongFormatException_idl__ #include #endif #ifndef __com_sun_star_beans_XPropertySet_idl__ #include #endif #ifndef __com_sun_star_beans_XPropertyContainer_idl__ #include #endif //============================================================================= module com { module sun { module star { module document { //============================================================================= /** provides document-specific information such as the author, creation date, and user-defined fields.

This interface manages access to document meta-data properties. Such properties may be set from the outside via the setter methods (e.g. when importing arbitrary document formats that support document properties), or imported from an ODF package via the methods loadFromStorage and loadFromMedium. The properties may also be stored via the methods storeToStorage and storeToMedium.

@since OOo 3.0 @see XDocumentPropertiesSupplier for getting access to an instance from a loaded document @see DocumentProperties for a service that implements this interface */ interface XDocumentProperties { //------------------------------------------------------------------------- /** contains the initial author of the document. */ [attribute] string Author; //------------------------------------------------------------------------- /** identifies which application was used to create or last modify the document.

The generating application will set this attribute when it creates a new document or it saves a document. When a document is loaded that itself contains such an attribute it will be preserved until the document is saved again.

*/ [attribute] string Generator; //------------------------------------------------------------------------- /** contains the date and time when the document was created. */ [attribute] com::sun::star::util::DateTime CreationDate; //------------------------------------------------------------------------- /** contains the title of the document. */ [attribute] string Title; //------------------------------------------------------------------------- /** contains the subject of the document. */ [attribute] string Subject; //------------------------------------------------------------------------- /** contains a multi-line comment describing the document.

Line delimiters can be UNIX, Macintosh or DOS style.

*/ [attribute] string Description; //------------------------------------------------------------------------- /** contains a list of keywords for the document. */ [attribute] sequence< string > Keywords; //------------------------------------------------------------------------- /** contains the default language of the document. */ [attribute] com::sun::star::lang::Locale Language; //------------------------------------------------------------------------- /** contains the name of the person who most recently stored the document. */ [attribute] string ModifiedBy; //------------------------------------------------------------------------- /** contains the date and time of the last time the document was stored.

If the document has never been stored, contains a default value.

*/ [attribute] com::sun::star::util::DateTime ModificationDate; //------------------------------------------------------------------------- /** contains the name of the person who most recently printed the document. */ [attribute] string PrintedBy; //------------------------------------------------------------------------- /** contains the date and time when the document was last printed.

If the document has never been printed, contains a default value.

*/ [attribute] com::sun::star::util::DateTime PrintDate; //------------------------------------------------------------------------- /** contains the name of the template from which the document was created.

The value is an empty string if the document was not created from a template or if it was detached from the template.

*/ [attribute] string TemplateName; //------------------------------------------------------------------------- /** contains the URL of the template from which the document was created.

The value is an empty string if the document was not created from a template or if it was detached from the template.

*/ [attribute] string TemplateURL; //------------------------------------------------------------------------- /** contains the date and time of when the document was created or updated from the template. */ [attribute] com::sun::star::util::DateTime TemplateDate; //------------------------------------------------------------------------- /** contains the URL to load automatically at a specified time after the document is loaded into a desktop frame.

An empty URL is valid and describes a case where the document shall be reloaded from its original loction after some time described by the attribute AutoloadSecs. An empty string together with an AutoloadSecs value of 0 describes a case where no autoload is specified.

@see AutoloadSecs */ [attribute] string AutoloadURL; //------------------------------------------------------------------------- /** contains the number of seconds after which a specified URL is to be loaded after the document is loaded into a desktop frame.

A value of 0 is valid and describes a redirection. A value of 0 together with an empty string as AutoloadURL describes a case where no autoload is specified.

@throws com::sun::star::lang::IllegalArgumentException if argument is negative @see AutoloadURL */ [attribute] long AutoloadSecs { set raises ( com::sun::star::lang::IllegalArgumentException ); }; //------------------------------------------------------------------------- /** contains the name of the default frame into which links should be loaded if no target is specified.

This applies to the autoload feature too, but to others as well.

*/ [attribute] string DefaultTarget; //------------------------------------------------------------------------- /** contains some statistics about the document.

The contained statistics may be specific to the type of the document.

*/ [attribute] sequence< com::sun::star::beans::NamedValue > DocumentStatistics; //------------------------------------------------------------------------- /** describes how often the document was edited and saved.

@throws com::sun::star::lang::IllegalArgumentException if argument is negative */ [attribute] short EditingCycles { set raises ( com::sun::star::lang::IllegalArgumentException ); }; //------------------------------------------------------------------------- /** contains the net time of editing the document (in seconds).

@throws com::sun::star::lang::IllegalArgumentException if argument is negative */ [attribute] long EditingDuration { set raises ( com::sun::star::lang::IllegalArgumentException ); }; //------------------------------------------------------------------------- /** resets all attributes that could identify the user.

Clears the document properties, such that it apperars the document has just been created. This is a convenience method which resets several attributes at once, as follows:

  • Author is set to the given parameter.
  • CreationDate is set to the current date and time.
  • ModifiedBy is cleared.
  • ModificationDate is cleared.
  • PrintedBy is cleared.
  • PrintDate is cleared.
  • EditingDuration is cleared.
  • EditingCycles is set to 1.
@param Author the new value of the Author attribute.

*/ void resetUserData( [in] string Author ); //------------------------------------------------------------------------- /** provides access to a container for user-defined properties.

The returned object also implements the interface com::sun::star::beans::XPropertySet.

@returns a container that provides access to user-defined properties */ com::sun::star::beans::XPropertyContainer getUserDefinedProperties(); //------------------------------------------------------------------------- /** loads document properties from an ODF package.

This method is used for accessing an ODF package that is owned by someone else, e.g., a document.

@param Storage the com::sun::star::embed::Storage representing the ODF package @param Medium the com::sun::star::document::MediaDescriptor representing the source

This is unfortunately necessary in order to properly resolve relative URLs in the meta-data.

@throws com::sun::star::lang::IllegalArgumentException if argument is @throws com::sun::star::io::WrongFormatException if parsing the XML document fails @throws com::sun::star::lang::WrappedTargetException if thrown when trying to open a stream in the given storage @throws com::sun::star::io::IOException if thrown when trying to open a stream in the given storage @throws com::sun::star::uno::Exception in various unspecified circumstances */ void loadFromStorage( [in] com::sun::star::embed::XStorage Storage, [in] sequence < com::sun::star::beans::PropertyValue > Medium ) raises( com::sun::star::lang::IllegalArgumentException, com::sun::star::io::WrongFormatException, com::sun::star::lang::WrappedTargetException, com::sun::star::io::IOException, com::sun::star::uno::Exception ); //------------------------------------------------------------------------- /** loads document properties from an ODF package or an OLE container.

For compatibility reasons this method also supports the import from former StarOffice binary file formats.

@param URL the URL of the source document

The URL could be part of the Medium parameter, but because often no other parameters except the URL are needed, providing it separately was added for convenience.

@param Medium the com::sun::star::document::MediaDescriptor representing the source @throws com::sun::star::io::WrongFormatException if parsing the XML document fails @throws com::sun::star::lang::WrappedTargetException if thrown when trying to open a stream in the given storage @throws com::sun::star::io::IOException if thrown when trying to open a stream in the given storage @throws com::sun::star::uno::Exception in various unspecified circumstances */ void loadFromMedium( [in] string URL, [in] sequence < com::sun::star::beans::PropertyValue > Medium ) raises( com::sun::star::io::WrongFormatException, com::sun::star::lang::WrappedTargetException, com::sun::star::io::IOException, com::sun::star::uno::Exception ); //------------------------------------------------------------------------- /** stores document properties to an ODF package.

This method is used for accessing an ODF package that is owned by someone else, e.g., a document. Note that the implementation may choose to store the meta-data in either OOo or ODF format, depending on the MediaType property of the given Storage argument.

@param Storage the com::sun::star::embed::Storage representing the ODF package @param Medium the com::sun::star::document::MediaDescriptor representing the source

This is unfortunately necessary in order to properly resolve relative URLs in the meta-data.

@throws com::sun::star::lang::IllegalArgumentException if argument is @throws com::sun::star::lang::WrappedTargetException if thrown when trying to open a stream in the given storage @throws com::sun::star::io::IOException if thrown when writing to the storage @throws com::sun::star::uno::Exception in various unspecified circumstances */ void storeToStorage( [in] com::sun::star::embed::XStorage Storage, [in] sequence < com::sun::star::beans::PropertyValue > Medium ) raises( com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::WrappedTargetException, com::sun::star::io::IOException, com::sun::star::uno::Exception ); //------------------------------------------------------------------------- /** stores document properties to an ODF package or an OLE container.

For compatibility reasons this method also supports the export to former StarOffice binary file formats.

@param URL the URL of the target document

The URL could be part of the Medium parameter, but because often no other parameters except the URL are needed, providing it separately was added for convenience.

@param Medium the com::sun::star::document::MediaDescriptor representing the target @throws com::sun::star::lang::WrappedTargetException if thrown when trying to open a stream in the given storage @throws com::sun::star::io::IOException if thrown when writing to the storage @throws com::sun::star::uno::Exception in various unspecified circumstances */ void storeToMedium( [in] string URL, [in] sequence < com::sun::star::beans::PropertyValue > Medium ) raises( com::sun::star::lang::WrappedTargetException, com::sun::star::io::IOException, com::sun::star::uno::Exception ); }; //============================================================================= }; }; }; }; #endif