WPDocument.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwpd
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 (wrlach@gmail.com)
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://libwpd.sourceforge.net
00021  */
00022 
00023 /* "This product is not manufactured, approved, or supported by
00024  * Corel Corporation or Corel Corporation Limited."
00025  */
00026 
00027 #ifndef WPDOCUMENT_H
00028 #define WPDOCUMENT_H
00029 
00030 #ifdef DLL_EXPORT
00031 #ifdef LIBWPD_BUILD
00032 #define WPDAPI __declspec(dllexport)
00033 #else
00034 #define WPDAPI __declspec(dllimport)
00035 #endif
00036 #else
00037 #define WPDAPI
00038 #endif
00039 
00040 #include <librevenge/librevenge.h>
00041 
00042 namespace libwpd
00043 {
00044 
00045 /* The "WPD_CONFIDENCE_NONE=0" must not be removed for the type detection to work well */
00046 enum WPDConfidence { WPD_CONFIDENCE_NONE=0, WPD_CONFIDENCE_UNSUPPORTED_ENCRYPTION, WPD_CONFIDENCE_SUPPORTED_ENCRYPTION, WPD_CONFIDENCE_EXCELLENT };
00047 enum WPDResult { WPD_OK, WPD_FILE_ACCESS_ERROR, WPD_PARSE_ERROR, WPD_UNSUPPORTED_ENCRYPTION_ERROR, WPD_PASSWORD_MISSMATCH_ERROR, WPD_OLE_ERROR, WPD_UNKNOWN_ERROR };
00048 enum WPDPasswordMatch { WPD_PASSWORD_MATCH_NONE, WPD_PASSWORD_MATCH_DONTKNOW, WPD_PASSWORD_MATCH_OK };
00049 enum WPDFileFormat { WPD_FILE_FORMAT_WP6, WPD_FILE_FORMAT_WP5, WPD_FILE_FORMAT_WP42, WPD_FILE_FORMAT_WP3, WPD_FILE_FORMAT_WP1, WPD_FILE_FORMAT_UNKNOWN };
00050 
00056 class WPDocument
00057 {
00058 public:
00059         static WPDAPI WPDConfidence isFileFormatSupported(librevenge::RVNGInputStream *input);
00060         static WPDAPI WPDPasswordMatch verifyPassword(librevenge::RVNGInputStream *input, const char *password);
00061         static WPDAPI WPDResult parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface, const char *password);
00062         static WPDAPI WPDResult parseSubDocument(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface, WPDFileFormat fileFormat);
00063 };
00064 
00065 } // namespace libwpd
00066 
00067 #endif /* WPDOCUMENT_H */
00068 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */