MWAWDocument Class Reference

This class provides all the functions needed by applications to parse many pre-MacOSX documents. More...

#include <MWAWDocument.hxx>

Public Types

enum  Confidence { MWAW_C_NONE =0, MWAW_C_UNSUPPORTED_ENCRYPTION, MWAW_C_SUPPORTED_ENCRYPTION, MWAW_C_EXCELLENT }
 an enum which defines if we have confidence that a file is supported More...
 
enum  Kind {
  MWAW_K_UNKNOWN =0, MWAW_K_TEXT, MWAW_K_DRAW, MWAW_K_PAINT,
  MWAW_K_PRESENTATION, MWAW_K_SPREADSHEET, MWAW_K_DATABASE
}
 an enum to define the kind of document More...
 
enum  Result {
  MWAW_R_OK =0, MWAW_R_FILE_ACCESS_ERROR, MWAW_R_OLE_ERROR, MWAW_R_PARSE_ERROR,
  MWAW_R_PASSWORD_MISSMATCH_ERROR, MWAW_R_UNKNOWN_ERROR
}
 an enum which defines the result of the file parsing More...
 
enum  Type {
  MWAW_T_UNKNOWN =0, MWAW_T_ACTA, MWAW_T_BEAGLEWORKS, MWAW_T_CLARISWORKS,
  MWAW_T_DOCMAKER, MWAW_T_EDOC, MWAW_T_FRAMEMAKER, MWAW_T_FULLWRITE,
  MWAW_T_GREATWORKS, MWAW_T_HANMACWORDJ, MWAW_T_HANMACWORDK, MWAW_T_LIGHTWAYTEXT,
  MWAW_T_MACDOC, MWAW_T_MACDRAW, MWAW_T_MACPAINT, MWAW_T_MARINERWRITE,
  MWAW_T_MINDWRITE, MWAW_T_MORE, MWAW_T_MICROSOFTWORD, MWAW_T_MICROSOFTWORKS,
  MWAW_T_MACWRITE, MWAW_T_MACWRITEPRO, MWAW_T_NISUSWRITER, MWAW_T_PAGEMAKER,
  MWAW_T_RAGTIME, MWAW_T_READYSETGO, MWAW_T_TEACHTEXT, MWAW_T_TEXEDIT,
  MWAW_T_WRITENOW, MWAW_T_WRITERPLUS, MWAW_T_XPRESS, MWAW_T_ZWRITE,
  MWAW_T_RESERVED1, MWAW_T_RESERVED2, MWAW_T_RESERVED3, MWAW_T_RESERVED4,
  MWAW_T_RESERVED5, MWAW_T_RESERVED6, MWAW_T_RESERVED7, MWAW_T_RESERVED8,
  MWAW_T_RESERVED9
}
 an enum to define the different type of document More...
 

Static Public Member Functions

static MWAWLIB Confidence isFileFormatSupported (WPXInputStream *input, Type &type, Kind &kind)
 Analyzes the content of an input stream to see if it can be parsed. More...
 
static MWAWLIB Result parse (WPXInputStream *input, WPXDocumentInterface *documentInterface, char const *password=0)
 Parses the input stream content. More...
 
static MWAWLIB bool decodeGraphic (WPXBinaryData const &binary, libwpg::WPGPaintInterface *paintInterface)
 Parses the graphic contained in the binary data and called paintInterface to reconstruct a graphic. More...
 

Detailed Description

This class provides all the functions needed by applications to parse many pre-MacOSX documents.

Member Enumeration Documentation

an enum which defines if we have confidence that a file is supported

Enumerator
MWAW_C_NONE 

not supported

MWAW_C_UNSUPPORTED_ENCRYPTION 

encryption not supported

MWAW_C_SUPPORTED_ENCRYPTION 

encryption supported

MWAW_C_EXCELLENT 

supported

an enum to define the kind of document

Enumerator
MWAW_K_UNKNOWN 

unknown

MWAW_K_TEXT 

word processing file

MWAW_K_DRAW 

vectorized grphic

MWAW_K_PAINT 

bitmap graphic

MWAW_K_PRESENTATION 

presentation graphic

MWAW_K_SPREADSHEET 

spreadsheet

MWAW_K_DATABASE 

database

an enum which defines the result of the file parsing

Enumerator
MWAW_R_OK 

conversion ok

MWAW_R_FILE_ACCESS_ERROR 

problem when accessing file

MWAW_R_OLE_ERROR 

problem when reading the OLE structure

MWAW_R_PARSE_ERROR 

problem when parsing the file

MWAW_R_PASSWORD_MISSMATCH_ERROR 

problem when using the given password

MWAW_R_UNKNOWN_ERROR 

unknown error

an enum to define the different type of document

Enumerator
MWAW_T_UNKNOWN 

Unrecognised file type.

MWAW_T_ACTA 

Acta (v2 and Classic v1)

MWAW_T_BEAGLEWORKS 

BeagleWorks (v1.0)/WordPerfect Works (v1.2)

MWAW_T_CLARISWORKS 

ClarisWorks/AppleWorks: all versions, open text files + some draw/paint files.

MWAW_T_DOCMAKER 

DocMaker (v4)

MWAW_T_EDOC 

eDOC (v2)

MWAW_T_FRAMEMAKER 

FrameMaker: TODO.

MWAW_T_FULLWRITE 

FullWrite Professional: basic.

MWAW_T_GREATWORKS 

GreatWorks (v1-v2): text and drawing document.

MWAW_T_HANMACWORDJ 

HanMac Word-J (v2.0.4)

MWAW_T_HANMACWORDK 

HanMac Word-K (v2.0.5-2.0.6)

MWAW_T_LIGHTWAYTEXT 

LightWayText (only v4 Mac format)

MWAW_T_MACDOC 

MacDoc (v1.3)

MWAW_T_MACDRAW 

MacDraw: TODO.

MWAW_T_MACPAINT 

MacPaint: TODO.

MWAW_T_MARINERWRITE 

Mariner Write (only v1.6-v3.5 Mac Classic)

MWAW_T_MINDWRITE 

MindWrite.

MWAW_T_MORE 

More (v2-3): retrieve the organization part but not the slide/tree parts.

MWAW_T_MICROSOFTWORD 

Microsoft Word (v1-v5)

MWAW_T_MICROSOFTWORKS 

Microsoft Works Mac.

MWAW_T_MACWRITE 

MacWrite.

MWAW_T_MACWRITEPRO 

MacWrite II/Pro.

MWAW_T_NISUSWRITER 

Nisus Writer (v3.4-v6.5)

MWAW_T_PAGEMAKER 

PageMaker: TODO.

MWAW_T_RAGTIME 

RagTime: TODO.

MWAW_T_READYSETGO 

Ready,Set,Go!: TODO.

MWAW_T_TEACHTEXT 

TeachText/SimpleText.

MWAW_T_TEXEDIT 

Tex-Edit (v2)

MWAW_T_WRITENOW 

WriteNow.

MWAW_T_WRITERPLUS 

WriterPlus.

MWAW_T_XPRESS 

XPress: TODO.

MWAW_T_ZWRITE 

Z-Write (v1.3)

MWAW_T_RESERVED1 

Reserved for future use.

MWAW_T_RESERVED2 

Reserved for future use.

MWAW_T_RESERVED3 

Reserved for future use.

MWAW_T_RESERVED4 

Reserved for future use.

MWAW_T_RESERVED5 

Reserved for future use.

MWAW_T_RESERVED6 

Reserved for future use.

MWAW_T_RESERVED7 

Reserved for future use.

MWAW_T_RESERVED8 

Reserved for future use.

MWAW_T_RESERVED9 

Reserved for future use.

Member Function Documentation

bool MWAWDocument::decodeGraphic ( WPXBinaryData const &  binary,
libwpg::WPGPaintInterface *  paintInterface 
)
static

Parses the graphic contained in the binary data and called paintInterface to reconstruct a graphic.

The input is normally send to a WPXDocumentInterface with mimeType="image/mwaw-odg", ie. it must correspond to a picture created by the MWAWGraphicInterface class via a MWAWPropertyEncoder.

Parameters
binarya list of WPGPaintInterface stored in a paintInterface,
paintInterfacethe paint interface which will convert the graphic is some specific format (ODG, SVG, ...)
Note
this function appears in MWAW_GRAPHIC_VERSION==1
MWAWDocument::Confidence MWAWDocument::isFileFormatSupported ( WPXInputStream *  input,
MWAWDocument::Type type,
Kind kind 
)
static

Analyzes the content of an input stream to see if it can be parsed.

Parameters
inputThe input stream
typeThe document type ( filled if the file is supported )
kindThe document kind ( filled if the file is supported )
Returns
A confidence value which represents the likelyhood that the content from the input stream can be parsed
Note
encryption enum appears in MWAW_TEXT_VERSION==2
MWAWDocument::Result MWAWDocument::parse ( WPXInputStream *  input,
WPXDocumentInterface *  documentInterface,
char const *  password = 0 
)
static

Parses the input stream content.

It will make callbacks to the functions provided by a WPXDocumentInterface class implementation when needed. This is often commonly called the 'main parsing routine'.

Parameters
inputThe input stream
documentInterfaceA MWAWListener implementation
passwordThe file password
Note
password appears in MWAW_TEXT_VERSION==2

The documentation for this class was generated from the following files:

Generated on Tue Mar 10 2015 17:32:09 for libmwaw by doxygen 1.8.5