LibreOffice
LibreOffice 7.4 SDK API Reference
Exported Interfaces | List of all members
TypeDetection Service Referencepublished

encapsulate a type detection service and provide read/write access on it's configuration data. More...

import"TypeDetection.idl";

Inheritance diagram for TypeDetection:
XTypeDetection XNameAccess XNameContainer XContainerQuery XFlushable XInterface XElementAccess XNameReplace XInterface XInterface XInterface XNameAccess XElementAccess XInterface

Exported Interfaces

interface XTypeDetection
 can be used to make a flat or deep type detection. More...
 
interface com::sun::star::container::XNameAccess
 provides read access to the complete set of type configuration data. More...
 
interface com::sun::star::container::XNameContainer
 provides a write access to the configuration data. More...
 
interface com::sun::star::container::XContainerQuery
 provides search on the configuration data set. More...
 
interface com::sun::star::util::XFlushable
 can be used to perform container changes. More...
 

Additional Inherited Members

- Public Member Functions inherited from XTypeDetection
string queryTypeByURL ([in] string URL)
 make a "flat" detection by using the URL of the document More...
 
string queryTypeByDescriptor ([inout] sequence< com::sun::star::beans::PropertyValue > Descriptor, [in] boolean AllowDeep)
 make a "deep" detection or optional a "flat" detection by using a MediaDescriptor More...
 
- Public Member Functions inherited from XInterface
any queryInterface ([in] type aType)
 queries for a new interface to an existing UNO object. More...
 
void acquire ()
 increases the reference counter by one. More...
 
void release ()
 decreases the reference counter by one. More...
 
- Public Member Functions inherited from XNameAccess
any getByName ([in] string aName) raises ( com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
 
sequence< string > getElementNames ()
 
boolean hasByName ([in] string aName)
 
- Public Member Functions inherited from XElementAccess
type getElementType ()
 
boolean hasElements ()
 
- Protected Member Functions inherited from XNameContainer
void insertByName ([in] string aName, [in] any aElement) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::ElementExistException, com::sun::star::lang::WrappedTargetException )
 inserts the given element at the specified name. More...
 
void removeByName ([in] string Name) raises ( com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
 removes the element with the specified name. More...
 
- Protected Member Functions inherited from XNameReplace
void replaceByName ([in] string aName, [in] any aElement) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
 replaces the element with the specified name with the given element. More...
 
- Protected Member Functions inherited from XContainerQuery
XEnumeration createSubSetEnumerationByQuery ([in] string Query)
 creates a sub set of container items which match given query command More...
 
XEnumeration createSubSetEnumerationByProperties ([in] sequence< com::sun::star::beans::NamedValue > Properties)
 creates a sub set of container items which supports searched properties as minimum More...
 
- Protected Member Functions inherited from XFlushable
void flush ()
 flushes the data of the object to the connected data source. More...
 
void addFlushListener ([in] com::sun::star::util::XFlushListener l)
 adds the specified listener to receive event "flushed." More...
 
void removeFlushListener ([in] com::sun::star::util::XFlushListener l)
 removes the specified listener. More...
 

Detailed Description

encapsulate a type detection service and provide read/write access on it's configuration data.

It's possible to make a "flat" detection which may use internal configuration data only - or a "deep" detection which use special ExtendedTypeDetection services to look into the document stream. Last mode can be suppressed to perform the operation. Of course the results can't be guaranteed then. (e.g. in case the extension was changed)

Developers Guide
Office Development - Integrating Import and Export Filters

Exported Interfaces

◆ com::sun::star::container::XContainerQuery

provides search on the configuration data set.

Against simple property search it provides some complex algorithms too. For further information please read the SDK documentation.

◆ com::sun::star::container::XNameAccess

provides read access to the complete set of type configuration data.

Every container item is specified as a set of properties and will be represented by a sequence< com::sun::star::beans::PropertyValue > structure. Follow properties are supported: (But note: not all of them must be present every time!)

Property Name Value Type Description
Name [string] The internal name is the only value, which makes a container item unique.
UIName [string] It contains the localized name for this type for the current locale.
UINames [sequence< string >] It contains all available localized names for this type. The are organized in pairs and represented as a structure of sequence< com::sun::star::beans::PropertyValue >. The name of such property must be interpreted as locale; its value as the localized type name corresponding to this locale.
MediaType [string] It contains the MIME or content type descriptor. The differences between a MIME type and an internal type name was made, to resolve existing ambiguities.
ClipboardFormatdeprecated! [string] It was interpreted as an identifier inside clipboard. Please use new property ContentFormat instead of this now.
ContentFormat [string] It's and identifier, which is used for a deep format detection. An ExtendedTypeDetection use this value to match a given content to this type. e.g. It's interpreted as the doc type of an XML stream or as an identifier inside a file header.
URLPattern [sequence< string >] This list contains different URL patterns, which identify this type. E.g. data base contents can be described by a new defined protocol like "sql://select*". In combination with a suitable com::sun::star::frame::FrameLoader or ImportFilter/ExportFilter it would be possible then, to layout a SQL query output into an office frame.
Extensions [sequence< string >] It contains a list of file extensions, which match this type. They must be specified as pure extension, without any special signs. E.g.: "doc", "html" ... but not ".doc". Using wild cards is allowed but not very useful. They may result in ambiguities with other type registrations can't be resolved anytime.
DocumentIconID [integer] It's an ID, which present the number of a corresponding icon.

Note:
All elements of this container will be addressed by his internal name, and it must be an unambiguous value.

◆ com::sun::star::container::XNameContainer

provides a write access to the configuration data.

◆ com::sun::star::util::XFlushable

can be used to perform container changes.

Because the complexness of such configuration set can be very high, it seems not very useful to update the underlying configuration layer on every container change request immediately. Another strategy can be to make all changes (adding/changing/removing of items) and call flush at the end. That will validate the whole container and reject inconsistent data sets. Only in case all made changes was correct, they will be written back to the configuration. Further this interface provides the possibility, that interested changes listener can be registered too.

◆ XTypeDetection

interface XTypeDetection

can be used to make a flat or deep type detection.

Use this interface to get information about the type of the given resource. Return value will be always an internal name of a registered document type. It can be used may on other services (e.g. com::sun::star::frame::FrameLoaderFactory) to do further things, which base on it (e.g. to load it into a frame).


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