MoreText.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 More document
*
*/
#ifndef MORE_TEXT
# define MORE_TEXT
#include <set>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
struct MWAWListLevel;
namespace MoreTextInternal
{
struct Outline;
struct Paragraph;
struct State;
class SubDocument;
}
class MoreParser;
class MoreText
{
friend class MoreParser;
friend class MoreTextInternal::SubDocument;
public:
explicit MoreText(MoreParser &parser);
virtual ~MoreText();
int version() const;
int numPages() const;
protected:
bool createZones();
bool sendMainText();
std::shared_ptr<MWAWSubDocument> getHeaderFooter(bool header);
//
// intermediate level
//
bool readTopic(MWAWEntry const &entry);
int getLastTopicChildId(int tId) const;
int checkTopicList(size_t tId, std::set<size_t> &parent);
bool readComment(MWAWEntry const &entry);
bool readSpeakerNote(MWAWEntry const &entry);
bool sendText(MWAWEntry const &entry, MWAWFont const &font);
bool sendComment(int cId);
bool sendSpeakerNote(int nId);
bool sendTopic(int tId, int dLevel, std::vector<MWAWParagraph> &paraStack);
bool readFonts(MWAWEntry const &entry);
bool readOutlineList(MWAWEntry const &entry);
bool readOutline(MWAWEntry const &entry, MoreTextInternal::Outline &outline);
bool readFont(MWAWEntry const &entry, std::string &fName, int &fId);
bool readTabs(MWAWEntry const &entry, MoreTextInternal::Paragraph &para, std::string &mess);
bool readCustomListLevel(MWAWEntry const &entry, MWAWListLevel &level);
bool parseUnknown(MWAWEntry const &entry, long fDecal);
private:
MoreText(MoreText const &orig) = delete;
MoreText &operator=(MoreText const &orig) = delete;
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
std::shared_ptr<MoreTextInternal::State> m_state;
MoreParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWFont
Class to store font.
Definition MWAWFont.hxx:44
MoreParser
the main class to read a More file
Definition MoreParser.hxx:81
MoreTextInternal::SubDocument
Internal: the subdocument of a MoreText.
Definition MoreText.cxx:447
MoreText::readOutline
bool readOutline(MWAWEntry const &entry, MoreTextInternal::Outline &outline)
read a outline
Definition MoreText.cxx:1528
MoreText::version
int version() const
returns the file version
Definition MoreText.cxx:534
MoreText::sendTopic
bool sendTopic(int tId, int dLevel, std::vector< MWAWParagraph > &paraStack)
try to send a topic knowing the topic id
Definition MoreText.cxx:924
MoreText::readSpeakerNote
bool readSpeakerNote(MWAWEntry const &entry)
read the list of speaker note
Definition MoreText.cxx:832
MoreText::readOutlineList
bool readOutlineList(MWAWEntry const &entry)
read the list of outlines
Definition MoreText.cxx:1478
MoreText::sendComment
bool sendComment(int cId)
try to send a comment knowing the comment id
Definition MoreText.cxx:896
MoreText::readCustomListLevel
bool readCustomListLevel(MWAWEntry const &entry, MWAWListLevel &level)
read a custom list level
Definition MoreText.cxx:1906
MoreText::sendMainText
bool sendMainText()
send a main zone
Definition MoreText.cxx:869
MoreText::checkTopicList
int checkTopicList(size_t tId, std::set< size_t > &parent)
check that the topic and its child does not loop (if so, cut some edge), return the number of breakpa...
Definition MoreText.cxx:669
MoreText::~MoreText
virtual ~MoreText()
destructor
Definition MoreText.cxx:530
MoreText::readComment
bool readComment(MWAWEntry const &entry)
read the list of comment/header/footer zones
Definition MoreText.cxx:784
MoreText::sendSpeakerNote
bool sendSpeakerNote(int nId)
try to send a speakernote knowing the note id
Definition MoreText.cxx:910
MoreText::getLastTopicChildId
int getLastTopicChildId(int tId) const
returns the last sub topic id corresponding to a topic and its child
Definition MoreText.cxx:655
MoreText::createZones
bool createZones()
try to create the text zones using read data
Definition MoreText.cxx:575
MoreText::MoreText
MoreText(MoreParser &parser)
constructor
Definition MoreText.cxx:523
MoreText::operator=
MoreText & operator=(MoreText const &orig)=delete
MoreText::readFont
bool readFont(MWAWEntry const &entry, std::string &fName, int &fId)
try to read a fontname
Definition MoreText.cxx:1876
MoreText::readFonts
bool readFonts(MWAWEntry const &entry)
read the list of fonts
Definition MoreText.cxx:1418
MoreText::MoreParser
friend class MoreParser
Definition MoreText.hxx:66
MoreText::getHeaderFooter
std::shared_ptr< MWAWSubDocument > getHeaderFooter(bool header)
returns a subdocument to send the header or the footer
Definition MoreText.cxx:551
MoreText::numPages
int numPages() const
returns the number of pages
Definition MoreText.cxx:541
MoreText::readTabs
bool readTabs(MWAWEntry const &entry, MoreTextInternal::Paragraph &para, std::string &mess)
try to read some tabs
Definition MoreText.cxx:2028
MoreText::m_mainParser
MoreParser * m_mainParser
the main parser;
Definition MoreText.hxx:158
MoreText::m_state
std::shared_ptr< MoreTextInternal::State > m_state
the state
Definition MoreText.hxx:155
MoreText::parseUnknown
bool parseUnknown(MWAWEntry const &entry, long fDecal)
try to read either a font, a fontname, a pattern, a int
Definition MoreText.cxx:2104
MoreText::MoreText
MoreText(MoreText const &orig)=delete
MoreText::readTopic
bool readTopic(MWAWEntry const &entry)
read the list of topic positions
Definition MoreText.cxx:710
MoreText::sendText
bool sendText(MWAWEntry const &entry, MWAWFont const &font)
send a text entry
Definition MoreText.cxx:1017
MoreText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition MoreText.hxx:152
libmwaw_internal.hxx
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
MoreTextInternal
Internal: the structures of a MoreText.
Definition MoreText.cxx:61
MWAWListLevel
small structure to keep information about a list level
Definition MWAWList.hxx:46
MoreTextInternal::Outline
Internal: the outline data of a MoreText.
Definition MoreText.cxx:194
MoreTextInternal::Paragraph
Internal: the paragraph of a MoreText.
Definition MoreText.cxx:66
MoreTextInternal::State
Internal: the state of a MoreText.
Definition MoreText.cxx:410