BeagleWksText.hxx Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

BeagleWksText.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 /*
35 * Text parser to BeagleWorks document
36 *
37 */
38 #ifndef BEAGLE_WKS_TEXT
39 # define BEAGLE_WKS_TEXT
40
41 #include "libmwaw_internal.hxx"
42 #include "MWAWDebug.hxx"
43
44 namespace BeagleWksTextInternal
45 {
46 struct Font;
47 struct Section;
48 struct State;
49
50 class SubDocument;
51 }
52
53 class BeagleWksParser;
54 class BeagleWksStructManager;
55
61 class BeagleWksText
62 {
63 friend class BeagleWksParser;
64 friend class BeagleWksTextInternal::SubDocument;
65 public:
67 BeagleWksText(BeagleWksParser &parser);
69 virtual ~BeagleWksText();
70
72 int version() const;
73
75 int numPages() const;
76
77 protected:
79 bool createZones(MWAWEntry &entry);
81 bool sendMainText();
83 void flushExtra();
84
85 //
86 // intermediate level
87 //
88
90 void countPages();
92 shared_ptr<MWAWSubDocument> getHeader(int page, int &numSimillar);
94 shared_ptr<MWAWSubDocument> getFooter(int page, int &numSimillar);
96 void updatePageSpanList(std::vector<MWAWPageSpan> &spanList);
98 bool sendText(MWAWEntry entry);
100 bool sendHF(int hfId, int sectId);
102 MWAWFont getFont(BeagleWksTextInternal::Font const &ft) const;
104 bool readFont(BeagleWksTextInternal::Font &font, long endPos);
106 bool readParagraph(MWAWParagraph &para, long endPos, bool inSection=false);
108 bool readSection(MWAWEntry const &entry, BeagleWksTextInternal::Section &section);
109 private:
110 BeagleWksText(BeagleWksText const &orig);
111 BeagleWksText &operator=(BeagleWksText const &orig);
112
113 protected:
114 //
115 // data
116 //
118 MWAWParserStatePtr m_parserState;
119
121 shared_ptr<BeagleWksTextInternal::State> m_state;
123 shared_ptr<BeagleWksStructManager> m_structureManager;
124
126 BeagleWksParser *m_mainParser;
127 };
128 #endif
129 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
BeagleWksText::sendText
bool sendText(MWAWEntry entry)
try to send a text zone
Definition: BeagleWksText.cxx:641
BeagleWksTextInternal::Font
Internal: a class used to store the font data of a BeagleWksText.
Definition: BeagleWksText.cxx:64
BeagleWksText::updatePageSpanList
void updatePageSpanList(std::vector< MWAWPageSpan > &spanList)
update the page span list
BeagleWksText::version
int version() const
returns the file version
Definition: BeagleWksText.cxx:346
libmwaw_internal.hxx
BeagleWksParser
the main class to read a BeagleWorks file
Definition: BeagleWksParser.hxx:59
BeagleWksTextInternal
Internal: the structures of a BeagleWksText.
Definition: BeagleWksText.cxx:60
BeagleWksText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: BeagleWksText.cxx:619
BeagleWksTextInternal::Section
Internal: a class used to store the section data of a BeagleWksText.
Definition: BeagleWksText.cxx:173
BeagleWksText::readSection
bool readSection(MWAWEntry const &entry, BeagleWksTextInternal::Section &section)
try to read a section
Definition: BeagleWksText.cxx:1022
BeagleWksText::m_mainParser
BeagleWksParser * m_mainParser
the main parser;
Definition: BeagleWksText.hxx:126
BeagleWksText::readParagraph
bool readParagraph(MWAWParagraph &para, long endPos, bool inSection=false)
try to read a paragraph knowing end pos
Definition: BeagleWksText.cxx:917
BeagleWksText::operator=
BeagleWksText & operator=(BeagleWksText const &orig)
BeagleWksText::getHeader
shared_ptr< MWAWSubDocument > getHeader(int page, int &numSimillar)
return an header subdocument
Definition: BeagleWksText.cxx:367
BeagleWksText
the main class to read the text part of BeagleWorks Text file
Definition: BeagleWksText.hxx:61
BeagleWksText::sendHF
bool sendHF(int hfId, int sectId)
try to send a header/footer id
Definition: BeagleWksText.cxx:599
BeagleWksText::countPages
void countPages()
update the number of pages and the number of page by section
Definition: BeagleWksText.cxx:518
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
BeagleWksText::m_state
shared_ptr< BeagleWksTextInternal::State > m_state
the state
Definition: BeagleWksText.hxx:121
BeagleWksText::sendMainText
bool sendMainText()
send a main zone
Definition: BeagleWksText.cxx:594
BeagleWksText::createZones
bool createZones(MWAWEntry &entry)
try to create the text zones
Definition: BeagleWksText.cxx:428
BeagleWksText::~BeagleWksText
virtual ~BeagleWksText()
destructor
Definition: BeagleWksText.cxx:343
MWAWDebug.hxx
BeagleWksText::readFont
bool readFont(BeagleWksTextInternal::Font &font, long endPos)
try to read a font properties
Definition: BeagleWksText.cxx:882
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:82
BeagleWksStructManager
the main class to read the structure shared between different BeagleWorks files
Definition: BeagleWksStructManager.hxx:56
BeagleWksTextInternal::SubDocument
Internal: the subdocument of a BeagleWksText.
Definition: BeagleWksText.cxx:272
BeagleWksText::numPages
int numPages() const
returns the number of pages
Definition: BeagleWksText.cxx:353
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:445
BeagleWksText::m_structureManager
shared_ptr< BeagleWksStructManager > m_structureManager
the structure manager
Definition: BeagleWksText.hxx:123
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
BeagleWksText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: BeagleWksText.hxx:118
BeagleWksText::getFooter
shared_ptr< MWAWSubDocument > getFooter(int page, int &numSimillar)
return a footer subdocument
Definition: BeagleWksText.cxx:394
BeagleWksText::getFont
MWAWFont getFont(BeagleWksTextInternal::Font const &ft) const
returns the font
Definition: BeagleWksText.cxx:360
BeagleWksText::BeagleWksText
BeagleWksText(BeagleWksParser &parser)
constructor
Definition: BeagleWksText.cxx:337