STOFFDocument Class Reference documentation

STOFFDocument Class Reference

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

`#include <STOFFDocument.hxx>`

## 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=nullptr)
| Parses the input stream content.
static STOFFLIB Result | parse (librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *documentInterface, char const *password=nullptr)
| Parses the input stream content.
static STOFFLIB Result | parse (librevenge::RVNGInputStream *input, librevenge::RVNGPresentationInterface *documentInterface, char const *password=nullptr)
| Parses the input stream content.
static STOFFLIB Result | parse (librevenge::RVNGInputStream *input, librevenge::RVNGSpreadsheetInterface *documentInterface, char const *password=nullptr)
| 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

## ◆ Confidence

enum STOFFDocument::Confidence

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

## ◆ Kind

enum STOFFDocument::Kind

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

## ◆ Result

enum STOFFDocument::Result

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

## ◆ decodeGraphic()

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

  binary | a list of librevenge::RVNGDrawingInterface stored in a documentInterface,
  documentInterface | the RVNGDrawingInterface which will convert the graphic is some specific format.

Note
  Reserved for future use. Actually, it only returns false.

## ◆ decodeSpreadsheet()

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

  binary | a list of librevenge::RVNGSpreadsheetInterface stored in a documentInterface,
  documentInterface | the RVNGSpreadsheetInterface which will convert the spreadsheet is some specific format.

Note
  Reserved for future use. Actually, it only returns false.

## ◆ decodeText()

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

  binary | a list of librevenge::RVNGTextInterface stored in a documentInterface,
  documentInterface | the RVNGTextInterface which will convert the text is some specific format.

Note
  Reserved for future use. Actually, it only returns false.

## ◆ isFileFormatSupported()

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

  input | The input stream
  kind | The 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

## ◆ parse() [1/4]

STOFFDocument::Result STOFFDocument::parse | ( | librevenge::RVNGInputStream * | input,
|  | librevenge::RVNGDrawingInterface * | documentInterface,
|  | char const * | password = nullptr )
| 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

  input | The input stream
  documentInterface | A RVNGDrawingInterface implementation
  password | The file password

Note
  Reserved for future use. Actually, it only returns false.

## ◆ parse() [2/4]

STOFFDocument::Result STOFFDocument::parse | ( | librevenge::RVNGInputStream * | input,
|  | librevenge::RVNGPresentationInterface * | documentInterface,
|  | char const * | password = nullptr )
| 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

  input | The input stream
  documentInterface | A RVNGPresentationInterface implementation
  password | The file password

Note
  Reserved for future use. Actually, it only returns false.

## ◆ parse() [3/4]

STOFFDocument::Result STOFFDocument::parse | ( | librevenge::RVNGInputStream * | input,
|  | librevenge::RVNGSpreadsheetInterface * | documentInterface,
|  | char const * | password = nullptr )
| 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

  input | The input stream
  documentInterface | A RVNGSpreadsheetInterface implementation
  password | The file password

Note
  Can only convert some basic documents: retrieving more cells' contents but no formating.

## ◆ parse() [4/4]

STOFFDocument::Result STOFFDocument::parse | ( | librevenge::RVNGInputStream * | input,
|  | librevenge::RVNGTextInterface * | documentInterface,
|  | char const * | password = nullptr )
| 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

  input | The input stream
  documentInterface | A RVNGTextInterface implementation
  password | The file password

Note
  Reserved for future use. Actually, it only returns false

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

- STOFFDocument.hxx
- STOFFDocument.cxx