MWAWDocument.hxx
Go to the documentation of this file.
00001 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
00002 
00003 /* libmwaw
00004 * Version: MPL 2.0 / LGPLv2+
00005 *
00006 * The contents of this file are subject to the Mozilla Public License Version
00007 * 2.0 (the "License"); you may not use this file except in compliance with
00008 * the License or as specified alternatively below. You may obtain a copy of
00009 * the License at http://www.mozilla.org/MPL/
00010 *
00011 * Software distributed under the License is distributed on an "AS IS" basis,
00012 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013 * for the specific language governing rights and limitations under the
00014 * License.
00015 *
00016 * Major Contributor(s):
00017 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
00018 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
00019 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00020 * Copyright (C) 2006, 2007 Andrew Ziem
00021 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
00022 *
00023 *
00024 * All Rights Reserved.
00025 *
00026 * For minor contributions see the git repository.
00027 *
00028 * Alternatively, the contents of this file may be used under the terms of
00029 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
00030 * in which case the provisions of the LGPLv2+ are applicable
00031 * instead of those above.
00032 */
00033 
00039 #ifndef MWAWDOCUMENT_HXX
00040 #define MWAWDOCUMENT_HXX
00041 
00042 #ifdef _WINDLL
00043 #  ifdef BUILD_MWAW
00044 #    define MWAWLIB _declspec(dllexport)
00045 #  else
00046 #    define MWAWLIB _declspec(dllimport)
00047 #  endif
00048 #else
00049 #  define MWAWLIB
00050 #endif
00051 
00052 namespace libwpg
00053 {
00054 class WPGPaintInterface;
00055 }
00056 
00057 class WPXBinaryData;
00058 class WPXDocumentInterface;
00059 class WPXInputStream;
00060 
00064 class MWAWDocument
00065 {
00066 public:
00068   enum Confidence {
00069     MWAW_C_NONE=0,
00070     MWAW_C_UNSUPPORTED_ENCRYPTION ,
00071     MWAW_C_SUPPORTED_ENCRYPTION ,
00072     MWAW_C_EXCELLENT 
00073   };
00075   enum Kind {
00076     MWAW_K_UNKNOWN=0 ,
00077     MWAW_K_TEXT ,
00078     MWAW_K_DRAW ,
00079     MWAW_K_PAINT ,
00080     MWAW_K_PRESENTATION ,
00081     MWAW_K_SPREADSHEET ,
00082     MWAW_K_DATABASE 
00083   };
00085   enum Result {
00086     MWAW_R_OK=0 ,
00087     MWAW_R_FILE_ACCESS_ERROR ,
00088     MWAW_R_OLE_ERROR ,
00089     MWAW_R_PARSE_ERROR ,
00090     MWAW_R_PASSWORD_MISSMATCH_ERROR ,
00091     MWAW_R_UNKNOWN_ERROR 
00092   };
00094   enum Type {
00095     MWAW_T_UNKNOWN=0 ,
00096     MWAW_T_ACTA ,
00097     MWAW_T_BEAGLEWORKS ,
00098     MWAW_T_CLARISWORKS ,
00099     MWAW_T_DOCMAKER ,
00100     MWAW_T_EDOC ,
00101     MWAW_T_FRAMEMAKER ,
00102     MWAW_T_FULLWRITE ,
00103     MWAW_T_GREATWORKS ,
00104     MWAW_T_HANMACWORDJ ,
00105     MWAW_T_HANMACWORDK ,
00106     MWAW_T_LIGHTWAYTEXT ,
00107     MWAW_T_MACDOC ,
00108     MWAW_T_MACDRAW ,
00109     MWAW_T_MACPAINT ,
00110     MWAW_T_MARINERWRITE ,
00111     MWAW_T_MINDWRITE ,
00112     MWAW_T_MORE ,
00113     MWAW_T_MICROSOFTWORD ,
00114     MWAW_T_MICROSOFTWORKS ,
00115     MWAW_T_MACWRITE ,
00116     MWAW_T_MACWRITEPRO ,
00117     MWAW_T_NISUSWRITER ,
00118     MWAW_T_PAGEMAKER ,
00119     MWAW_T_RAGTIME ,
00120     MWAW_T_READYSETGO ,
00121     MWAW_T_TEACHTEXT ,
00122     MWAW_T_TEXEDIT ,
00123     MWAW_T_WRITENOW ,
00124     MWAW_T_WRITERPLUS ,
00125     MWAW_T_XPRESS ,
00126     MWAW_T_ZWRITE ,
00127 
00128     MWAW_T_RESERVED1 ,
00129     MWAW_T_RESERVED2 ,
00130     MWAW_T_RESERVED3 ,
00131     MWAW_T_RESERVED4 ,
00132     MWAW_T_RESERVED5 ,
00133     MWAW_T_RESERVED6 ,
00134     MWAW_T_RESERVED7 ,
00135     MWAW_T_RESERVED8 ,
00136     MWAW_T_RESERVED9 
00137   };
00138 
00147   static MWAWLIB Confidence isFileFormatSupported(WPXInputStream *input, Type &type, Kind &kind);
00156   static MWAWLIB Result parse(WPXInputStream *input, WPXDocumentInterface *documentInterface, char const *password=0);
00157 
00168   static MWAWLIB bool decodeGraphic(WPXBinaryData const &binary, libwpg::WPGPaintInterface *paintInterface);
00169 };
00170 
00171 #endif /* MWAWDOCUMENT_HXX */
00172 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: