WPSDocument.h Source File documentation

WPSDocument.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3 * Version: MPL 2.0 / LGPLv2.1+
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * Major Contributor(s):
10 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
11 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
12 *
13 * For minor contributions see the git repository.
14 *
15 * Alternatively, the contents of this file may be used under the terms
16 * of the GNU Lesser General Public License Version 2.1 or later
17 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18 * applicable instead of those above.
19 *
20 * For further information visit http://libwps.sourceforge.net
21 */
22
23
24 #ifndef WPSDOCUMENT_H
25 #define WPSDOCUMENT_H
26
27 #include <librevenge/librevenge.h>
28
29 #ifdef DLL_EXPORT
30 #ifdef BUILD_WPS
31 #define WPSLIB __declspec(dllexport)
32 #else
33 #define WPSLIB __declspec(dllimport)
34 #endif
35 #else // !DLL_EXPORT
36 #ifdef LIBWPS_VISIBILITY
37 #define WPSLIB __attribute__((visibility("default")))
38 #else
39 #define WPSLIB
40 #endif
41 #endif
42
43
44 namespace libwps
45 {
46
47 enum WPSConfidence { WPS_CONFIDENCE_NONE=0, WPS_CONFIDENCE_EXCELLENT, WPS_CONFIDENCE_SUPPORTED_ENCRYPTION };
48 enum WPSCreator { WPS_MSWORKS=0 ,
49 WPS_LOTUS ,
50 WPS_QUATTRO_PRO ,
52 WPS_SYMPHONY ,
53 WPS_RESERVED_0, WPS_RESERVED_1, WPS_RESERVED_2,
54 WPS_RESERVED_3, WPS_RESERVED_4, WPS_RESERVED_5,
55 WPS_RESERVED_6, WPS_RESERVED_7, WPS_RESERVED_8,
56 WPS_MSWRITE=WPS_RESERVED_0 ,
57 WPS_DOSWORD=WPS_RESERVED_1 ,
58 WPS_MULTIPLAN=WPS_RESERVED_2 ,
59 WPS_XYWRITE=WPS_RESERVED_3
60 };
61 enum WPSKind { WPS_TEXT=0, WPS_SPREADSHEET, WPS_DATABASE };
62 enum WPSResult { WPS_OK, WPS_ENCRYPTION_ERROR, WPS_FILE_ACCESS_ERROR, WPS_PARSE_ERROR, WPS_OLE_ERROR, WPS_UNKNOWN_ERROR };
63
67 class WPSDocument
68 {
69 public:
91 static WPSLIB WPSConfidence isFileFormatSupported(librevenge::RVNGInputStream *input, WPSKind &kind, WPSCreator &creator, bool &needCharSetEncoding);
92
102 static WPSLIB WPSResult parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface,
103 char const *password="", char const *encoding="");
113 static WPSLIB WPSResult parse(librevenge::RVNGInputStream *input, librevenge::RVNGSpreadsheetInterface *documentInterface,
114 char const *password="", char const *encoding="");
115 };
116
117 } // namespace libwps
118
119 #endif /* WPSDOCUMENT_H */
120 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKS4Parser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: WKS4.cpp:413
libwps::WPS_MULTIPLAN
@ WPS_MULTIPLAN
Definition: WPSDocument.h:58
libwps::MultiplanParser
This class parses Microsoft Multiplan DOS spreadsheet v1.
Definition: Multiplan.h:49
WPSLIB
#define WPSLIB
Definition: WPSDocument.h:39
libwps::MultiplanParser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: Multiplan.cpp:317
XYWriteParser
This class parses XYWrite Dos and Win4 files.
Definition: XYWrite.h:47
libwps::WPS_CONFIDENCE_EXCELLENT
@ WPS_CONFIDENCE_EXCELLENT
Definition: WPSDocument.h:47
libwps::WPS_RESERVED_8
@ WPS_RESERVED_8
Definition: WPSDocument.h:55
libwps::WPS_OLE_ERROR
@ WPS_OLE_ERROR
Definition: WPSDocument.h:62
libwps::WPS_DOSWORD
@ WPS_DOSWORD
Definition: WPSDocument.h:57
libwps::WPS_SYMPHONY
@ WPS_SYMPHONY
Lotus Symphony files(untested, probably DOS documents)
Definition: WPSDocument.h:52
libwps::WPS_XYWRITE
@ WPS_XYWRITE
Definition: WPSDocument.h:59
libwps
Definition: libwps_internal.cpp:38
DosWordParser
This class parses Microsoft Word for DOS.
Definition: DosWord.h:38
QuattroDosParser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: QuattroDos.cpp:365
DosWord.h
libwps::WPS_PARSE_ERROR
@ WPS_PARSE_ERROR
Definition: WPSDocument.h:62
libwps::WPS_OK
@ WPS_OK
Definition: WPSDocument.h:62
XYWriteParser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: XYWrite.cpp:1790
WPSHeader.h
libwps::WPS_ENCRYPTION_ERROR
@ WPS_ENCRYPTION_ERROR
Definition: WPSDocument.h:62
Quattro9Parser
This class parses Quattro Pro WP spreadsheet: .qpw.
Definition: Quattro9.h:89
libwps::WPS_MSWRITE
@ WPS_MSWRITE
Definition: WPSDocument.h:56
libwps::WPSConfidence
WPSConfidence
Definition: WPSDocument.h:47
libwps::WPS_DATABASE
@ WPS_DATABASE
Definition: WPSDocument.h:61
LotusParser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: Lotus.cpp:427
MSWriteParser
This class parses Microsoft Write 3.0 and 3.1.
Definition: MSWrite.h:131
libwps::WPS_RESERVED_2
@ WPS_RESERVED_2
Definition: WPSDocument.h:53
libwps::WPSResult
WPSResult
Definition: WPSDocument.h:62
Quattro.h
libwps::WPSDocument::parse
static WPSLIB WPSResult parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface, char const *password="", char const *encoding="")
Parses the input stream content.
Definition: WPSDocument.cpp:212
Quattro9.h
libwps::WPS_RESERVED_7
@ WPS_RESERVED_7
Definition: WPSDocument.h:55
WKS4.h
libwps::ParseException
Definition: libwps_internal.h:151
libwps::PasswordException
Definition: libwps_internal.h:156
libwps::WPS_RESERVED_6
@ WPS_RESERVED_6
Definition: WPSDocument.h:55
libwps::WPSCreator
WPSCreator
Definition: WPSDocument.h:48
WPS_DEBUG_MSG
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
libwps_tools_win::Font::getTypeForString
static Type getTypeForString(char const *encoding)
Definition: libwps_tools_win.cpp:195
LotusParser
This class parses a wk3,wk4,123 Lotus spreadsheet.
Definition: Lotus.h:72
libwps::WPSKind
WPSKind
Definition: WPSDocument.h:61
WPS4Parser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: WPS4.cpp:545
libwps.h
Quattro9Parser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: Quattro9.cpp:599
libwps::WPS_SPREADSHEET
@ WPS_SPREADSHEET
Definition: WPSDocument.h:61
libwps::WPS_CONFIDENCE_NONE
@ WPS_CONFIDENCE_NONE
Definition: WPSDocument.h:47
libwps::WPS_RESERVED_3
@ WPS_RESERVED_3
Definition: WPSDocument.h:54
WPS8Parser
This class parses Works version 2000 through 8.
Definition: WPS8.h:49
libwps::WPS_QUATTRO_PRO
@ WPS_QUATTRO_PRO
Quattro Pro wq1,wq2, wb1,wb2,wb3, qpw spreadsheets and qpw spreadsheet.
Definition: WPSDocument.h:50
libwps::WPS_CONFIDENCE_SUPPORTED_ENCRYPTION
@ WPS_CONFIDENCE_SUPPORTED_ENCRYPTION
Definition: WPSDocument.h:47
Lotus.h
DosWordParser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: DosWord.cpp:143
libwps::WPS_RESERVED_5
@ WPS_RESERVED_5
Definition: WPSDocument.h:54
libwps::WPS_RESERVED_1
@ WPS_RESERVED_1
Definition: WPSDocument.h:53
WPSHeaderPtr
std::shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:109
WPS4.h
QuattroParser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: Quattro.cpp:673
QuattroParser
This class parses Quattro Pro spreadsheet: .wb1, ..., .wb3.
Definition: Quattro.h:53
libwps_tools_win.h
WPSParser.h
QuattroDos.h
libwps::WPS_UNKNOWN_ERROR
@ WPS_UNKNOWN_ERROR
Definition: WPSDocument.h:62
libwps::WPS_RESERVED_4
@ WPS_RESERVED_4
Definition: WPSDocument.h:54
QuattroDosParser
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition: QuattroDos.h:48
WPS4Parser
This class parses Works version 2 through 4.
Definition: WPS4.h:48
libwps::WPS_LOTUS
@ WPS_LOTUS
Lotus DOS(wk1), Apple(Lotus 123 v1), Windows(wk3,wk4,123) spreadsheets.
Definition: WPSDocument.h:49
WPS8.h
Multiplan.h
libwps::WPS_RESERVED_0
@ WPS_RESERVED_0
Definition: WPSDocument.h:53
WPSHeader::constructHeader
static WPSHeader * constructHeader(RVNGInputStreamPtr &input)
So far, we have identified three categories of Works documents.
Definition: WPSHeader.cpp:55
libwps_internal.h
libwps::WPSDocument
This class provides all the functions an application would need to parse Works documents.
Definition: WPSDocument.h:67
libwps::WPSDocument::isFileFormatSupported
static WPSLIB WPSConfidence isFileFormatSupported(librevenge::RVNGInputStream *input, WPSKind &kind, WPSCreator &creator, bool &needCharSetEncoding)
Analyzes the content of an input stream to see if it can be parsed.
Definition: WPSDocument.cpp:62
libwps::WPS_FILE_ACCESS_ERROR
@ WPS_FILE_ACCESS_ERROR
Definition: WPSDocument.h:62
WKS4Parser
This class parses Microsoft Works spreadsheet or a database file.
Definition: WKS4.h:48
XYWrite.h
libwps::WPS_MSWORKS
@ WPS_MSWORKS
Definition: WPSDocument.h:48
MSWrite.h
WPS_shared_ptr_noop_deleter
a noop deleter used to transform a librevenge pointer in a false std::shared_ptr
Definition: libwps_internal.h:71
libwps::FileException
Definition: libwps_internal.h:146
libwps::WPS_TEXT
@ WPS_TEXT
Definition: WPSDocument.h:61