gui
[lbook_fbreader.git] / fbreader / src / formats / fb2 / FB2Reader.h
blob3e440e9003a8e03ceb6e44f898ee595636a01055
1 /*
2 * Copyright (C) 2004-2008 Geometer Plus <contact@geometerplus.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
20 #ifndef __FB2READER_H__
21 #define __FB2READER_H__
23 #include <ZLXMLReader.h>
25 class FB2Reader : public ZLXMLReader {
27 public:
28 struct Tag {
29 const char *tagName;
30 int tagCode;
33 public:
34 virtual int tag(const char *name);
36 virtual void startElementHandler(int tag, const char **attributes) = 0;
37 virtual void endElementHandler(int tag) = 0;
39 private:
40 void startElementHandler(const char *tag, const char **attributes);
41 void endElementHandler(const char *tag);
43 public:
44 enum TagCode {
45 _P,
46 _SUBTITLE,
47 _CITE,
48 _TEXT_AUTHOR,
49 _DATE,
50 _SECTION,
51 _V,
52 _TITLE,
53 _POEM,
54 _STANZA,
55 _EPIGRAPH,
56 _ANNOTATION,
57 _SUB,
58 _SUP,
59 _CODE,
60 _STRIKETHROUGH,
61 _STRONG,
62 _EMPHASIS,
63 _A,
64 _IMAGE,
65 _BINARY,
66 _BODY,
67 _EMPTY_LINE,
68 _TITLE_INFO,
69 _BOOK_TITLE,
70 _AUTHOR,
71 _LANG,
72 _FIRST_NAME,
73 _MIDDLE_NAME,
74 _LAST_NAME,
75 _COVERPAGE,
76 _SEQUENCE,
77 _UNKNOWN
80 protected:
81 FB2Reader();
83 public:
84 ~FB2Reader();
87 inline FB2Reader::FB2Reader() {}
88 inline FB2Reader::~FB2Reader() {}
90 #endif /* __FB2READER_H__ */