| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef IE_EXP_EPUB_H_ |
| 21 |
#define IE_EXP_EPUB_H_ |
| 22 |
|
| 23 |
#include "ie_exp_EPUB_EPUB3Writer.h" |
| 24 |
#include "ap_Dialog_EpubExportOptions.h" |
| 25 |
|
| 26 |
#include <string> |
| 27 |
#include <vector> |
| 28 |
#include <algorithm> |
| 29 |
|
| 30 |
#include <gsf/gsf-output-stdio.h> |
| 31 |
#include <gsf/gsf-outfile.h> |
| 32 |
#include <gsf/gsf-outfile-zip.h> |
| 33 |
#include <gsf/gsf-output.h> |
| 34 |
#include <gsf/gsf-libxml.h> |
| 35 |
#include <gsf/gsf-infile-stdio.h> |
| 36 |
#include <gsf/gsf-infile.h> |
| 37 |
|
| 38 |
#include <ie_exp.h> |
| 39 |
#include <ie_exp_HTML.h> |
| 40 |
#include <pd_Document.h> |
| 41 |
#include <ut_go_file.h> |
| 42 |
#include <ut_path.h> |
| 43 |
#include <ie_TOC.h> |
| 44 |
|
| 45 |
#define EPUB_MIMETYPE "application/epub+zip" |
| 46 |
#define OPF_MIMETYPE "application/oebps-package+xml" |
| 47 |
#define OCF201_NAMESPACE "urn:oasis:names:tc:opendocument:xmlns:container" |
| 48 |
#define OPF201_NAMESPACE "http://www.idpf.org/2007/opf" |
| 49 |
#define OPS201_NAMESPACE "http://www.idpf.org/2007/ops" |
| 50 |
#define EPUB3_PACKAGE_PROFILE "http://www.idpf.org/epub/30/profile/package/" |
| 51 |
#define DC_NAMESPACE "http://purl.org/dc/elements/1.1/" |
| 52 |
#define NCX_NAMESPACE "http://www.daisy.org/z3986/2005/ncx/" |
| 53 |
class IE_Exp_EPUB: public IE_Exp |
| 54 |
{ |
| 55 |
|
| 56 |
public: |
| 57 |
IE_Exp_EPUB(PD_Document * pDocument); |
| 58 |
virtual ~IE_Exp_EPUB(); |
| 59 |
|
| 60 |
protected: |
| 61 |
virtual UT_Error _writeDocument(); |
| 62 |
|
| 63 |
private: |
| 64 |
UT_Error writeStructure(); |
| 65 |
UT_Error writeNavigation(); |
| 66 |
UT_Error writeContainer(); |
| 67 |
UT_Error package(); |
| 68 |
UT_Error compress(); |
| 69 |
|
| 70 |
|
| 71 |
UT_Error EPUB2_writeStructure(); |
| 72 |
UT_Error EPUB2_writeNavigation(); |
| 73 |
|
| 74 |
|
| 75 |
UT_Error EPUB3_writeStructure(); |
| 76 |
UT_Error EPUB3_writeNavigation(); |
| 77 |
|
| 78 |
|
| 79 |
std::string getAuthor() const; |
| 80 |
std::string getTitle() const; |
| 81 |
std::string getLanguage() const; |
| 82 |
|
| 83 |
UT_Error doOptions(); |
| 84 |
void registerDialogs(); |
| 85 |
|
| 86 |
static std::vector<std::string> getFileList(const std::string &directory); |
| 87 |
static void closeNTags(GsfXMLOut* xml, int n); |
| 88 |
static std::string escapeForId(const std::string & src); |
| 89 |
static std::string getMimeType(const std::string &uri); |
| 90 |
|
| 91 |
std::string m_baseTempDir; |
| 92 |
std::string m_oebpsDir; |
| 93 |
GsfOutfile* m_root; |
| 94 |
GsfOutput* m_oebps; |
| 95 |
IE_Exp_HTML *m_pHmtlExporter; |
| 96 |
|
| 97 |
std::vector<std::string> m_opsId; |
| 98 |
|
| 99 |
XAP_Dialog_Id m_iDialogExport; |
| 100 |
XAP_Exp_EpubExportOptions m_exp_opt; |
| 101 |
}; |
| 102 |
|
| 103 |
#endif |