Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes

ODi_Abi_Data Class Reference

Represents the <data> section of the resulting AbiWord document from an OpenDocument file import. More...

#include <ODi_Abi_Data.h>

List of all members.

Public Member Functions

 ODi_Abi_Data (PD_Document *pDocument, GsfInfile *pGsfInfile)
 Constructor.
bool addImageDataItem (UT_String &rDataId, const gchar **ppAtts)
 Adds an data item (<d> tag) in the AbiWord document for the specified image.
bool addObjectDataItem (UT_String &rDataId, const gchar **ppAtts, int &pto_Type)
 Adds an data item (<d> tag) in the AbiWord document for the specified image.

Public Attributes

std::set< std::string > m_openAnnotationNames
std::set< std::string > m_rangedAnnotationNames

Private Types

typedef std::map< std::string,
std::string > 
href_id_map_t

Private Member Functions

UT_Error _loadStream (GsfInfile *oo, const char *stream, const UT_ByteBufPtr &buf)
 Code from Dom Lachowicz and/or Robert Staudinger.
void _splitDirectoryAndFileName (const gchar *pHRef, UT_String &dirName, UT_String &fileName) const
 Takes a string like "./ObjectReplacements/Object 1" and split it into subdirectory name ("ObjectReplacements") and file name ("Object 1").

Private Attributes

PD_Documentm_pAbiDocument
GsfInfile * m_pGsfInfile
href_id_map_t m_href_to_id

Detailed Description

Represents the <data> section of the resulting AbiWord document from an OpenDocument file import.


Member Typedef Documentation

typedef std::map<std::string, std::string> ODi_Abi_Data::href_id_map_t [private]

Constructor & Destructor Documentation

ODi_Abi_Data::ODi_Abi_Data ( PD_Document pDocument,
GsfInfile *  pGsfInfile 
)

Constructor.


Member Function Documentation

UT_Error ODi_Abi_Data::_loadStream ( GsfInfile *  oo,
const char *  stream,
const UT_ByteBufPtr buf 
) [private]

Code from Dom Lachowicz and/or Robert Staudinger.

References BUF_SZ, and UT_MIN.

Referenced by addImageDataItem(), and addObjectDataItem().

void ODi_Abi_Data::_splitDirectoryAndFileName ( const gchar *  pHRef,
UT_String dirName,
UT_String fileName 
) const [private]

Takes a string like "./ObjectReplacements/Object 1" and split it into subdirectory name ("ObjectReplacements") and file name ("Object 1").

References UT_String::length(), UT_String::substr(), and UT_ASSERT.

Referenced by addImageDataItem(), and addObjectDataItem().

bool ODi_Abi_Data::addImageDataItem ( UT_String rDataId,
const gchar **  ppAtts 
)

Adds an data item (<d> tag) in the AbiWord document for the specified image.

Parameters:
rDataId Receives the id that has been given to the added data item.
ppAtts The attributes of a <draw:image> element.

Code mainly from Dom Lachowicz and/or Robert Staudinger.

Parameters:
rDataId Receives the id that has been given to the added data item.
ppAtts The attributes of a <draw:image> element.

References _loadStream(), _splitDirectoryAndFileName(), UT_String::c_str(), PD_Document::createDataItem(), abicollab::service::error(), gchar, PD_Document::getUID(), IEGFT_Unknown, UT_UniqueId::Image, IE_ImpGraphic::loadGraphic(), m_href_to_id, m_pAbiDocument, m_pGsfInfile, UT_ASSERT, UT_ASSERT_HARMLESS, UT_getAttribute(), UT_OK, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, and UT_String_sprintf().

Referenced by ODi_Frame_ListenerState::_drawImage(), ODi_Frame_ListenerState::_drawInlineImage(), ODi_Style_Style::_parse_style_background_image(), ODi_Style_PageLayout::_parseBackgroundImage(), and ODi_TextContent_ListenerState::startElement().

bool ODi_Abi_Data::addObjectDataItem ( UT_String rDataId,
const gchar **  ppAtts,
int &  pto_Type 
)

Adds an data item (<d> tag) in the AbiWord document for the specified image.

Code mainly from Dom Lachowicz and/or Robert Staudinger.

Parameters:
rDataId Receives the id that has been given to the added data item.
ppAtts The attributes of a <draw:image> element.

References _loadStream(), _splitDirectoryAndFileName(), UT_String::c_str(), convertLaTeXtoEqn(), convertMathMLtoLaTeX(), PD_Document::createDataItem(), UT_String::empty(), abicollab::service::error(), gchar, PD_Document::getUID(), UT_String::length(), m_href_to_id, m_pAbiDocument, m_pGsfInfile, UT_UniqueId::Math, UT_UTF8String::size(), UT_String::substr(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_getAttribute(), UT_OK, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, UT_String_sprintf(), and UT_UTF8String::utf8_str().

Referenced by ODi_Frame_ListenerState::_drawObject().


Member Data Documentation

std::set< std::string > ODi_Abi_Data::m_openAnnotationNames
GsfInfile* ODi_Abi_Data::m_pGsfInfile [private]
std::set< std::string > ODi_Abi_Data::m_rangedAnnotationNames

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