STOFFDocument.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libstaroffice
4  * Version: MPL 2.0 / LGPLv2.1+
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9  *
10  * Major Contributor(s):
11  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
12  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
13  *
14  * For minor contributions see the git repository.
15  *
16  * Alternatively, the contents of this file may be used under the terms
17  * of the GNU Lesser General Public License Version 2.1 or later
18  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19  * applicable instead of those above.
20  *
21  * For further information visit http://libstoff.sourceforge.net
22  */
23 
24 
25 #ifndef STOFFDOCUMENT_HXX
26 #define STOFFDOCUMENT_HXX
27 
28 #ifdef _WINDLL
29 #ifdef BUILD_STOFF
30 #define STOFFLIB __declspec(dllexport)
31 #else
32 #define STOFFLIB __declspec(dllimport)
33 #endif
34 #else // !DLL_EXPORT
35 #ifdef LIBSTAROFFICE_VISIBILITY
36 #define STOFFLIB __attribute__((visibility("default")))
37 #else
38 #define STOFFLIB
39 #endif
40 #endif
41 
42 namespace librevenge
43 {
44 class RVNGBinaryData;
45 class RVNGDrawingInterface;
46 class RVNGPresentationInterface;
47 class RVNGSpreadsheetInterface;
48 class RVNGTextInterface;
49 class RVNGInputStream;
50 }
51 
56 {
57 public:
59  enum Confidence {
64  };
66  enum Kind {
77  };
79  enum Result {
86  };
87 
93  static STOFFLIB Confidence isFileFormatSupported(librevenge::RVNGInputStream *input, Kind &kind);
94 
95  // ------------------------------------------------------------
96  // the different main parsers
97  // ------------------------------------------------------------
98 
107  static STOFFLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface, char const *password=nullptr);
108 
117  static STOFFLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *documentInterface, char const *password=nullptr);
118 
127  static STOFFLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGPresentationInterface *documentInterface, char const *password=nullptr);
128 
137  static STOFFLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGSpreadsheetInterface *documentInterface, char const *password=nullptr);
138 
139  // ------------------------------------------------------------
140  // decoders of the embedded zones created by libstoff
141  // ------------------------------------------------------------
142 
152  static STOFFLIB bool decodeGraphic(librevenge::RVNGBinaryData const &binary, librevenge::RVNGDrawingInterface *documentInterface);
153 
163  static STOFFLIB bool decodeSpreadsheet(librevenge::RVNGBinaryData const &binary, librevenge::RVNGSpreadsheetInterface *documentInterface);
164 
174  static STOFFLIB bool decodeText(librevenge::RVNGBinaryData const &binary, librevenge::RVNGTextInterface *documentInterface);
175 };
176 
177 #endif /* STOFFDOCUMENT_HXX */
178 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
STOFFSpreadsheetDecoder.hxx
SDXParser
the main class to read a StarOffice sdX file
Definition: SDXParser.hxx:64
SDAParser.hxx
STOFFDocument::STOFF_K_TEXT
word processing file
Definition: STOFFDocument.hxx:75
STOFFDocument::STOFF_C_NONE
not supported
Definition: STOFFDocument.hxx:60
STOFFDocument::STOFF_C_EXCELLENT
supported
Definition: STOFFDocument.hxx:63
STOFFDocument::STOFF_K_DRAW
vectorized graphic: .sda
Definition: STOFFDocument.hxx:71
STOFFDocumentInternal::getHeader
STOFFHeader * getHeader(STOFFInputStreamPtr &input, bool strict)
return the header corresponding to an input.
Definition: STOFFDocument.cxx:285
STOFFDocument::STOFF_R_OLE_ERROR
problem when reading the OLE structure
Definition: STOFFDocument.hxx:82
STOFFDocumentInternal::getSpreadsheetParserFromHeader
std::shared_ptr< STOFFSpreadsheetParser > getSpreadsheetParserFromHeader(STOFFInputStreamPtr &input, STOFFHeader *header, char const *passwd)
Factory wrapper to construct a parser corresponding to an spreadsheet header.
Definition: STOFFDocument.cxx:390
SDXParser.hxx
STOFFDocument::STOFF_R_OK
conversion ok
Definition: STOFFDocument.hxx:80
libstoff::FileException
Definition: libstaroffice_internal.hxx:139
STOFF_DEBUG_MSG
#define STOFF_DEBUG_MSG(M)
Definition: libstaroffice_internal.hxx:129
SDWParser::setDocumentPassword
void setDocumentPassword(char const *passwd)
set the document password
Definition: SDWParser.hxx:72
SDGParser.hxx
STOFFDocument::STOFF_R_PARSE_ERROR
problem when parsing the file
Definition: STOFFDocument.hxx:83
SDCParser.hxx
STOFFPropertyHandler::checkData
bool checkData(librevenge::RVNGBinaryData const &encoded)
checks a encoded librevenge::RVNGBinaryData created by STOFFPropertyHandlerEncoder
Definition: STOFFPropertyHandler.cxx:363
STOFFDocument::Kind
Kind
an enum to define the kind of document
Definition: STOFFDocument.hxx:66
STOFFDocument::STOFF_C_SUPPORTED_ENCRYPTION
encryption supported
Definition: STOFFDocument.hxx:62
STOFFDocumentInternal::getGraphicParserFromHeader
std::shared_ptr< STOFFGraphicParser > getGraphicParserFromHeader(STOFFInputStreamPtr &input, STOFFHeader *header, char const *passwd)
Factory wrapper to construct a parser corresponding to an graphic header.
Definition: STOFFDocument.cxx:321
STOFFDocument::STOFF_K_BITMAP
bitmap/image
Definition: STOFFDocument.hxx:68
STOFFGraphicDecoder.hxx
SDGParser
the main class to read a StarOffice sdg file
Definition: SDGParser.hxx:64
STOFFDocument::STOFF_K_UNKNOWN
unknown
Definition: STOFFDocument.hxx:67
libstaroffice.hxx
STOFFDocumentInternal::checkHeader
bool checkHeader(STOFFInputStreamPtr &input, STOFFHeader &header, bool strict)
Wrapper to check a basic header of a mac file.
Definition: STOFFDocument.cxx:406
STOFFDocumentInternal::getTextParserFromHeader
std::shared_ptr< STOFFTextParser > getTextParserFromHeader(STOFFInputStreamPtr &input, STOFFHeader *header, char const *passwd)
Factory wrapper to construct a parser corresponding to an text header.
Definition: STOFFDocument.cxx:360
libstoff::WrongPasswordException
Definition: libstaroffice_internal.hxx:151
SDXParser::setDocumentPassword
void setDocumentPassword(char const *passwd)
set the document password
Definition: SDXParser.hxx:72
STOFFParser.hxx
STOFFDocument::STOFF_K_CHART
chart
Definition: STOFFDocument.hxx:69
SDWParser.hxx
SDAParser::setDocumentPassword
void setDocumentPassword(char const *passwd)
set the document password
Definition: SDAParser.hxx:72
STOFFHeader::getKind
Kind getKind() const
returns the document kind
Definition: STOFFHeader.hxx:95
SDCParser
the main class to read a StarOffice sdc file
Definition: SDCParser.hxx:64
STOFFDocument::STOFF_R_UNKNOWN_ERROR
unknown error
Definition: STOFFDocument.hxx:85
STOFFInputStreamPtr
std::shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:485
STOFFHeader::constructHeader
static std::vector< STOFFHeader > constructHeader(STOFFInputStreamPtr input)
tests the input file and returns a header if the file looks like a STOFF document ( trying first to u...
Definition: STOFFHeader.cxx:62
STOFFSpreadsheetDecoder
main class used to decode a librevenge::RVNGBinaryData created by
Definition: STOFFSpreadsheetDecoder.hxx:48
STOFFGraphicDecoder
main class used to decode a librevenge::RVNGBinaryData created by
Definition: STOFFGraphicDecoder.hxx:48
SDAParser
the main class to read a StarOffice sda/sdd file
Definition: SDAParser.hxx:64
STOFFDocument::STOFF_R_PASSWORD_MISSMATCH_ERROR
problem when using the given password
Definition: STOFFDocument.hxx:84
STOFFDocument::isFileFormatSupported
static STOFFLIB Confidence isFileFormatSupported(librevenge::RVNGInputStream *input, Kind &kind)
Analyzes the content of an input stream to see if it can be parsed.
Definition: STOFFDocument.cxx:63
libstoff::ParseException
Definition: libstaroffice_internal.hxx:143
STOFFDocumentInternal
small namespace use to define private class/method used by STOFFDocument
Definition: STOFFDocument.cxx:53
STOFFHeader
a function used by STOFFDocument to store the version of document
Definition: STOFFHeader.hxx:56
SDCParser::setDocumentPassword
void setDocumentPassword(char const *passwd)
set the document password
Definition: SDCParser.hxx:72
STOFFDocument::decodeText
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.
Definition: STOFFDocument.cxx:276
STOFFDocument::STOFF_K_PRESENTATION
presentation
Definition: STOFFDocument.hxx:73
STOFFLIB
#define STOFFLIB
Definition: STOFFDocument.hxx:38
STOFFDocument::STOFF_C_UNSUPPORTED_ENCRYPTION
encryption not supported
Definition: STOFFDocument.hxx:61
STOFFDocument::decodeSpreadsheet
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 spr...
Definition: STOFFDocument.cxx:259
STOFFDocument::STOFF_R_FILE_ACCESS_ERROR
problem when accessing file
Definition: STOFFDocument.hxx:81
STOFFDocument
This class provides all the functions an application would need to parse StarOffice documents.
Definition: STOFFDocument.hxx:55
SDGParser::setDocumentPassword
void setDocumentPassword(char const *passwd)
set the document password
Definition: SDGParser.hxx:72
STOFFDocument::STOFF_K_DATABASE
database
Definition: STOFFDocument.hxx:70
STOFFDocumentInternal::getPresentationParserFromHeader
std::shared_ptr< STOFFGraphicParser > getPresentationParserFromHeader(STOFFInputStreamPtr &input, STOFFHeader *header, char const *passwd)
Factory wrapper to construct a parser corresponding to an presentation header.
Definition: STOFFDocument.cxx:344
STOFFDocument::parse
static STOFFLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface, char const *password=nullptr)
Parses the input stream content.
Definition: STOFFDocument.cxx:204
STOFFDocument::STOFF_K_MATH
math
Definition: STOFFDocument.hxx:72
SDWParser
the main class to read a StarOffice sdw file
Definition: SDWParser.hxx:64
STOFFInputStream
Internal class used to read the file stream Internal class used to read the file stream,...
Definition: STOFFInputStream.hxx:53
STOFFPropertyHandler.hxx
STOFFDocument::Confidence
Confidence
an enum which defines if we have confidence that a file is supported
Definition: STOFFDocument.hxx:59
librevenge
Definition: STOFFDocument.hxx:42
STOFFHeader.hxx
STOFFPropertyHandler::readData
bool readData(librevenge::RVNGBinaryData const &encoded)
reads a encoded librevenge::RVNGBinaryData created by STOFFPropertyHandlerEncoder
Definition: STOFFPropertyHandler.cxx:369
STOFFDocument::Result
Result
an enum which defines the result of the file parsing
Definition: STOFFDocument.hxx:79
STOFFDocument::STOFF_K_GRAPHIC
gallery graphic: .sdg
Definition: STOFFDocument.hxx:76
STOFFDocument::decodeGraphic
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...
Definition: STOFFDocument.cxx:242
STOFFDocument::STOFF_K_SPREADSHEET
spreadsheet: .sdc
Definition: STOFFDocument.hxx:74

Generated on Mon Jan 20 2020 23:02:18 for libstaroffice by doxygen 1.8.16