MWAWHeader.hxx Source File documentation

MWAWHeader.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 #ifndef MWAW_HEADER_H
35 #define MWAW_HEADER_H
36
40 #include <vector>
41
42 #include <librevenge-stream/librevenge-stream.h>
43
44 #include <libmwaw/libmwaw.hxx>
45 #include "MWAWInputStream.hxx"
46
56 class MWAWHeader
57 {
58 public:
59 typedef enum MWAWDocument::Type Type;
60 typedef enum MWAWDocument::Kind Kind;
61
62
69 explicit MWAWHeader(MWAWDocument::Type type=MWAWDocument::MWAW_T_UNKNOWN, int version=0,
70 MWAWDocument::Kind kind = MWAWDocument::MWAW_K_TEXT);
71 MWAWHeader(MWAWHeader const &)=default;
72 MWAWHeader &operator=(MWAWHeader const &)=default;
74 virtual ~MWAWHeader();
75
80 static std::vector<MWAWHeader> constructHeader
81 (MWAWInputStreamPtr input, std::shared_ptr<MWAWRSRCParser> rsrcParser);
82
84 void reset(MWAWDocument::Type type, int vers, Kind kind = MWAWDocument::MWAW_K_TEXT)
85 {
86 m_docType = type;
87 m_version = vers;
88 m_docKind = kind;
89 }
90
92 int getMajorVersion() const
93 {
94 return m_version;
95 }
97 void setMajorVersion(int version)
98 {
99 m_version=version;
100 }
101
103 Type getType() const
104 {
105 return m_docType;
106 }
108 void setType(Type type)
109 {
110 m_docType = type;
111 }
112
114 Kind getKind() const
115 {
116 return m_docKind;
117 }
119 void setKind(Kind kind)
120 {
121 m_docKind = kind;
122 }
123
124 private:
126 int m_version;
128 Type m_docType;
130 Kind m_docKind;
131 };
132
133 #endif /* MWAWHEADER_H */
134 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWHeader::setKind
void setKind(Kind kind)
sets the document kind
Definition: MWAWHeader.hxx:119
MWAWDocument::MWAW_K_DATABASE
@ MWAW_K_DATABASE
database
Definition: MWAWDocument.hxx:87
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
MWAWDocument::MWAW_T_MICROSOFTWORKS
@ MWAW_T_MICROSOFTWORKS
Microsoft Works Mac: export database(as spreadsheet), graphic, spreadsheet and text files.
Definition: MWAWDocument.hxx:133
MWAWDocument::MWAW_T_MICROSOFTMULTIPLAN
@ MWAW_T_MICROSOFTMULTIPLAN
Microsoft Multiplan: v1.11.
Definition: MWAWDocument.hxx:131
MWAWDocument::MWAW_T_MORE
@ MWAW_T_MORE
More (v2-3): retrieve the organization part but not the slide/tree parts.
Definition: MWAWDocument.hxx:129
MWAWDocument::MWAW_K_SPREADSHEET
@ MWAW_K_SPREADSHEET
spreadsheet
Definition: MWAWDocument.hxx:86
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWDocument::MWAW_T_SUPERPAINT
@ MWAW_T_SUPERPAINT
SuperPaint: export drawing and paint v1 document.
Definition: MWAWDocument.hxx:150
MWAWDocument::MWAW_T_HANMACWORDK
@ MWAW_T_HANMACWORDK
HanMac Word-K (v2.0.5-2.0.6)
Definition: MWAWDocument.hxx:118
MWAWDocument::Type
Type
an enum to define the different type of document
Definition: MWAWDocument.hxx:99
MWAWDocument::MWAW_T_TEACHTEXT
@ MWAW_T_TEACHTEXT
TeachText/SimpleText.
Definition: MWAWDocument.hxx:152
MWAWDocument::MWAW_T_MINDWRITE
@ MWAW_T_MINDWRITE
MindWrite.
Definition: MWAWDocument.hxx:128
MWAWDocument::MWAW_K_PAINT
@ MWAW_K_PAINT
bitmap graphic
Definition: MWAWDocument.hxx:84
MWAWDocument::MWAW_T_FULLPAINT
@ MWAW_T_FULLPAINT
FullPaint: v1 ( same format as MacPaint file)
Definition: MWAWDocument.hxx:114
MWAWDocument::MWAW_T_CANVAS
@ MWAW_T_CANVAS
Deneba Canvas: v2-v3.
Definition: MWAWDocument.hxx:228
MWAWDocument::MWAW_T_MACWRITEPRO
@ MWAW_T_MACWRITEPRO
MacWrite II/Pro.
Definition: MWAWDocument.hxx:135
MWAWEntry.hxx
MWAWDocument::MWAW_T_GREATWORKS
@ MWAW_T_GREATWORKS
GreatWorks (v1-v2): export text, drawing, paint and spreadsheet document.
Definition: MWAWDocument.hxx:116
MWAWHeader::m_docKind
Kind m_docKind
the document kind
Definition: MWAWHeader.hxx:130
MWAWDocument::MWAW_T_CLARISDRAW
@ MWAW_T_CLARISDRAW
Claris Draw: v1.0.1-v1.0.3.
Definition: MWAWDocument.hxx:198
MWAWDocument::Kind
Kind
an enum to define the kind of document
Definition: MWAWDocument.hxx:80
MWAWDocument::MWAW_T_MARINERWRITE
@ MWAW_T_MARINERWRITE
Mariner Write (only v1.6-v3.5 Mac Classic)
Definition: MWAWDocument.hxx:127
MWAWDocument::MWAW_K_DRAW
@ MWAW_K_DRAW
vectorized grphic
Definition: MWAWDocument.hxx:83
MWAWDocument::MWAW_T_FREEHAND
@ MWAW_T_FREEHAND
FreeHand: v1.
Definition: MWAWDocument.hxx:207
MWAWDocument::MWAW_T_PIXELPAINT
@ MWAW_T_PIXELPAINT
PixelPaint: v1-v2.1.
Definition: MWAWDocument.hxx:139
MWAWDocument::MWAW_T_LIGHTWAYTEXT
@ MWAW_T_LIGHTWAYTEXT
LightWayText (only v4 Mac format)
Definition: MWAWDocument.hxx:121
MWAWDocument::MWAW_T_MOUSEWRITE
@ MWAW_T_MOUSEWRITE
MouseWrite: v1.
Definition: MWAWDocument.hxx:216
MWAWDocument::MWAW_T_EDOC
@ MWAW_T_EDOC
eDOC (v2)
Definition: MWAWDocument.hxx:108
MWAWDocument::MWAW_T_FULLWRITE
@ MWAW_T_FULLWRITE
FullWrite Professional: basic.
Definition: MWAWDocument.hxx:115
MWAWDocument::MWAW_T_ACTA
@ MWAW_T_ACTA
Acta (v2 and Classic v1)
Definition: MWAWDocument.hxx:101
MWAWDocument::MWAW_T_DOCMAKER
@ MWAW_T_DOCMAKER
DocMaker (v4)
Definition: MWAWDocument.hxx:107
MWAWDocument::MWAW_T_MACDRAWPRO
@ MWAW_T_MACDRAWPRO
MacDraw II: v1.0-v1.1, MacDraw Pro: v1.
Definition: MWAWDocument.hxx:125
MWAWDocument::MWAW_T_MACDRAW
@ MWAW_T_MACDRAW
MacDraw: v0-v1.
Definition: MWAWDocument.hxx:124
MWAWDocument::MWAW_T_CLARISRESOLVE
@ MWAW_T_CLARISRESOLVE
Claris Resolve (v1.1)
Definition: MWAWDocument.hxx:104
MWAWDocument::MWAW_T_CLARISWORKS
@ MWAW_T_CLARISWORKS
ClarisWorks/AppleWorks: all versions, export database (as spreadsheet), draw(as text),...
Definition: MWAWDocument.hxx:105
MWAWDocument::MWAW_T_POWERPOINT
@ MWAW_T_POWERPOINT
PowerPoint: v1-v4 and pc v2-v4,95.
Definition: MWAWDocument.hxx:219
MWAWDocument::MWAW_T_WRITENOW
@ MWAW_T_WRITENOW
WriteNow.
Definition: MWAWDocument.hxx:156
MWAWDocument::MWAW_T_MAXWRITE
@ MWAW_T_MAXWRITE
MaxWrite: v1.
Definition: MWAWDocument.hxx:213
MWAWDocument::MWAW_K_PRESENTATION
@ MWAW_K_PRESENTATION
presentation graphic
Definition: MWAWDocument.hxx:85
MWAWDocument::MWAW_T_WRITERPLUS
@ MWAW_T_WRITERPLUS
WriterPlus.
Definition: MWAWDocument.hxx:157
MWAWDocument::MWAW_T_MICROSOFTWORD
@ MWAW_T_MICROSOFTWORD
Microsoft Word (v1-v5)
Definition: MWAWDocument.hxx:132
MWAWHeader::constructHeader
static std::vector< MWAWHeader > constructHeader(MWAWInputStreamPtr input, std::shared_ptr< MWAWRSRCParser > rsrcParser)
tests the input file and returns a header if the file looks like a MWAW document ( trying first to us...
Definition: MWAWHeader.cxx:64
MWAWHeader::getMajorVersion
int getMajorVersion() const
returns the major version
Definition: MWAWHeader.hxx:92
MWAWDocument::MWAW_T_MACDRAFT
@ MWAW_T_MACDRAFT
MacDraft: v1, v4-v5.
Definition: MWAWDocument.hxx:123
MWAWRSRCParser.hxx
libmwaw_internal.hxx
MWAWDocument::MWAW_T_MACDOC
@ MWAW_T_MACDOC
MacDoc (v1.3)
Definition: MWAWDocument.hxx:122
MWAWDocument::MWAW_K_TEXT
@ MWAW_K_TEXT
word processing file
Definition: MWAWDocument.hxx:82
MWAWDocument::MWAW_T_UNKNOWN
@ MWAW_T_UNKNOWN
Unrecognised file type.
Definition: MWAWDocument.hxx:100
MWAWDocument::MWAW_T_STYLE
@ MWAW_T_STYLE
Style: v1.6, v1.9.
Definition: MWAWDocument.hxx:204
MWAWDocument::MWAW_T_BEAGLEWORKS
@ MWAW_T_BEAGLEWORKS
BeagleWorks (v1.0)/WordPerfect Works (v1.2): export database(as spreadsheet), draw,...
Definition: MWAWDocument.hxx:103
MWAWDocument::MWAW_T_HANMACWORDJ
@ MWAW_T_HANMACWORDJ
HanMac Word-J (v2.0.4)
Definition: MWAWDocument.hxx:117
MWAWDocument::MWAW_T_TEXEDIT
@ MWAW_T_TEXEDIT
Tex-Edit (v2)
Definition: MWAWDocument.hxx:153
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:57
MWAWHeader::setType
void setType(Type type)
sets the document type
Definition: MWAWHeader.hxx:108
MWAWDocument::MWAW_T_MACWRITE
@ MWAW_T_MACWRITE
MacWrite.
Definition: MWAWDocument.hxx:134
MWAWHeader::m_version
int m_version
the document version
Definition: MWAWHeader.hxx:126
MWAWHeader::setMajorVersion
void setMajorVersion(int version)
sets the major version
Definition: MWAWHeader.hxx:97
MWAWHeader.hxx
Defines MWAWHeader (document's type, version, kind)
MWAWHeader::Kind
enum MWAWDocument::Kind Kind
Definition: MWAWHeader.hxx:60
MWAWHeader::operator=
MWAWHeader & operator=(MWAWHeader const &)=default
MWAWHeader::getKind
Kind getKind() const
returns the document kind
Definition: MWAWHeader.hxx:114
MWAWDocument::MWAW_T_CORELPAINTER
@ MWAW_T_CORELPAINTER
Corel Painter: Fractal Design Painter Mac v1-v4, MetaCreations Mac v5-v6, Corel Painter Mac v7-v10 an...
Definition: MWAWDocument.hxx:224
MWAWHeader::MWAWHeader
MWAWHeader(MWAWHeader const &)=default
MWAWHeader::m_docType
Type m_docType
the document type
Definition: MWAWHeader.hxx:128
MWAWHeader::~MWAWHeader
virtual ~MWAWHeader()
destructor
Definition: MWAWHeader.cxx:56
MWAWDocument::MWAW_T_CRICKETDRAW
@ MWAW_T_CRICKETDRAW
Cricket Draw: v1.0.1 and v1.1.1.
Definition: MWAWDocument.hxx:210
MWAWHeader::getType
Type getType() const
returns the document type
Definition: MWAWHeader.hxx:103
MWAWDocument::MWAW_T_JAZZLOTUS
@ MWAW_T_JAZZLOTUS
Jazz (Lotus): v1 ; retrieve the spreadsheet and if the resource fork is available,...
Definition: MWAWDocument.hxx:236
MWAWHeader::MWAWHeader
MWAWHeader(MWAWDocument::Type type=MWAWDocument::MWAW_T_UNKNOWN, int version=0, MWAWDocument::Kind kind=MWAWDocument::MWAW_K_TEXT)
constructor given the input
Definition: MWAWHeader.cxx:49
MWAWHeader::Type
enum MWAWDocument::Type Type
Definition: MWAWHeader.hxx:59
libmwaw.hxx
libmwaw API: main libmwaw interface header
MWAWInputStream.hxx
MWAWDocument::MWAW_T_APPLEPICT
@ MWAW_T_APPLEPICT
Apple Pict: v1 or v2.
Definition: MWAWDocument.hxx:201
MWAWHeader::reset
void reset(MWAWDocument::Type type, int vers, Kind kind=MWAWDocument::MWAW_K_TEXT)
resets the data
Definition: MWAWHeader.hxx:84
MWAWDocument::MWAW_T_DRAWINGTABLE
@ MWAW_T_DRAWINGTABLE
Drawing Table: v1.
Definition: MWAWDocument.hxx:232
MWAWDocument::MWAW_T_NISUSWRITER
@ MWAW_T_NISUSWRITER
Nisus Writer (v3.4-v6.5)
Definition: MWAWDocument.hxx:136
MWAWDocument::MWAW_T_RAGTIME
@ MWAW_T_RAGTIME
RagTime: -Mac v2.1-v3.2: done, -all v5.0-v6.5: incomplete, only try to retrieve the picture/shape/tex...
Definition: MWAWDocument.hxx:144
MWAWDocument::MWAW_T_MACPAINT
@ MWAW_T_MACPAINT
MacPaint: v1-v2.
Definition: MWAWDocument.hxx:126
MWAWDocument::MWAW_T_WINGZ
@ MWAW_T_WINGZ
Wingz (v1.1)
Definition: MWAWDocument.hxx:155
MWAWDocument::MWAW_T_ZWRITE
@ MWAW_T_ZWRITE
Z-Write (v1.3)
Definition: MWAWDocument.hxx:159