STOFFDocument Class Reference

This class provides all the functions an application would need to parse StarOffice documents. More...

#include <STOFFDocument.hxx>

List of all members.

Public Types

enum  Confidence { STOFF_C_NONE = 0, STOFF_C_UNSUPPORTED_ENCRYPTION, STOFF_C_SUPPORTED_ENCRYPTION, STOFF_C_EXCELLENT }
 an enum which defines if we have confidence that a file is supported More...
enum  Kind {
  STOFF_K_UNKNOWN = 0, STOFF_K_BITMAP, STOFF_K_CHART, STOFF_K_DATABASE,
  STOFF_K_DRAW, STOFF_K_MATH, STOFF_K_PRESENTATION, STOFF_K_SPREADSHEET,
  STOFF_K_TEXT, STOFF_K_GRAPHIC
}
 an enum to define the kind of document More...
enum  Result {
  STOFF_R_OK = 0, STOFF_R_FILE_ACCESS_ERROR, STOFF_R_OLE_ERROR, STOFF_R_PARSE_ERROR,
  STOFF_R_PASSWORD_MISSMATCH_ERROR, STOFF_R_UNKNOWN_ERROR
}
 an enum which defines the result of the file parsing More...

Static Public Member Functions

static STOFFLIB Confidence isFileFormatSupported (librevenge::RVNGInputStream *input, Kind &kind)
 Analyzes the content of an input stream to see if it can be parsed.
static STOFFLIB Result parse (librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface, char const *password=0)
 Parses the input stream content.
static STOFFLIB Result parse (librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *documentInterface, char const *password=0)
 Parses the input stream content.
static STOFFLIB Result parse (librevenge::RVNGInputStream *input, librevenge::RVNGPresentationInterface *documentInterface, char const *password=0)
 Parses the input stream content.
static STOFFLIB Result parse (librevenge::RVNGInputStream *input, librevenge::RVNGSpreadsheetInterface *documentInterface, char const *password=0)
 Parses the input stream content.
static STOFFLIB bool decodeGraphic (librevenge::RVNGBinaryData const &binary, librevenge::RVNGDrawingInterface *documentInterface)
 Parses the graphic contained in the binary data and called documentInterface to reconstruct a graphic.
static STOFFLIB bool decodeSpreadsheet (librevenge::RVNGBinaryData const &binary, librevenge::RVNGSpreadsheetInterface *documentInterface)
 Parses the spreadsheet contained in the binary data and called documentInterface to reconstruct a spreadsheet.
static STOFFLIB bool decodeText (librevenge::RVNGBinaryData const &binary, librevenge::RVNGTextInterface *documentInterface)
 Parses the text contained in the binary data and called documentInterface to reconstruct a text.

Detailed Description

This class provides all the functions an application would need to parse StarOffice documents.


Member Enumeration Documentation

an enum which defines if we have confidence that a file is supported

Enumerator:
STOFF_C_NONE 

not supported

STOFF_C_UNSUPPORTED_ENCRYPTION 

encryption not supported

STOFF_C_SUPPORTED_ENCRYPTION 

encryption supported

STOFF_C_EXCELLENT 

supported

an enum to define the kind of document

Enumerator:
STOFF_K_UNKNOWN 

unknown

STOFF_K_BITMAP 

bitmap/image

STOFF_K_CHART 

chart

STOFF_K_DATABASE 

database

STOFF_K_DRAW 

vectorized graphic: .sda

STOFF_K_MATH 

math

STOFF_K_PRESENTATION 

presentation

STOFF_K_SPREADSHEET 

spreadsheet: .sdc

STOFF_K_TEXT 

word processing file

STOFF_K_GRAPHIC 

gallery graphic: .sdg

an enum which defines the result of the file parsing

Enumerator:
STOFF_R_OK 

conversion ok

STOFF_R_FILE_ACCESS_ERROR 

problem when accessing file

STOFF_R_OLE_ERROR 

problem when reading the OLE structure

STOFF_R_PARSE_ERROR 

problem when parsing the file

STOFF_R_PASSWORD_MISSMATCH_ERROR 

problem when using the given password

STOFF_R_UNKNOWN_ERROR 

unknown error


Member Function Documentation

bool STOFFDocument::decodeGraphic ( librevenge::RVNGBinaryData const &  binary,
librevenge::RVNGDrawingInterface *  documentInterface 
) [static]

Parses the graphic contained in the binary data and called documentInterface to reconstruct a graphic.

The input is normally send to a librevenge::RVNGXXXInterface with mimeType="image/stoff-odg", ie. it must correspond to a picture created by the STOFFGraphicEncoder class via a STOFFPropertyEncoder.

Parameters:
binarya list of librevenge::RVNGDrawingInterface stored in a documentInterface,
documentInterfacethe RVNGDrawingInterface which will convert the graphic is some specific format.
Note:
Reserved for future use. Actually, it only returns false.
bool STOFFDocument::decodeSpreadsheet ( librevenge::RVNGBinaryData const &  binary,
librevenge::RVNGSpreadsheetInterface *  documentInterface 
) [static]

Parses the spreadsheet contained in the binary data and called documentInterface to reconstruct a spreadsheet.

The input is normally send to a librevenge::RVNGXXXInterface with mimeType="image/stoff-ods", ie. it must correspond to a spreadsheet created by the STOFFSpreadsheetInterface class via a STOFFPropertyEncoder.

Parameters:
binarya list of librevenge::RVNGSpreadsheetInterface stored in a documentInterface,
documentInterfacethe RVNGSpreadsheetInterface which will convert the spreadsheet is some specific format.
Note:
Reserved for future use. Actually, it only returns false.
bool STOFFDocument::decodeText ( librevenge::RVNGBinaryData const &  binary,
librevenge::RVNGTextInterface *  documentInterface 
) [static]

Parses the text contained in the binary data and called documentInterface to reconstruct a text.

The input is normally send to a librevenge::RVNGXXXInterface with mimeType="image/stoff-odt", ie. it must correspond to a text created by the STOFFTextInterface class via a STOFFPropertyEncoder.

Parameters:
binarya list of librevenge::RVNGTextInterface stored in a documentInterface,
documentInterfacethe RVNGTextInterface which will convert the text is some specific format.
Note:
Reserved for future use. Actually, it only returns false.
STOFFDocument::Confidence STOFFDocument::isFileFormatSupported ( librevenge::RVNGInputStream *  input,
Kind kind 
) [static]

Analyzes the content of an input stream to see if it can be parsed.

Parameters:
inputThe input stream
kindThe document kind ( filled if the file is supported )
Returns:
A confidence value which represents the likelyhood that the content from the input stream can be parsed
STOFFDocument::Result STOFFDocument::parse ( librevenge::RVNGInputStream *  input,
librevenge::RVNGTextInterface *  documentInterface,
char const *  password = 0 
) [static]

Parses the input stream content.

It will make callbacks to the functions provided by a librevenge::RVNGTextInterface class implementation when needed. This is often commonly called the 'main parsing routine'.

Parameters:
inputThe input stream
documentInterfaceA RVNGTextInterface implementation
passwordThe file password
Note:
Reserved for future use. Actually, it only returns false
STOFFDocument::Result STOFFDocument::parse ( librevenge::RVNGInputStream *  input,
librevenge::RVNGDrawingInterface *  documentInterface,
char const *  password = 0 
) [static]

Parses the input stream content.

It will make callbacks to the functions provided by a librevenge::RVNGDrawingInterface class implementation when needed. This is often commonly called the 'main parsing routine'.

Parameters:
inputThe input stream
documentInterfaceA RVNGDrawingInterface implementation
passwordThe file password
Note:
Reserved for future use. Actually, it only returns false.
STOFFDocument::Result STOFFDocument::parse ( librevenge::RVNGInputStream *  input,
librevenge::RVNGPresentationInterface *  documentInterface,
char const *  password = 0 
) [static]

Parses the input stream content.

It will make callbacks to the functions provided by a librevenge::RVNGPresentationInterface class implementation when needed. This is often commonly called the 'main parsing routine'.

Parameters:
inputThe input stream
documentInterfaceA RVNGPresentationInterface implementation
passwordThe file password
Note:
Reserved for future use. Actually, it only returns false.
STOFFDocument::Result STOFFDocument::parse ( librevenge::RVNGInputStream *  input,
librevenge::RVNGSpreadsheetInterface *  documentInterface,
char const *  password = 0 
) [static]

Parses the input stream content.

It will make callbacks to the functions provided by a librevenge::RVNGSpreadsheetInterface class implementation when needed. This is often commonly called the 'main parsing routine'.

Parameters:
inputThe input stream
documentInterfaceA RVNGSpreadsheetInterface implementation
passwordThe file password
Note:
Can only convert some basic documents: retrieving more cells' contents but no formating.

The documentation for this class was generated from the following files: