/* AbiSource * * Copyright (C) 2011 Volodymyr Rudyj * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #ifndef IE_EXP_EPUB_H_ #define IE_EXP_EPUB_H_ #include #include #include // External includes #include #include #include #include #include #include #include // Abiword includes #include #include #include #include #include #include #include #define EPUB_MIMETYPE "application/epub+zip" #define OPF_MIMETYPE "application/oebps-package+xml" #define OCF201_NAMESPACE "urn:oasis:names:tc:opendocument:xmlns:container" #define OPF201_NAMESPACE "http://www.idpf.org/2007/opf" #define DC_NAMESPACE "http://purl.org/dc/elements/1.1/" #define NCX_NAMESPACE "http://www.daisy.org/z3986/2005/ncx/" class IE_Exp_EPUB: public IE_Exp { public: IE_Exp_EPUB(PD_Document * pDocument); virtual ~IE_Exp_EPUB(); protected: virtual UT_Error _writeDocument(); private: UT_Error writeStructure(); UT_Error writeNavigation(); UT_Error writeContainer(); UT_Error package(); UT_Error compress(); UT_UTF8String getAuthor() const; UT_UTF8String getTitle() const; UT_UTF8String getLanguage() const; static std::vector getFileList( const UT_UTF8String &directory); static void closeNTags(GsfXMLOut* xml, int n); static UT_UTF8String escapeForId(const UT_UTF8String & src); static UT_UTF8String getMimeType(const UT_UTF8String &uri); UT_UTF8String m_baseTempDir; UT_UTF8String m_oebpsDir; GsfOutfile* m_root; GsfOutput* m_oebps; IE_Exp_HTML *m_pie; // Array with file id`s in linear reading order std::vector m_opsId; }; #endif /* IE_EXP_EPUB_H_ */