WPSDocument.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwps
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Major Contributor(s):
00010  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
00011  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
00012  *
00013  * For minor contributions see the git repository.
00014  *
00015  * Alternatively, the contents of this file may be used under the terms
00016  * of the GNU Lesser General Public License Version 2.1 or later
00017  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00018  * applicable instead of those above.
00019  *
00020  * For further information visit http://libwps.sourceforge.net
00021  */
00022 
00023 
00024 #ifndef WPSDOCUMENT_H
00025 #define WPSDOCUMENT_H
00026 
00027 #include <librevenge/librevenge.h>
00028 
00029 #ifdef DLL_EXPORT
00030 #ifdef BUILD_WPS
00031 #define WPSLIB __declspec(dllexport)
00032 #else
00033 #define WPSLIB __declspec(dllimport)
00034 #endif
00035 #else // !DLL_EXPORT
00036 #ifdef LIBWPS_VISIBILITY
00037 #define WPSLIB __attribute__((visibility("default")))
00038 #else
00039 #define WPSLIB
00040 #endif
00041 #endif
00042 
00043 
00044 namespace libwps
00045 {
00046 
00047 enum WPSConfidence { WPS_CONFIDENCE_NONE=0, WPS_CONFIDENCE_EXCELLENT, WPS_CONFIDENCE_SUPPORTED_ENCRYPTION };
00048 enum WPSCreator { WPS_MSWORKS=0 ,
00049                   WPS_LOTUS ,
00050                   WPS_QUATTRO_PRO ,
00051                   WPS_SYMPHONY ,
00052                   WPS_RESERVED_0, WPS_RESERVED_1, WPS_RESERVED_2,
00053                   WPS_RESERVED_3, WPS_RESERVED_4, WPS_RESERVED_5,
00054                   WPS_RESERVED_6, WPS_RESERVED_7, WPS_RESERVED_8,
00055                   WPS_MSWRITE=WPS_RESERVED_0 
00056                 };
00057 enum WPSKind { WPS_TEXT=0, WPS_SPREADSHEET, WPS_DATABASE };
00058 enum WPSResult { WPS_OK, WPS_ENCRYPTION_ERROR, WPS_FILE_ACCESS_ERROR, WPS_PARSE_ERROR, WPS_OLE_ERROR, WPS_UNKNOWN_ERROR };
00059 
00063 class WPSDocument
00064 {
00065 public:
00087         static WPSLIB WPSConfidence isFileFormatSupported(librevenge::RVNGInputStream *input, WPSKind &kind, WPSCreator &creator, bool &needCharSetEncoding);
00088 
00098         static WPSLIB WPSResult parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface,
00099                                       char const *password="", char const *encoding="");
00109         static WPSLIB WPSResult parse(librevenge::RVNGInputStream *input, librevenge::RVNGSpreadsheetInterface *documentInterface,
00110                                       char const *password="", char const *encoding="");
00111 };
00112 
00113 } // namespace libwps
00114 
00115 #endif /* WPSDOCUMENT_H */
00116 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */