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
20 #ifndef __ORBOOKREADER_H__
21 #define __ORBOOKREADER_H__
28 #include <ZLXMLReader.h>
30 #include "../../bookmodel/BookReader.h"
32 class ORBookReader
: public ZLXMLReader
{
35 ORBookReader(BookModel
&model
);
36 bool readBook(const std::string
&fileName
);
38 void startElementHandler(const char *tag
, const char **attributes
);
39 void endElementHandler(const char *tag
);
40 void characterDataHandler(const char *text
, int len
);
52 BookReader myModelReader
;
55 std::string myFilePrefix
;
56 std::map
<std::string
,std::string
> myResources
;
57 std::string myCoverReference
;
58 std::set
<std::string
> myHtmlFileIDs
;
59 std::map
<std::string
,std::string
> myImageIDs
;
60 std::vector
<std::string
> myHtmlFilesOrder
;
63 TOCItem(const std::string
&reference
, const std::string
&text
, int level
) : Reference(reference
), Text(text
), Level(level
) {
66 std::string Reference
;
70 std::vector
<TOCItem
> myTOC
;
72 std::string myTOCReference
;
74 std::string myTOCTitle
;
77 #endif /* __ORBOOKREADER_H__ */