DMText.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.
*/
/*
* Parser to Nisus text document
*
*/
#ifndef DM_TEXT
# define DM_TEXT
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
namespace DMTextInternal
{
struct Zone;
class SubDocument;
struct State;
}
class DMParser;
class DMText
{
friend class DMTextInternal::SubDocument;
friend class DMParser;
public:
DMText(DMParser &parser);
virtual ~DMText();
int version() const;
int numPages() const;
int numChapters() const;
void sendComment(std::string const &str);
protected:
bool createZones();
bool sendMainText();
void flushExtra();
//
// intermediate level
//
void computeNumPages(DMTextInternal::Zone const &zone) const;
void updatePageSpanList(std::vector<MWAWPageSpan> &spanList);
bool sendText(DMTextInternal::Zone const &zone);
bool readFontNames(MWAWEntry const &entry);
bool readStyles(MWAWEntry const &entry);
bool readTOC(MWAWEntry const &entry);
bool sendTOC();
bool readWindows(MWAWEntry const &entry);
bool readFooter(MWAWEntry const &entry);
bool sendFooter(int zId);
//
// low level
//
void sendString(std::string const &str) const;
private:
DMText(DMText const &orig);
DMText &operator=(DMText const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<DMTextInternal::State> m_state;
DMParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
DMText::readWindows
bool readWindows(MWAWEntry const &entry)
try to read the windows information zone? ( resource Wndo )
Definition: DMText.cxx:800
DMText::sendString
void sendString(std::string const &str) const
send a string to the listener
Definition: DMText.cxx:998
DMText::updatePageSpanList
void updatePageSpanList(std::vector< MWAWPageSpan > &spanList)
update the page span list
Definition: DMText.cxx:321
DMText::sendComment
void sendComment(std::string const &str)
send a string as comment
Definition: DMText.cxx:289
libmwaw_internal.hxx
DMParser
the main class to read a DocMake file
Definition: DMParser.hxx:56
DMTextInternal::SubDocument
Internal: the subdocument of a DMText.
Definition: DMText.cxx:177
DMText::operator=
DMText & operator=(DMText const &orig)
DMText::numPages
int numPages() const
returns the number of pages
Definition: DMText.cxx:266
DMText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: DMText.hxx:141
DMText::m_mainParser
DMParser * m_mainParser
the main parser;
Definition: DMText.hxx:147
DMText::readStyles
bool readStyles(MWAWEntry const &entry)
try to read the styles ( resource styl )
Definition: DMText.cxx:615
DMText::numChapters
int numChapters() const
returns the number of chapter
Definition: DMText.cxx:284
DMText::sendTOC
bool sendTOC()
try to send a TOC zone
Definition: DMText.cxx:684
DMText::~DMText
virtual ~DMText()
destructor
Definition: DMText.cxx:256
DMText::sendFooter
bool sendFooter(int zId)
try to send a footer corresponding to a zone id
Definition: DMText.cxx:862
DMText::version
int version() const
returns the file version
Definition: DMText.cxx:259
DMText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: DMText.cxx:1023
DMText::m_state
shared_ptr< DMTextInternal::State > m_state
the state
Definition: DMText.hxx:144
DMText::createZones
bool createZones()
finds the different text zones
Definition: DMText.cxx:372
DMText::readFontNames
bool readFontNames(MWAWEntry const &entry)
try to read the font name ( resource rQDF )
Definition: DMText.cxx:543
MWAWDebug.hxx
DMText::sendText
bool sendText(DMTextInternal::Zone const &zone)
try to send the text corresponding to a zone
Definition: DMText.cxx:472
DMText::computeNumPages
void computeNumPages(DMTextInternal::Zone const &zone) const
compute the number of page of a zone
Definition: DMText.cxx:304
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
DMText::readFooter
bool readFooter(MWAWEntry const &entry)
try to read the footer zone ( resource foot )
Definition: DMText.cxx:936
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
DMText::readTOC
bool readTOC(MWAWEntry const &entry)
try to read a TOC zone? ( resource cnt# )
Definition: DMText.cxx:738
DMText
the main class to read the text part of DocMaker file
Definition: DMText.hxx:59
DMTextInternal::Zone
Internal: structure to store a the data of a DMText Zone.
Definition: DMText.cxx:122
DMText::DMText
DMText(DMParser &parser)
constructor
Definition: DMText.cxx:251
DMText::sendMainText
bool sendMainText()
send a main zone
Definition: DMText.cxx:1007