BeagleWksText.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.
*/
/*
* Text parser to BeagleWorks document
*
*/
#ifndef BEAGLE_WKS_TEXT
# define BEAGLE_WKS_TEXT
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
namespace BeagleWksTextInternal
{
struct Font;
struct Section;
struct State;
class SubDocument;
}
class BeagleWksParser;
class BeagleWksStructManager;
class BeagleWksText
{
friend class BeagleWksParser;
friend class BeagleWksTextInternal::SubDocument;
public:
explicit BeagleWksText(BeagleWksParser &parser);
virtual ~BeagleWksText();
int version() const;
int numPages() const;
protected:
bool createZones(MWAWEntry const &entry);
bool sendMainText();
void flushExtra();
//
// intermediate level
//
void countPages();
std::shared_ptr<MWAWSubDocument> getHeader(int page, int &numSimillar);
std::shared_ptr<MWAWSubDocument> getFooter(int page, int &numSimillar);
void updatePageSpanList(std::vector<MWAWPageSpan> &spanList);
bool sendText(MWAWEntry const &entry);
bool sendHF(int hfId, int sectId);
MWAWFont getFont(BeagleWksTextInternal::Font const &ft) const;
bool readFont(BeagleWksTextInternal::Font &font, long endPos);
bool readParagraph(MWAWParagraph &para, long endPos, bool inSection=false);
bool readSection(MWAWEntry const &entry, BeagleWksTextInternal::Section &section);
private:
BeagleWksText(BeagleWksText const &orig) = delete;
BeagleWksText &operator=(BeagleWksText const &orig) = delete;
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
std::shared_ptr<BeagleWksTextInternal::State> m_state;
std::shared_ptr<BeagleWksStructManager> m_structureManager;
BeagleWksParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
BeagleWksParser
the main class to read a BeagleWorks file
Definition BeagleWksParser.hxx:60
BeagleWksStructManager
the main class to read the structure shared between different BeagleWorks files
Definition BeagleWksStructManager.hxx:58
BeagleWksTextInternal::SubDocument
Internal: the subdocument of a BeagleWksText.
Definition BeagleWksText.cxx:298
BeagleWksText::getHeader
std::shared_ptr< MWAWSubDocument > getHeader(int page, int &numSimillar)
return an header subdocument
Definition BeagleWksText.cxx:393
BeagleWksText::m_mainParser
BeagleWksParser * m_mainParser
the main parser;
Definition BeagleWksText.hxx:126
BeagleWksText::version
int version() const
returns the file version
Definition BeagleWksText.cxx:372
BeagleWksText::BeagleWksText
BeagleWksText(BeagleWksParser &parser)
constructor
Definition BeagleWksText.cxx:360
BeagleWksText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition BeagleWksText.hxx:118
BeagleWksText::~BeagleWksText
virtual ~BeagleWksText()
destructor
Definition BeagleWksText.cxx:368
BeagleWksText::m_structureManager
std::shared_ptr< BeagleWksStructManager > m_structureManager
the structure manager
Definition BeagleWksText.hxx:123
BeagleWksText::getFont
MWAWFont getFont(BeagleWksTextInternal::Font const &ft) const
returns the font
Definition BeagleWksText.cxx:386
BeagleWksText::createZones
bool createZones(MWAWEntry const &entry)
try to create the text zones
Definition BeagleWksText.cxx:454
BeagleWksText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition BeagleWksText.cxx:648
BeagleWksText::updatePageSpanList
void updatePageSpanList(std::vector< MWAWPageSpan > &spanList)
update the page span list
BeagleWksText::readFont
bool readFont(BeagleWksTextInternal::Font &font, long endPos)
try to read a font properties
Definition BeagleWksText.cxx:909
BeagleWksText::sendMainText
bool sendMainText()
send a main zone
Definition BeagleWksText.cxx:623
BeagleWksText::BeagleWksText
BeagleWksText(BeagleWksText const &orig)=delete
BeagleWksText::BeagleWksParser
friend class BeagleWksParser
Definition BeagleWksText.hxx:63
BeagleWksText::operator=
BeagleWksText & operator=(BeagleWksText const &orig)=delete
BeagleWksText::readParagraph
bool readParagraph(MWAWParagraph &para, long endPos, bool inSection=false)
try to read a paragraph knowing end pos
Definition BeagleWksText.cxx:944
BeagleWksText::readSection
bool readSection(MWAWEntry const &entry, BeagleWksTextInternal::Section &section)
try to read a section
Definition BeagleWksText.cxx:1049
BeagleWksText::sendText
bool sendText(MWAWEntry const &entry)
try to send a text zone
Definition BeagleWksText.cxx:668
BeagleWksText::getFooter
std::shared_ptr< MWAWSubDocument > getFooter(int page, int &numSimillar)
return a footer subdocument
Definition BeagleWksText.cxx:420
BeagleWksText::m_state
std::shared_ptr< BeagleWksTextInternal::State > m_state
the state
Definition BeagleWksText.hxx:121
BeagleWksText::sendHF
bool sendHF(int hfId, int sectId)
try to send a header/footer id
Definition BeagleWksText.cxx:628
BeagleWksText::numPages
int numPages() const
returns the number of pages
Definition BeagleWksText.cxx:379
BeagleWksText::countPages
void countPages()
update the number of pages and the number of page by section
Definition BeagleWksText.cxx:547
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
MWAWParagraph
class to store the paragraph properties
Definition MWAWParagraph.hxx:85
libmwaw_internal.hxx
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
BeagleWksTextInternal
Internal: the structures of a BeagleWksText.
Definition BeagleWksText.cxx:61
BeagleWksTextInternal::Font
Internal: a class used to store the font data of a BeagleWksText.
Definition BeagleWksText.cxx:64
BeagleWksTextInternal::Section
Internal: a class used to store the section data of a BeagleWksText.
Definition BeagleWksText.cxx:178
BeagleWksTextInternal::State
Internal: the state of a BeagleWksText.
Definition BeagleWksText.cxx:273