#include <ie_imp_XHTML.h>
Public Member Functions | |
IE_Imp_XHTML (PD_Document *pDocument) | |
virtual | ~IE_Imp_XHTML () |
void | startElement (const gchar *name, const gchar **atts) |
void | endElement (const gchar *name) |
virtual void | charData (const gchar *buffer, int length) |
virtual bool | pasteFromBuffer (PD_DocumentRange *pDocRange, const unsigned char *pData, UT_uint32 lenData, const char *szEncoding=0) |
virtual bool | appendStrux (PTStruxType pts, const PP_PropertyVector &attributes) |
virtual bool | appendFmt (const PP_PropertyVector &vecAttributes) |
virtual bool | appendSpan (const UT_UCSChar *p, UT_uint32 length) |
virtual bool | appendObject (PTObjectType pto, const PP_PropertyVector &attributes) |
Protected Member Functions | |
virtual UT_Error | _loadFile (GsfInput *input) |
virtual FG_ConstGraphicPtr | importImage (const gchar *szSrc) |
Private Types | |
enum | listType { L_NONE = 0, L_OL = 1, L_UL = 2 } |
Private Member Functions | |
FG_ConstGraphicPtr | importDataURLImage (const gchar *szData) |
bool | pushInline (const char *props) |
bool | newBlock (const char *style, const char *css, const char *align) |
bool | requireBlock () |
bool | requireSection () |
bool | childOfSection () |
bool | bInTable (void) |
Private Attributes | |
IE_Imp_TableHelperStack * | m_TableHelperStack |
enum IE_Imp_XHTML::listType | m_listType |
UT_uint16 | m_iListID |
UT_uint16 | m_iNewListID |
UT_uint16 | m_iNewImage |
std::stack< UT_uint16 > | m_utsParents |
std::string | m_szBookMarkName |
bool | m_addedPTXSection |
UT_uint16 | m_iPreCount |
UT_Vector | m_divClasses |
UT_GenericVector< UT_UTF8String * > | m_divStyles |
bool | m_bFirstBlock |
bool | m_bInMath |
UT_ByteBufPtr | m_pMathBB |
std::string | m_Title |
enum IE_Imp_XHTML::listType [private] |
IE_Imp_XHTML::IE_Imp_XHTML | ( | PD_Document * | pDocument | ) |
Referenced by pasteFromBuffer().
IE_Imp_XHTML::~IE_Imp_XHTML | ( | ) | [virtual] |
References DELETEP, m_divStyles, m_TableHelperStack, and UT_VECTOR_PURGEALL.
UT_Error IE_Imp_XHTML::_loadFile | ( | GsfInput * | input | ) | [protected, virtual] |
Reimplemented from IE_Imp_XML.
Reimplemented in IE_Imp_HTML.
References recognizeXHTML(), requireBlock(), IE_Imp_XML::setParser(), and size.
bool IE_Imp_XHTML::appendFmt | ( | const PP_PropertyVector & | vecAttributes | ) | [virtual] |
References PD_Document::appendFmt(), appendStrux(), bInTable(), IE_Imp::getDoc(), IE_Imp_TableHelperStack::InlineFormat(), m_addedPTXSection, m_bFirstBlock, m_TableHelperStack, PTX_Block, and PTX_Section.
Referenced by endElement(), pushInline(), and startElement().
bool IE_Imp_XHTML::appendObject | ( | PTObjectType | pto, | |
const PP_PropertyVector & | attributes | |||
) | [virtual] |
References PD_Document::appendObject(), appendStrux(), bInTable(), IE_Imp::getDoc(), m_addedPTXSection, m_bFirstBlock, m_TableHelperStack, IE_Imp_TableHelperStack::Object(), PTX_Block, and PTX_Section.
Referenced by endElement(), and startElement().
bool IE_Imp_XHTML::appendSpan | ( | const UT_UCSChar * | p, | |
UT_uint32 | length | |||
) | [virtual] |
References PD_Document::appendSpan(), appendStrux(), bInTable(), IE_Imp::getDoc(), IE_Imp_TableHelperStack::Inline(), m_addedPTXSection, m_bFirstBlock, m_TableHelperStack, PTX_Block, PTX_Section, and UT_DEBUGMSG.
Referenced by startElement().
bool IE_Imp_XHTML::appendStrux | ( | PTStruxType | pts, | |
const PP_PropertyVector & | attributes | |||
) | [virtual] |
References PD_Document::appendStrux(), bInTable(), IE_Imp_TableHelperStack::Block(), IE_Imp::getDoc(), m_addedPTXSection, m_bFirstBlock, m_TableHelperStack, PTX_Block, PTX_Section, and UT_DEBUGMSG.
Referenced by appendFmt(), appendObject(), appendSpan(), newBlock(), requireSection(), and startElement().
bool IE_Imp_XHTML::bInTable | ( | void | ) | [private] |
Returns true if we're in a table
References m_TableHelperStack, and IE_Imp_TableHelperStack::top().
Referenced by appendFmt(), appendObject(), appendSpan(), and appendStrux().
void IE_Imp_XHTML::charData | ( | const gchar * | buffer, | |
int | length | |||
) | [virtual] |
Reimplemented from IE_Imp_XML.
References IE_Imp_XML::_PS_Block, IE_Imp_XML::_PS_Init, IE_Imp_XML::_PS_MetaData, IE_Imp_XML::_PS_StyleSec, UT_UTF8String::append(), IE_Imp::isPasting(), m_bInMath, IE_Imp_XML::m_bWhiteSignificant, IE_Imp_XML::m_parseState, m_pMathBB, m_Title, requireBlock(), UT_UCS2String::size(), UCS_SPACE, UT_DEBUGMSG, UT_return_if_fail, UT_UTF8String::utf8_str(), X_CheckError, and xxx_UT_DEBUGMSG.
bool IE_Imp_XHTML::childOfSection | ( | ) | [private] |
References UT_GenericVector< T >::getItemCount(), and m_divClasses.
Referenced by startElement().
void IE_Imp_XHTML::endElement | ( | const gchar * | name | ) | [virtual] |
Reimplemented from IE_Imp_XML.
References IE_Imp_XML::_getInlineDepth(), IE_Imp_XML::_mapNameToToken(), IE_Imp_XML::_popInlineFmt(), IE_Imp_XML::_PS_Block, IE_Imp_XML::_PS_MetaData, appendFmt(), appendObject(), DELETEP, IE_Imp::getDoc(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getLastItem(), PD_Document::getUID(), IE_Imp::isPasting(), L_NONE, m_bInMath, IE_Imp_XML::m_bWhiteSignificant, m_divClasses, m_divStyles, m_iListID, m_iPreCount, IE_Imp_XML::m_lenCharDataSeen, m_listType, IE_Imp_XML::m_parseState, m_pMathBB, m_szBookMarkName, m_TableHelperStack, m_Title, m_utsParents, IE_Imp_XML::m_vecInlineFmt, UT_UniqueId::Math, newBlock(), PD_META_KEY_TITLE, UT_GenericVector< T >::pop_back(), PTO_Bookmark, PTO_Hyperlink, PTO_Math, requireSection(), IE_Imp_TableHelperStack::setCaptionOff(), PD_Document::setMetaDataProp(), IE_Imp_TableHelperStack::tableEnd(), IE_Imp_TableHelperStack::tdEnd(), TokenTableSize, TT_A, TT_ADDRESS, TT_B, TT_BLOCKQUOTE, TT_BODY, TT_BR, TT_CAPTION, TT_CITE, TT_CODE, TT_COL, TT_COLGROUP, TT_DD, TT_DFN, TT_DIV, TT_DL, TT_DT, TT_EM, TT_FONT, TT_H1, TT_H2, TT_H3, TT_H4, TT_H5, TT_H6, TT_HEAD, TT_HTML, TT_I, TT_KBD, TT_LI, TT_MATH, TT_META, TT_OL, TT_OTHER, TT_P, TT_PRE, TT_Q, TT_RP, TT_RT, TT_RUBY, TT_S, TT_SAMP, TT_SPAN, TT_STRONG, TT_STYLE, TT_SUB, TT_SUP, TT_TABLE, TT_TBODY, TT_TD, TT_TFOOT, TT_TH, TT_THEAD, TT_TITLE, TT_TR, TT_TT, TT_U, TT_UL, TT_VAR, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_if_fail, UT_std_string_sprintf(), X_CheckDocument, X_CheckError, X_EatIfAlreadyError, and X_VerifyParseState.
Referenced by startElement().
FG_ConstGraphicPtr IE_Imp_XHTML::importDataURLImage | ( | const gchar * | szData | ) | [private] |
References FREEP, IEGFT_Unknown, IE_ImpGraphic::loadGraphic(), UT_DEBUGMSG, UT_OK, and UT_UTF8_Base64Decode().
Referenced by startElement().
FG_ConstGraphicPtr IE_Imp_XHTML::importImage | ( | const gchar * | szSrc | ) | [protected, virtual] |
Reimplemented in IE_Imp_MHT.
References IEGFT_Unknown, IE_ImpGraphic::loadGraphic(), IE_Imp_XML::m_szFileName, UT_DEBUGMSG, UT_go_url_resolve_relative(), and UT_OK.
Referenced by startElement().
bool IE_Imp_XHTML::newBlock | ( | const char * | style, | |
const char * | css, | |||
const char * | align | |||
) | [private] |
References IE_Imp_XML::_data_NewBlock(), IE_Imp_XML::_getInlineDepth(), IE_Imp_XML::_popInlineFmt(), appendStrux(), UT_UTF8String::byteLength(), CSS_MASK_BLOCK, CSS_MASK_INLINE, UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getLastItem(), m_bFirstBlock, m_divStyles, IE_Imp_XML::m_parseState, PT_PROPS_ATTRIBUTE_NAME, PTX_Block, pushInline(), requireSection(), s_parseCSStyle(), style, UT_DEBUGMSG, UT_return_val_if_fail, and UT_UTF8String::utf8_str().
Referenced by endElement(), requireBlock(), and startElement().
bool IE_Imp_XHTML::pasteFromBuffer | ( | PD_DocumentRange * | pDocRange, | |
const unsigned char * | pData, | |||
UT_uint32 | lenData, | |||
const char * | szEncoding = 0 | |||
) | [virtual] |
Reimplemented from IE_Imp_XML.
References UT_ByteBuf::append(), PD_Document::createRawDocument(), PD_Document::finishRawCreation(), PD_Document::getBounds(), IE_Imp::getDoc(), IE_Imp_XHTML(), PD_DocumentRange::m_pDoc, PD_DocumentRange::m_pos1, PD_DocumentRange::m_pos2, UT_XML::parse(), recognizeXHTML(), UT_XML::setListener(), PD_Document::tellListener(), UNREFP, UT_DEBUGMSG, UT_OK, and UT_return_val_if_fail.
Referenced by AP_UnixApp::pasteFromClipboard().
bool IE_Imp_XHTML::pushInline | ( | const char * | props | ) | [private] |
References IE_Imp_XML::_pushInlineFmt(), appendFmt(), IE_Imp_XML::m_vecInlineFmt, and requireBlock().
Referenced by newBlock(), and startElement().
bool IE_Imp_XHTML::requireBlock | ( | void | ) | [private] |
References IE_Imp_XML::_PS_Block, IE_Imp_XML::m_bWhiteSignificant, IE_Imp_XML::m_parseState, and newBlock().
Referenced by _loadFile(), charData(), pushInline(), and startElement().
bool IE_Imp_XHTML::requireSection | ( | ) | [private] |
References IE_Imp_XML::_PS_Sec, appendStrux(), m_addedPTXSection, m_bFirstBlock, IE_Imp_XML::m_parseState, PTX_Section, and UT_return_val_if_fail.
Referenced by endElement(), newBlock(), and startElement().
void IE_Imp_XHTML::startElement | ( | const gchar * | name, | |
const gchar ** | atts | |||
) | [virtual] |
Reimplemented from IE_Imp_XML.
References IE_Imp_XML::_data_CharCount(), IE_Imp_XML::_data_NewBlock(), IE_Imp_XML::_mapNameToToken(), IE_Imp_XML::_PS_Block, IE_Imp_XML::_PS_Init, IE_Imp_XML::_PS_Sec, IE_Imp_XML::_PS_StyleSec, appendFmt(), appendObject(), appendSpan(), appendStrux(), UT_UTF8String::byteLength(), childOfSection(), PD_Document::convertPercentToInches(), CSS_MASK_IMAGE, CSS_MASK_INLINE, d, DIM_IN, DIM_PERCENT, UT_UTF8String::empty(), endElement(), gchar, IE_Imp::getDoc(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getLastItem(), importDataURLImage(), importImage(), IE_Imp::isClipboard(), IE_Imp::isPasting(), L_NONE, L_OL, m_bFirstBlock, m_bInMath, IE_Imp_XML::m_bWasSpace, IE_Imp_XML::m_bWhiteSignificant, m_divClasses, m_divStyles, IE_Imp_XML::m_error, m_iListID, m_iNewImage, m_iNewListID, m_iPreCount, m_listType, IE_Imp_XML::m_parseState, m_pMathBB, m_szBookMarkName, m_TableHelperStack, m_utsParents, newBlock(), PD_META_KEY_CREATOR, PD_META_KEY_KEYWORDS, PD_META_KEY_SUBJECT, PD_META_KEY_TITLE, PP_cloneAndDecodeAttributes(), PP_getAttribute(), PP_std_copyProps(), PTO_Bookmark, PTO_Field, PTO_Hyperlink, PTO_Image, PTX_Block, UT_GenericVector< T >::push_back(), pushInline(), requireBlock(), requireSection(), s_append_color(), s_append_font_family(), s_append_font_size(), s_class_query(), s_parseCSStyle(), s_section_classes, sc_other, IE_Imp_TableHelperStack::setCaptionOn(), PD_Document::setMetaDataProp(), style, szName, IE_Imp_TableHelperStack::tableStart(), IE_Imp_TableHelperStack::tbodyStart(), IE_Imp_TableHelperStack::tdStart(), IE_Imp_TableHelperStack::tfootStart(), IE_Imp_TableHelperStack::theadStart(), TokenTableSize, IE_Imp_TableHelperStack::trStart(), TT_A, TT_ADDRESS, TT_B, TT_BLOCKQUOTE, TT_BODY, TT_BR, TT_CAPTION, TT_CITE, TT_CODE, TT_COL, TT_COLGROUP, TT_DD, TT_DFN, TT_DIV, TT_DL, TT_DT, TT_EM, TT_FONT, TT_H1, TT_H2, TT_H3, TT_H4, TT_H5, TT_H6, TT_HEAD, TT_HTML, TT_I, TT_IMG, TT_KBD, TT_LI, TT_MATH, TT_META, TT_OL, TT_OTHER, TT_P, TT_PRE, TT_Q, TT_RP, TT_RT, TT_RUBY, TT_S, TT_SAMP, TT_SPAN, TT_STRONG, TT_STYLE, TT_SUB, TT_SUP, TT_TABLE, TT_TBODY, TT_TD, TT_TFOOT, TT_TH, TT_THEAD, TT_TITLE, TT_TR, TT_TT, TT_U, TT_UL, TT_VAR, UT_ASSERT, UT_ASSERT_HARMLESS, UT_convertDimensionless(), UT_convertDimensions(), UT_convertToInches(), UT_DEBUGMSG, UT_determineDimension(), UT_std_string_sprintf(), UT_UTF8String::utf8_str(), X_CheckError, X_EatIfAlreadyError, X_VerifyParseState, and xxx_UT_DEBUGMSG.
bool IE_Imp_XHTML::m_addedPTXSection [private] |
Referenced by appendFmt(), appendObject(), appendSpan(), appendStrux(), and requireSection().
bool IE_Imp_XHTML::m_bFirstBlock [private] |
Referenced by appendFmt(), appendObject(), appendSpan(), appendStrux(), newBlock(), requireSection(), and startElement().
bool IE_Imp_XHTML::m_bInMath [private] |
Referenced by charData(), endElement(), and startElement().
UT_Vector IE_Imp_XHTML::m_divClasses [private] |
Referenced by childOfSection(), endElement(), and startElement().
UT_GenericVector<UT_UTF8String *> IE_Imp_XHTML::m_divStyles [private] |
Referenced by endElement(), newBlock(), startElement(), and ~IE_Imp_XHTML().
UT_uint16 IE_Imp_XHTML::m_iListID [private] |
Referenced by endElement(), and startElement().
UT_uint16 IE_Imp_XHTML::m_iNewImage [private] |
Referenced by startElement().
UT_uint16 IE_Imp_XHTML::m_iNewListID [private] |
Referenced by startElement().
UT_uint16 IE_Imp_XHTML::m_iPreCount [private] |
Referenced by endElement(), and startElement().
enum IE_Imp_XHTML::listType IE_Imp_XHTML::m_listType [private] |
Referenced by endElement(), and startElement().
UT_ByteBufPtr IE_Imp_XHTML::m_pMathBB [private] |
Referenced by charData(), endElement(), and startElement().
std::string IE_Imp_XHTML::m_szBookMarkName [private] |
Referenced by endElement(), and startElement().
Referenced by appendFmt(), appendObject(), appendSpan(), appendStrux(), bInTable(), endElement(), startElement(), and ~IE_Imp_XHTML().
std::string IE_Imp_XHTML::m_Title [private] |
Referenced by charData(), and endElement().
std::stack<UT_uint16> IE_Imp_XHTML::m_utsParents [private] |
Referenced by endElement(), and startElement().