Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

OXMLi_PackageManager Class Reference

#include <OXMLi_PackageManager.h>

List of all members.

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_PackageManagergetNewInstance ()
 Clears any previous PackageManager instance and provides a new blank one.
static OXMLi_PackageManagergetInstance ()
 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_PackageManagers_pInst = NULL

Constructor & Destructor Documentation

OXMLi_PackageManager::OXMLi_PackageManager (  )  [private]

Referenced by getInstance().

OXMLi_PackageManager::~OXMLi_PackageManager (  )  [private, virtual]

References m_parsedParts, m_pDocPart, and m_pPkg.


Member Function Documentation

GsfInput * OXMLi_PackageManager::_getDocumentStream (  )  [private]
const char * OXMLi_PackageManager::_getFullType ( OXML_PartType  type  )  [private]
UT_Error OXMLi_PackageManager::_parseStream ( GsfInput *  stream,
OXMLi_StreamListener pListener 
) [private]
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]
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]
UT_Error OXMLi_PackageManager::parseChildByType ( GsfInput *  parent,
OXML_PartType  type,
OXMLi_StreamListener pListener 
) [private]
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.

Parameters:
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().


Member Data Documentation

std::map<std::string, bool> OXMLi_PackageManager::m_parsedParts [private]
GsfInput* OXMLi_PackageManager::m_pDocPart [private]
GsfInfile* OXMLi_PackageManager::m_pPkg [private]

Referenced by destroyInstance(), and getInstance().


The documentation for this class was generated from the following files: