MWAWHeader.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
#ifndef MWAW_HEADER_H
#define MWAW_HEADER_H
#include <vector>
#include <libwpd-stream/libwpd-stream.h>
#include <libmwaw/libmwaw.hxx>
#include "MWAWInputStream.hxx"
class MWAWHeader
{
public:
typedef enum MWAWDocument::DocumentType DocumentType;
typedef enum MWAWDocument::DocumentKind DocumentKind;
MWAWHeader(MWAWDocument::DocumentType type=MWAWDocument::UNKNOWN, int vers=0,
DocumentKind kind = MWAWDocument::K_TEXT);
virtual ~MWAWHeader();
static std::vector<MWAWHeader> constructHeader
(MWAWInputStreamPtr input, shared_ptr<MWAWRSRCParser> rsrcParser);
void reset(MWAWDocument::DocumentType type, int vers,
DocumentKind kind = MWAWDocument::K_TEXT) {
m_docType = type;
m_version = vers;
m_docKind = kind;
}
int getMajorVersion() const {
return m_version;
}
void setMajorVersion(int version) {
m_version=version;
}
DocumentType getType() const {
return m_docType;
}
void setType(DocumentType type) {
m_docType = type;
}
DocumentKind getKind() const {
return m_docKind;
}
void setKind(DocumentKind kind) {
m_docKind = kind;
}
private:
int m_version;
DocumentType m_docType;
DocumentKind m_docKind;
};
#endif /* MWAWHEADER_H */
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWHeader::m_docType
DocumentType m_docType
the document type
Definition: MWAWHeader.hxx:106
MWAWHeader
a function used by MWAWDocument to store the version of document and the input
Definition: MWAWHeader.hxx:47
libmwaw.hxx
MWAWHeader::setKind
void setKind(DocumentKind kind)
sets the document kind
Definition: MWAWHeader.hxx:98
MWAWHeader::getKind
DocumentKind getKind() const
returns the document kind
Definition: MWAWHeader.hxx:94
MWAWHeader::m_version
int m_version
the document version
Definition: MWAWHeader.hxx:104
MWAWHeader::constructHeader
static std::vector< MWAWHeader > constructHeader(MWAWInputStreamPtr input, 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:60
MWAWHeader::setType
void setType(DocumentType type)
sets the document type
Definition: MWAWHeader.hxx:89
MWAWHeader::~MWAWHeader
virtual ~MWAWHeader()
destructor
Definition: MWAWHeader.cxx:52
MWAWHeader::setMajorVersion
void setMajorVersion(int version)
sets the major version
Definition: MWAWHeader.hxx:80
MWAWDocument::DocumentType
DocumentType
an enum to define the different type of document -ACT: Acta (v2 and Classic v1) -BW: BeagleWorks (v1...
Definition: MWAWDocument.hxx:99
MWAWDocument::DocumentKind
DocumentKind
an enum to define the kind of document
Definition: MWAWDocument.hxx:109
MWAWHeader::getType
DocumentType getType() const
returns the document type
Definition: MWAWHeader.hxx:85
MWAWHeader::MWAWHeader
MWAWHeader(MWAWDocument::DocumentType type=MWAWDocument::UNKNOWN, int vers=0, DocumentKind kind=MWAWDocument::K_TEXT)
constructor given the input
Definition: MWAWHeader.cxx:45
MWAWDocument::UNKNOWN
Definition: MWAWDocument.hxx:100
MWAWHeader::getMajorVersion
int getMajorVersion() const
returns the major version
Definition: MWAWHeader.hxx:76
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
MWAWInputStream.hxx
MWAWHeader::DocumentType
enum MWAWDocument::DocumentType DocumentType
Definition: MWAWHeader.hxx:50
MWAWHeader::m_docKind
DocumentKind m_docKind
the document kind
Definition: MWAWHeader.hxx:108
MWAWHeader::DocumentKind
enum MWAWDocument::DocumentKind DocumentKind
Definition: MWAWHeader.hxx:51
MWAWDocument::K_TEXT
Definition: MWAWDocument.hxx:109
MWAWHeader::reset
void reset(MWAWDocument::DocumentType type, int vers, DocumentKind kind=MWAWDocument::K_TEXT)
resets the data
Definition: MWAWHeader.hxx:68