Class used to import EPUB files. More...
#include <ie_imp_EPUB.h>
Public Member Functions | |
IE_Imp_EPUB (PD_Document *pDocument) | |
virtual | ~IE_Imp_EPUB () |
virtual bool | pasteFromBuffer (PD_DocumentRange *pDocRange, const unsigned char *pData, UT_uint32 lenData, const char *szEncoding=0) |
Protected Member Functions | |
virtual UT_Error | _loadFile (GsfInput *input) |
Private Member Functions | |
UT_Error | readMetadata () |
UT_Error | readPackage () |
UT_Error | uncompress () |
UT_Error | readStructure () |
Static Private Member Functions | |
static GsfOutput * | createFileByPath (const char *path) |
Private Attributes | |
GsfInfile * | m_epub |
std::string | m_rootfilePath |
std::string | m_tmpDir |
std::string | m_opsDir |
std::vector< std::string > | m_spine |
std::map< std::string, std::string > | m_manifestItems |
Class used to import EPUB files.
IE_Imp_EPUB::IE_Imp_EPUB | ( | PD_Document * | pDocument | ) |
Referenced by pasteFromBuffer().
IE_Imp_EPUB::~IE_Imp_EPUB | ( | ) | [virtual] |
UT_Error IE_Imp_EPUB::_loadFile | ( | GsfInput * | input | ) | [protected, virtual] |
Implements IE_Imp.
References m_epub, readMetadata(), readPackage(), readStructure(), uncompress(), UT_DEBUGMSG, and UT_OK.
GsfOutput * IE_Imp_EPUB::createFileByPath | ( | const char * | path | ) | [static, private] |
References gchar, UT_go_directory_create(), UT_go_file_create(), UT_go_file_exists(), and UT_go_filename_to_uri().
Referenced by uncompress().
bool IE_Imp_EPUB::pasteFromBuffer | ( | PD_DocumentRange * | pDocRange, | |
const unsigned char * | pData, | |||
UT_uint32 | lenData, | |||
const char * | szEncoding = 0 | |||
) | [virtual] |
Reimplemented from IE_Imp.
References PD_Document::createRawDocument(), PD_Document::finishRawCreation(), IE_Imp::getDoc(), IE_Imp_EPUB(), IE_Imp::loadFile(), PD_DocumentRange::m_pDoc, PD_DocumentRange::m_pos1, PD_DocumentRange::m_pos2, PD_Document::tellListener(), UNREFP, and UT_return_val_if_fail.
UT_Error IE_Imp_EPUB::readMetadata | ( | ) | [private] |
References gchar, ContainerListener::getRootFilePath(), m_epub, m_rootfilePath, UT_XML::parse(), UT_XML::setListener(), UT_XML::sniff(), and UT_DEBUGMSG.
Referenced by _loadFile().
UT_Error IE_Imp_EPUB::readPackage | ( | ) | [private] |
References gchar, OpfListener::getManifestItems(), OpfListener::getSpine(), m_epub, m_manifestItems, m_opsDir, m_rootfilePath, m_spine, UT_XML::parse(), UT_XML::setListener(), UT_XML::sniff(), and UT_DEBUGMSG.
Referenced by _loadFile().
UT_Error IE_Imp_EPUB::readStructure | ( | ) | [private] |
References PD_Document::createRawDocument(), DELETEP, IE_Imp::fileTypeForSuffix(), PD_Document::finishRawCreation(), XAP_App::getApp(), PD_Document::getBounds(), IE_Imp::getDoc(), XAP_App::getPrefs(), PD_Document::importFile(), PD_Document::insertStrux(), m_manifestItems, m_spine, m_tmpDir, PTX_Block, PTX_Section, XAP_Prefs::setIgnoreNextRecent(), PD_Document::tellListener(), UNREFP, UT_DEBUGMSG, UT_go_file_open(), and UT_OK.
Referenced by _loadFile().
UT_Error IE_Imp_EPUB::uncompress | ( | ) | [private] |
References createFileByPath(), gchar, IE_Imp::getDoc(), AD_Document::getDocUUIDString(), m_epub, m_manifestItems, m_opsDir, m_tmpDir, UT_DEBUGMSG, UT_go_directory_create(), UT_go_filename_from_uri(), and UT_go_filename_to_uri().
Referenced by _loadFile().
GsfInfile* IE_Imp_EPUB::m_epub [private] |
Referenced by _loadFile(), readMetadata(), readPackage(), and uncompress().
std::map<std::string, std::string> IE_Imp_EPUB::m_manifestItems [private] |
Referenced by readPackage(), readStructure(), and uncompress().
std::string IE_Imp_EPUB::m_opsDir [private] |
Referenced by readPackage(), and uncompress().
std::string IE_Imp_EPUB::m_rootfilePath [private] |
Referenced by readMetadata(), and readPackage().
std::vector<std::string> IE_Imp_EPUB::m_spine [private] |
Referenced by readPackage(), and readStructure().
std::string IE_Imp_EPUB::m_tmpDir [private] |
Referenced by readStructure(), and uncompress().