LibreOffice
LibreOffice 7.4 SDK API Reference
Public Types | Public Member Functions | Public Attributes | List of all members
XDocumentProperties Interface Referencepublished

provides document-specific information such as the author, creation date, and user-defined fields. More...

import"XDocumentProperties.idl";

Inheritance diagram for XDocumentProperties:
DocumentProperties

Public Types

typedef sequence< string > Keywords
 contains a list of keywords for the document. More...
 
typedef sequence< com::sun::star::beans::NamedValueDocumentStatistics
 contains some statistics about the document. More...
 

Public Member Functions

void resetUserData ([in] string Author)
 resets all attributes that could identify the user. More...
 
com::sun::star::beans::XPropertyContainer getUserDefinedProperties ()
 provides access to a container for user-defined properties. More...
 
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 )
 loads document properties from an ODF package. More...
 
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 )
 loads document properties from an ODF package or an OLE container. More...
 
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 )
 stores document properties to an ODF package. More...
 
void storeToMedium ([in] string URL, [in] sequence< com::sun::star::beans::PropertyValue > Medium) raises ( com::sun::star::lang::WrappedTargetException, com::sun::star::io::IOException )
 stores document properties to an ODF package or an OLE container. More...
 

Public Attributes

string Author
 contains the initial author of the document. More...
 
string Generator
 identifies which application was used to create or last modify the document. More...
 
com::sun::star::util::DateTime CreationDate
 contains the date and time when the document was created. More...
 
string Title
 contains the title of the document. More...
 
string Subject
 contains the subject of the document. More...
 
string Description
 contains a multi-line comment describing the document. More...
 
com::sun::star::lang::Locale Language
 contains the default language of the document. More...
 
string ModifiedBy
 contains the name of the person who most recently stored the document. More...
 
com::sun::star::util::DateTime ModificationDate
 contains the date and time of the last time the document was stored. More...
 
string PrintedBy
 contains the name of the person who most recently printed the document. More...
 
com::sun::star::util::DateTime PrintDate
 contains the date and time when the document was last printed. More...
 
string TemplateName
 contains the name of the template from which the document was created. More...
 
string TemplateURL
 contains the URL of the template from which the document was created. More...
 
com::sun::star::util::DateTime TemplateDate
 contains the date and time of when the document was created or updated from the template. More...
 
string AutoloadURL
 contains the URL to load automatically at a specified time after the document is loaded into a desktop frame. More...
 
long AutoloadSecs { set raises(com::sun::star::lang::IllegalArgumentException); }
 contains the number of seconds after which a specified URL is to be loaded after the document is loaded into a desktop frame. More...
 
string DefaultTarget
 contains the name of the default frame into which links should be loaded if no target is specified. More...
 
short EditingCycles { set raises(com::sun::star::lang::IllegalArgumentException); }
 describes how often the document was edited and saved. More...
 
long EditingDuration { set raises(com::sun::star::lang::IllegalArgumentException); }
 contains the net time of editing the document (in seconds). More...
 

Detailed Description

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 also
XDocumentPropertiesSupplier for getting access to an instance from a loaded document
DocumentProperties for a service that implements this interface

Member Typedef Documentation

◆ DocumentStatistics

contains some statistics about the document.

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

◆ Keywords

sequence< string > Keywords
attribute

contains a list of keywords for the document.

Member Function Documentation

◆ getUserDefinedProperties()

com::sun::star::beans::XPropertyContainer getUserDefinedProperties ( )

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

◆ loadFromMedium()

loads document properties from an ODF package or an OLE container.

Parameters
URLthe 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.

Parameters
Mediumthe com::sun::star::document::MediaDescriptor representing the source
Exceptions
com::sun::star::io::WrongFormatExceptionif parsing the XML document fails
com::sun::star::lang::WrappedTargetExceptionif thrown when trying to open a stream in the given storage
com::sun::star::io::IOExceptionif thrown when trying to open a stream in the given storage

◆ loadFromStorage()

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.

Parameters
Storagethe com::sun::star::embed::Storage representing the ODF package
Mediumthe com::sun::star::document::MediaDescriptor representing the source

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

Exceptions
com::sun::star::lang::IllegalArgumentExceptionif argument is NULL
com::sun::star::io::WrongFormatExceptionif parsing the XML document fails
com::sun::star::lang::WrappedTargetExceptionif thrown when trying to open a stream in the given storage
com::sun::star::io::IOExceptionif thrown when trying to open a stream in the given storage

◆ resetUserData()

void resetUserData ( [in] string  Author)

resets all attributes that could identify the user.

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

Parameters
Authorthe new value of the Author attribute.

◆ storeToMedium()

void storeToMedium ( [in] string  URL,
[in] sequence< com::sun::star::beans::PropertyValue Medium 
)
raises ( com::sun::star::lang::WrappedTargetException,
com::sun::star::io::IOException
)

stores document properties to an ODF package or an OLE container.

Parameters
URLthe 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.

Parameters
Mediumthe com::sun::star::document::MediaDescriptor representing the target
Exceptions
com::sun::star::lang::WrappedTargetExceptionif thrown when trying to open a stream in the given storage
com::sun::star::io::IOExceptionif thrown when writing to the storage

◆ storeToStorage()

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.

Parameters
Storagethe com::sun::star::embed::Storage representing the ODF package
Mediumthe com::sun::star::document::MediaDescriptor representing the source

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

Exceptions
com::sun::star::lang::IllegalArgumentExceptionif argument is NULL
com::sun::star::lang::WrappedTargetExceptionif thrown when trying to open a stream in the given storage
com::sun::star::io::IOExceptionif thrown when writing to the storage

Member Data Documentation

◆ Author

string Author
attribute

contains the initial author of the document.

◆ AutoloadSecs

long AutoloadSecs
set raises(com::sun::star::lang::IllegalArgumentException
)
attribute

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.

Exceptions
com::sun::star::lang::IllegalArgumentExceptionif argument is negative
See also
AutoloadURL

◆ AutoloadURL

string AutoloadURL
attribute

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 location 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 also
AutoloadSecs

◆ CreationDate

com::sun::star::util::DateTime CreationDate
attribute

contains the date and time when the document was created.

◆ DefaultTarget

string DefaultTarget
attribute

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.

◆ Description

string Description
attribute

contains a multi-line comment describing the document.

Line delimiters can be UNIX, Macintosh or DOS style.

◆ EditingCycles

short EditingCycles
set raises(com::sun::star::lang::IllegalArgumentException
)
attribute

describes how often the document was edited and saved.

Exceptions
com::sun::star::lang::IllegalArgumentExceptionif argument is negative

◆ EditingDuration

long EditingDuration
set raises(com::sun::star::lang::IllegalArgumentException
)
attribute

contains the net time of editing the document (in seconds).

Exceptions
com::sun::star::lang::IllegalArgumentExceptionif argument is negative

◆ Generator

string Generator
attribute

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.

◆ Language

com::sun::star::lang::Locale Language
attribute

contains the default language of the document.

◆ ModificationDate

com::sun::star::util::DateTime ModificationDate
attribute

contains the date and time of the last time the document was stored.

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

◆ ModifiedBy

string ModifiedBy
attribute

contains the name of the person who most recently stored the document.

◆ PrintDate

com::sun::star::util::DateTime PrintDate
attribute

contains the date and time when the document was last printed.

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

◆ PrintedBy

string PrintedBy
attribute

contains the name of the person who most recently printed the document.

◆ Subject

string Subject
attribute

contains the subject of the document.

◆ TemplateDate

com::sun::star::util::DateTime TemplateDate
attribute

contains the date and time of when the document was created or updated from the template.

◆ TemplateName

string TemplateName
attribute

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.

◆ TemplateURL

string TemplateURL
attribute

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.

◆ Title

string Title
attribute

contains the title of the document.


The documentation for this interface was generated from the following file: