~ubuntu-branches/ubuntu/vivid/fbreader/vivid-proposed

« back to all changes in this revision

Viewing changes to fbreader/src/formats/oeb/XHTMLReader.h

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2008-01-23 16:51:07 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080123165107-5q19etahzd72c33a
Tags: 0.8.12-3
* Add libzlui-maemo which allows using fbreader on the maemo platform, on
  Debian. Thanks, Riku Voipio. Closes: #462299
* makefiles/arch/maemo.mk: Don't build with -thumb. (Riku)
* Loosen dependency versions some more, so it only depends on the current
  upstream version or higher, ignoring the Debian revision.
* Use binary:Version instead of deprecated Source-Version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * FBReader -- electronic book reader
3
 
 * Copyright (C) 2004-2007 Nikolay Pultsin <geometer@mawhrin.net>
4
 
 * Copyright (C) 2005 Mikhail Sobolev <mss@mawhrin.net>
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
 
 * 02110-1301, USA.
20
 
 */
21
 
 
22
 
#ifndef __XHTMLREADER_H__
23
 
#define __XHTMLREADER_H__
24
 
 
25
 
#include <string>
26
 
#include <map>
27
 
#include <stack>
28
 
 
29
 
#include <ZLXMLReader.h>
30
 
 
31
 
class BookReader;
32
 
class XHTMLReader;
33
 
 
34
 
class XHTMLTagAction {
35
 
 
36
 
public:
37
 
        virtual ~XHTMLTagAction();
38
 
        
39
 
        virtual void doAtStart(XHTMLReader &reader, const char **xmlattributes) = 0;
40
 
        virtual void doAtEnd(XHTMLReader &reader) = 0;
41
 
};
42
 
 
43
 
class XHTMLReader : public ZLXMLReader {
44
 
 
45
 
private:
46
 
        static std::map<std::string,XHTMLTagAction*> ourTagActions;
47
 
        static void addAction(const std::string &tag, XHTMLTagAction *action);
48
 
        static void fillTagTable();
49
 
 
50
 
public:
51
 
        XHTMLReader(BookReader &modelReader);
52
 
        bool readFile(const std::string &pathPrefix, const std::string &fileName, const std::string &referenceName);
53
 
 
54
 
        void startElementHandler(const char *tag, const char **attributes);
55
 
        void endElementHandler(const char *tag);
56
 
        void characterDataHandler(const char *text, int len);
57
 
 
58
 
        const std::vector<std::string> &externalDTDs() const;
59
 
 
60
 
private:
61
 
        BookReader &myModelReader;
62
 
        std::string myPathPrefix;
63
 
        std::string myReferenceName;
64
 
        bool myPreformatted;
65
 
 
66
 
        friend class XHTMLTagAction;
67
 
        friend class XHTMLTagParagraphAction;
68
 
        friend class XHTMLTagRestartParagraphAction;
69
 
        friend class XHTMLTagControlAction;
70
 
        friend class XHTMLTagHyperlinkAction;
71
 
        friend class XHTMLTagItemAction;
72
 
        friend class XHTMLTagImageAction;
73
 
        friend class XHTMLTagParagraphWithControlAction;
74
 
        friend class XHTMLTagPreAction;
75
 
};
76
 
 
77
 
#endif /* __XHTMLREADER_H__ */