#include <OXMLi_PackageManager.h>
Public Member Functions | |
void | setContainer (GsfInfile *pPkg) |
GsfInfile * | getContainer () |
UT_Error | parseDocumentStream () |
Parses the "Main Document" part of the package. | |
UT_Error | parseDocumentHdrFtr (const char *id) |
Parses the header or footer with the corresponding id. | |
UT_Error | parseDocumentStyles () |
Parses all the styles associated with the Main Document part of the package. | |
UT_Error | parseDocumentTheme () |
Parses the theme associated with the Main Document part of the package. | |
UT_Error | parseDocumentSettings () |
Parses the settings associated with the Main Document part of the package. | |
UT_Error | parseDocumentNumbering () |
Parses the numbering associated with the Main Document part of the package. | |
UT_Error | parseDocumentFootnotes () |
Parses the footnotes associated with the Main Document part of the package. | |
UT_Error | parseDocumentEndnotes () |
Parses the endnotes associated with the Main Document part of the package. | |
UT_ConstByteBufPtr | parseImageStream (const char *id) |
Parses the image stream and returns the image data. | |
std::string | getPartName (const char *id) |
This function is needed for external targets. | |
Static Public Member Functions | |
static OXMLi_PackageManager * | getNewInstance () |
Clears any previous PackageManager instance and provides a new blank one. | |
static OXMLi_PackageManager * | getInstance () |
Provides a reference to the current package manager. | |
static void | destroyInstance () |
Frees the current PackageManager and all its content from memory. | |
Private Member Functions | |
OXMLi_PackageManager () | |
virtual | ~OXMLi_PackageManager () |
GsfInput * | getChildById (GsfInput *parent, const char *id) |
GsfInput * | getChildByType (GsfInput *parent, OXML_PartType type) |
UT_Error | parseChildById (GsfInput *parent, const char *id, OXMLi_StreamListener *pListener) |
UT_Error | parseChildByType (GsfInput *parent, OXML_PartType type, OXMLi_StreamListener *pListener) |
const char * | _getFullType (OXML_PartType type) |
GsfInput * | _getDocumentStream () |
UT_Error | _parseStream (GsfInput *stream, OXMLi_StreamListener *pListener) |
Private Attributes | |
GsfInfile * | m_pPkg |
GsfInput * | m_pDocPart |
std::map< std::string, bool > | m_parsedParts |
Static Private Attributes | |
static OXMLi_PackageManager * | s_pInst = NULL |
OXMLi_PackageManager::OXMLi_PackageManager | ( | ) | [private] |
Referenced by getInstance().
OXMLi_PackageManager::~OXMLi_PackageManager | ( | ) | [private, virtual] |
References m_parsedParts, m_pDocPart, and m_pPkg.
GsfInput * OXMLi_PackageManager::_getDocumentStream | ( | ) | [private] |
References DOCUMENT_PART, getChildByType(), m_pDocPart, m_pPkg, and UT_return_val_if_fail.
Referenced by getPartName(), parseDocumentEndnotes(), parseDocumentFootnotes(), parseDocumentHdrFtr(), parseDocumentNumbering(), parseDocumentSettings(), parseDocumentStream(), parseDocumentStyles(), parseDocumentTheme(), and parseImageStream().
const char * OXMLi_PackageManager::_getFullType | ( | OXML_PartType | type | ) | [private] |
References ALTERNATEFORMAT_PART, COMMENTS_PART, DOCSETTINGS_PART, DOCUMENT_PART, ENDNOTES_PART, FONTTABLE_PART, FOOTER_PART, FOOTNOTES_PART, GLOSSARY_PART, HEADER_PART, IMAGE_PART, NUMBERING_PART, STYLES_PART, THEME_PART, and WEBSETTINGS_PART.
Referenced by getChildByType().
UT_Error OXMLi_PackageManager::_parseStream | ( | GsfInput * | stream, | |
OXMLi_StreamListener * | pListener | |||
) | [private] |
References OXMLi_StreamListener::getStatus(), m_parsedParts, UT_XML::parse(), UT_XML::setListener(), UT_ERROR, UT_OK, and UT_return_val_if_fail.
Referenced by parseChildById(), parseChildByType(), and parseDocumentStream().
void OXMLi_PackageManager::destroyInstance | ( | ) | [static] |
Frees the current PackageManager and all its content from memory.
References DELETEP, and s_pInst.
Referenced by IE_Imp_OpenXML::_cleanup(), and getNewInstance().
GsfInput * OXMLi_PackageManager::getChildById | ( | GsfInput * | parent, | |
const char * | id | |||
) | [private] |
Referenced by parseChildById(), and parseImageStream().
GsfInput * OXMLi_PackageManager::getChildByType | ( | GsfInput * | parent, | |
OXML_PartType | type | |||
) | [private] |
References _getFullType(), and UT_return_val_if_fail.
Referenced by _getDocumentStream(), and parseChildByType().
GsfInfile* OXMLi_PackageManager::getContainer | ( | ) | [inline] |
References m_pPkg.
OXMLi_PackageManager * OXMLi_PackageManager::getInstance | ( | ) | [static] |
Provides a reference to the current package manager.
References OXMLi_PackageManager(), s_pInst, and UT_DEBUGMSG.
Referenced by OXMLi_ListenerState_Image::addImage(), getNewInstance(), and OXMLi_ListenerState_Common::startElement().
OXMLi_PackageManager * OXMLi_PackageManager::getNewInstance | ( | ) | [static] |
Clears any previous PackageManager instance and provides a new blank one.
References destroyInstance(), and getInstance().
Referenced by IE_Imp_OpenXML::_loadFile().
std::string OXMLi_PackageManager::getPartName | ( | const char * | id | ) |
This function is needed for external targets.
Ex: hyperlinks, bookmarks.
References _getDocumentStream().
Referenced by OXMLi_ListenerState_Common::startElement().
UT_Error OXMLi_PackageManager::parseChildById | ( | GsfInput * | parent, | |
const char * | id, | |||
OXMLi_StreamListener * | pListener | |||
) | [private] |
References _parseStream(), getChildById(), UT_ERROR, and UT_return_val_if_fail.
Referenced by parseDocumentHdrFtr().
UT_Error OXMLi_PackageManager::parseChildByType | ( | GsfInput * | parent, | |
OXML_PartType | type, | |||
OXMLi_StreamListener * | pListener | |||
) | [private] |
References _parseStream(), and getChildByType().
Referenced by parseDocumentEndnotes(), parseDocumentFootnotes(), parseDocumentNumbering(), parseDocumentSettings(), parseDocumentStyles(), and parseDocumentTheme().
UT_Error OXMLi_PackageManager::parseDocumentEndnotes | ( | ) |
Parses the endnotes associated with the Main Document part of the package.
The parser automatically adds the information to the OXML_Document singleton.
References _getDocumentStream(), ENDNOTES_PART, parseChildByType(), OXMLi_StreamListener::setupStates(), UT_ERROR, and UT_return_val_if_fail.
Referenced by IE_Imp_OpenXML::_loadFile().
UT_Error OXMLi_PackageManager::parseDocumentFootnotes | ( | ) |
Parses the footnotes associated with the Main Document part of the package.
The parser automatically adds the information to the OXML_Document singleton.
References _getDocumentStream(), FOOTNOTES_PART, parseChildByType(), OXMLi_StreamListener::setupStates(), UT_ERROR, and UT_return_val_if_fail.
Referenced by IE_Imp_OpenXML::_loadFile().
UT_Error OXMLi_PackageManager::parseDocumentHdrFtr | ( | const char * | id | ) |
Parses the header or footer with the corresponding id.
The parser will append the parsed data to the current OXML_Document.
id | The unique ID string of the header. |
References _getDocumentStream(), HEADER_PART, parseChildById(), OXMLi_StreamListener::setupStates(), UT_ERROR, and UT_return_val_if_fail.
Referenced by OXMLi_ListenerState_Common::startElement().
UT_Error OXMLi_PackageManager::parseDocumentNumbering | ( | ) |
Parses the numbering associated with the Main Document part of the package.
The parser automatically adds the information to the OXML_Document singleton.
References _getDocumentStream(), NUMBERING_PART, parseChildByType(), OXMLi_StreamListener::setupStates(), UT_ERROR, and UT_return_val_if_fail.
Referenced by IE_Imp_OpenXML::_loadFile().
UT_Error OXMLi_PackageManager::parseDocumentSettings | ( | ) |
Parses the settings associated with the Main Document part of the package.
The parser automatically adds the information to the OXML_Document singleton.
References _getDocumentStream(), DOCSETTINGS_PART, parseChildByType(), OXMLi_StreamListener::setupStates(), UT_ERROR, and UT_return_val_if_fail.
Referenced by IE_Imp_OpenXML::_loadFile().
UT_Error OXMLi_PackageManager::parseDocumentStream | ( | ) |
Parses the "Main Document" part of the package.
The parser automatically adds the information to the OXML_Document singleton.
References _getDocumentStream(), _parseStream(), DOCUMENT_PART, and OXMLi_StreamListener::setupStates().
Referenced by IE_Imp_OpenXML::_loadFile().
UT_Error OXMLi_PackageManager::parseDocumentStyles | ( | ) |
Parses all the styles associated with the Main Document part of the package.
The parser automatically adds the information to the OXML_Document singleton.
References _getDocumentStream(), parseChildByType(), OXMLi_StreamListener::setupStates(), STYLES_PART, UT_ERROR, and UT_return_val_if_fail.
Referenced by IE_Imp_OpenXML::_loadFile().
UT_Error OXMLi_PackageManager::parseDocumentTheme | ( | ) |
Parses the theme associated with the Main Document part of the package.
The parser automatically adds the information to the OXML_Document singleton.
References _getDocumentStream(), parseChildByType(), OXMLi_StreamListener::setupStates(), THEME_PART, UT_DEBUGMSG, UT_ERROR, UT_OK, and UT_return_val_if_fail.
Referenced by IE_Imp_OpenXML::_loadFile().
UT_ConstByteBufPtr OXMLi_PackageManager::parseImageStream | ( | const char * | id | ) |
Parses the image stream and returns the image data.
References _getDocumentStream(), getChildById(), and m_parsedParts.
Referenced by OXMLi_ListenerState_Image::addImage().
void OXMLi_PackageManager::setContainer | ( | GsfInfile * | pPkg | ) |
References m_pDocPart, and m_pPkg.
Referenced by IE_Imp_OpenXML::_loadFile().
std::map<std::string, bool> OXMLi_PackageManager::m_parsedParts [private] |
Referenced by _parseStream(), parseImageStream(), and ~OXMLi_PackageManager().
GsfInput* OXMLi_PackageManager::m_pDocPart [private] |
Referenced by _getDocumentStream(), setContainer(), and ~OXMLi_PackageManager().
GsfInfile* OXMLi_PackageManager::m_pPkg [private] |
Referenced by _getDocumentStream(), getContainer(), setContainer(), and ~OXMLi_PackageManager().
OXMLi_PackageManager * OXMLi_PackageManager::s_pInst = NULL [static, private] |
Referenced by destroyInstance(), and getInstance().