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 // !DLL_EXPORT
00049 #  ifdef LIBMWAW_VISIBILITY
00050 #    define MWAWLIB __attribute__((visibility("default")))
00051 #  else
00052 #    define MWAWLIB
00053 #  endif
00054 #endif
00055 
00056 namespace librevenge
00057 {
00058 class RVNGBinaryData;
00059 class RVNGDrawingInterface;
00060 class RVNGPresentationInterface;
00061 class RVNGSpreadsheetInterface;
00062 class RVNGTextInterface;
00063 class RVNGInputStream;
00064 }
00065 
00069 class MWAWDocument
00070 {
00071 public:
00073   enum Confidence {
00074     MWAW_C_NONE=0,
00075     MWAW_C_UNSUPPORTED_ENCRYPTION ,
00076     MWAW_C_SUPPORTED_ENCRYPTION ,
00077     MWAW_C_EXCELLENT 
00078   };
00080   enum Kind {
00081     MWAW_K_UNKNOWN=0 ,
00082     MWAW_K_TEXT ,
00083     MWAW_K_DRAW ,
00084     MWAW_K_PAINT ,
00085     MWAW_K_PRESENTATION ,
00086     MWAW_K_SPREADSHEET ,
00087     MWAW_K_DATABASE 
00088   };
00090   enum Result {
00091     MWAW_R_OK=0 ,
00092     MWAW_R_FILE_ACCESS_ERROR ,
00093     MWAW_R_OLE_ERROR ,
00094     MWAW_R_PARSE_ERROR ,
00095     MWAW_R_PASSWORD_MISSMATCH_ERROR ,
00096     MWAW_R_UNKNOWN_ERROR 
00097   };
00099   enum Type {
00100     MWAW_T_UNKNOWN=0 ,
00101     MWAW_T_ACTA ,
00102     MWAW_T_ADOBEILLUSTRATOR ,
00103     MWAW_T_BEAGLEWORKS ,
00104     MWAW_T_CLARISRESOLVE ,
00105     MWAW_T_CLARISWORKS ,
00106     MWAW_T_DBASE ,
00107     MWAW_T_DOCMAKER ,
00108     MWAW_T_EDOC ,
00109     MWAW_T_FAMILYTREEMAKER ,
00110     MWAW_T_FILEMAKER ,
00111     MWAW_T_FOXBASE ,
00112     MWAW_T_FRAMEMAKER ,
00113     MWAW_T_FULLIMPACT ,
00114     MWAW_T_FULLPAINT ,
00115     MWAW_T_FULLWRITE ,
00116     MWAW_T_GREATWORKS ,
00117     MWAW_T_HANMACWORDJ ,
00118     MWAW_T_HANMACWORDK ,
00119     MWAW_T_INFOGENIE ,
00120     MWAW_T_KALEIDAGRAPH ,
00121     MWAW_T_LIGHTWAYTEXT ,
00122     MWAW_T_MACDOC ,
00123     MWAW_T_MACDRAFT ,
00124     MWAW_T_MACDRAW ,
00125     MWAW_T_MACDRAWPRO ,
00126     MWAW_T_MACPAINT ,
00127     MWAW_T_MARINERWRITE ,
00128     MWAW_T_MINDWRITE ,
00129     MWAW_T_MORE ,
00130     MWAW_T_MICROSOFTFILE ,
00131     MWAW_T_MICROSOFTMULTIPLAN ,
00132     MWAW_T_MICROSOFTWORD ,
00133     MWAW_T_MICROSOFTWORKS ,
00134     MWAW_T_MACWRITE ,
00135     MWAW_T_MACWRITEPRO ,
00136     MWAW_T_NISUSWRITER ,
00137     MWAW_T_OVERVUE ,
00138     MWAW_T_PAGEMAKER ,
00139     MWAW_T_PIXELPAINT ,
00140     MWAW_T_RAGTIME ,
00141     MWAW_T_READYSETGO ,
00146     MWAW_T_SUPERPAINT,
00147     MWAW_T_SYMPOSIUM ,
00148     MWAW_T_TEACHTEXT ,
00149     MWAW_T_TEXEDIT ,
00150     MWAW_T_TRAPEZE ,
00151     MWAW_T_WINGZ ,
00152     MWAW_T_WRITENOW ,
00153     MWAW_T_WRITERPLUS ,
00154     MWAW_T_XPRESS ,
00155     MWAW_T_ZWRITE ,
00156     MWAW_T_4DIMENSION /* 4th Dimension: TODO*/,
00157 
00158     MWAW_T_RESERVED1 ,
00159     MWAW_T_RESERVED2 ,
00160     MWAW_T_RESERVED3 ,
00161     MWAW_T_RESERVED4 ,
00162     MWAW_T_RESERVED5 ,
00163     MWAW_T_RESERVED6 ,
00164     MWAW_T_RESERVED7 ,
00165     MWAW_T_RESERVED8 ,
00166     MWAW_T_RESERVED9 
00167   };
00168 
00177   static MWAWLIB Confidence isFileFormatSupported(librevenge::RVNGInputStream *input, Type &type, Kind &kind);
00178 
00179   // ------------------------------------------------------------
00180   // the different main parsers
00181   // ------------------------------------------------------------
00182 
00191   static MWAWLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *documentInterface, char const *password=0);
00192 
00201   static MWAWLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *documentInterface, char const *password=0);
00202 
00212   static MWAWLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGPresentationInterface *documentInterface, char const *password=0);
00213 
00223   static MWAWLIB Result parse(librevenge::RVNGInputStream *input, librevenge::RVNGSpreadsheetInterface *documentInterface, char const *password=0);
00224 
00225   // ------------------------------------------------------------
00226   // decoders of the embedded zones created by libmwaw
00227   // ------------------------------------------------------------
00228 
00238   static MWAWLIB bool decodeGraphic(librevenge::RVNGBinaryData const &binary, librevenge::RVNGDrawingInterface *documentInterface);
00239 
00250   static MWAWLIB bool decodeSpreadsheet(librevenge::RVNGBinaryData const &binary, librevenge::RVNGSpreadsheetInterface *documentInterface);
00251 
00261   static MWAWLIB bool decodeText(librevenge::RVNGBinaryData const &binary, librevenge::RVNGTextInterface *documentInterface);
00262 };
00263 
00264 #endif /* MWAWDOCUMENT_HXX */
00265 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: