Handles the mess involved in PL_Listener event handling translating then into simple and clean calls to ODe_AbiDocListenerImpl. More...
#include <ODe_AbiDocListener.h>
Handles the mess involved in PL_Listener event handling translating then into simple and clean calls to ODe_AbiDocListenerImpl.
ODe_AbiDocListener::ODe_AbiDocListener | ( | PD_Document * | pDocument, | |
ODe_AbiDocListenerImpl * | pListenerImpl, | |||
bool | deleteWhenPop | |||
) |
Constructor.
deleteWhenPop | "true" if the implementation object is to be deleted when it pops itself. |
References UT_ASSERT_HARMLESS.
ODe_AbiDocListener::~ODe_AbiDocListener | ( | ) | [virtual] |
Destructor.
References DELETEP, UT_GenericVector< T >::getItemCount(), m_deleteCurrentWhenPop, m_implStack, m_pCurrentImpl, and UT_ASSERT.
void ODe_AbiDocListener::_appendSpaces | ( | UT_UTF8String * | sBuf, | |
UT_uint32 | count | |||
) | [private] |
References UT_UTF8String_sprintf().
Referenced by _outputData().
void ODe_AbiDocListener::_closeAnnotation | ( | ) | [private] |
References ODe_AbiDocListenerImpl::closeAnnotation(), m_bInAnnotation, m_bInBlock, m_currentAnnotationName, and m_pCurrentImpl.
Referenced by populateStrux().
void ODe_AbiDocListener::_closeBlock | ( | void | ) | [private] |
References ODe_AbiDocListenerImpl::closeBlock(), m_bInBlock, and m_pCurrentImpl.
Referenced by finished(), and populateStrux().
void ODe_AbiDocListener::_closeBookmark | ( | UT_UTF8String & | sBookmarkName | ) | [private] |
void ODe_AbiDocListener::_closeBookmark | ( | PT_AttrPropIndex | api | ) | [private] |
References _closeSpan(), UT_UTF8String::clear(), ODe_AbiDocListenerImpl::closeBookmark(), PD_Document::getAttrProp(), m_bInBookmark, m_bookmarkName, m_pCurrentImpl, and m_pDocument.
Referenced by finished(), populate(), and populateStrux().
void ODe_AbiDocListener::_closeCell | ( | bool | recursiveCall = false |
) | [private] |
void ODe_AbiDocListener::_closeEndnote | ( | ) | [private] |
void ODe_AbiDocListener::_closeField | ( | void | ) | [private] |
References _closeSpan(), UT_UTF8String::clear(), ODe_AbiDocListenerImpl::closeField(), UT_UTF8String::length(), m_currentFieldType, m_pCurrentField, and m_pCurrentImpl.
Referenced by finished(), populate(), and populateStrux().
void ODe_AbiDocListener::_closeFootnote | ( | ) | [private] |
void ODe_AbiDocListener::_closeFrame | ( | ) | [private] |
void ODe_AbiDocListener::_closeHyperlink | ( | ) | [private] |
References _closeSpan(), ODe_AbiDocListenerImpl::closeHyperlink(), m_bInHyperlink, and m_pCurrentImpl.
Referenced by finished(), populate(), and populateStrux().
void ODe_AbiDocListener::_closeRDFAnchor | ( | PT_AttrPropIndex | api | ) | [private] |
References _closeSpan(), ODe_AbiDocListenerImpl::closeRDFAnchor(), PD_Document::getAttrProp(), m_pCurrentImpl, and m_pDocument.
Referenced by populate().
void ODe_AbiDocListener::_closeSection | ( | bool | recursiveCall = false |
) | [private] |
void ODe_AbiDocListener::_closeSpan | ( | void | ) | [private] |
References ODe_AbiDocListenerImpl::closeSpan(), m_bInSpan, and m_pCurrentImpl.
Referenced by _closeBookmark(), _closeField(), _closeHyperlink(), _closeRDFAnchor(), _insertMath(), _openSpan(), finished(), populate(), and populateStrux().
void ODe_AbiDocListener::_closeTable | ( | bool | recursiveCall = false |
) | [private] |
void ODe_AbiDocListener::_closeTOC | ( | ) | [private] |
References ODe_AbiDocListenerImpl::closeTOC(), and m_pCurrentImpl.
Referenced by populateStrux().
void ODe_AbiDocListener::_endAnnotation | ( | PT_AttrPropIndex | api | ) | [private] |
References ODe_AbiDocListenerImpl::endAnnotation(), gchar, PP_AttrProp::getAttribute(), PD_Document::getAttrProp(), m_bPendingAnnotationEnd, m_currentAnnotationName, m_pCurrentImpl, m_pDocument, and UT_DEBUGMSG.
Referenced by populate().
const gchar * ODe_AbiDocListener::_getObjectKey | ( | const PT_AttrPropIndex & | api, | |
const gchar * | key | |||
) | [private] |
References gchar, PP_AttrProp::getAttribute(), PD_Document::getAttrProp(), and m_pDocument.
Referenced by _insertEmbeddedImage(), _insertInlinedImage(), and _insertMath().
void ODe_AbiDocListener::_handleListenerImplAction | ( | ) | [private] |
References ODe_ListenerAction::ACTION_POP, ODe_ListenerAction::ACTION_PUSH, DELETEP, ODe_ListenerAction::deleteWhenPop(), ODe_ListenerAction::getAction(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getLastItem(), ODe_ListenerAction::getListenerImpl(), m_deleteCurrentWhenPop, ODe_AbiDocListener::StackCell::m_deleteWhenPop, m_implStack, m_listenerImplAction, m_pCurrentImpl, ODe_AbiDocListener::StackCell::m_pListenerImpl, UT_GenericVector< T >::pop_back(), UT_GenericVector< T >::push_back(), and UT_ASSERT.
Referenced by _closeCell(), _closeEndnote(), _closeFootnote(), _closeFrame(), _closeSection(), _closeTable(), _openBlock(), _openCell(), _openEndnote(), _openFootnote(), _openFrame(), _openSection(), and _openTable().
void ODe_AbiDocListener::_insertEmbeddedImage | ( | PT_AttrPropIndex | api | ) | [private] |
References _getObjectKey(), gchar, PD_Document::getAttrProp(), ODe_AbiDocListenerImpl::insertInlinedImage(), m_pCurrentImpl, m_pDocument, and UT_UTF8String::utf8_str().
Referenced by populate().
void ODe_AbiDocListener::_insertInlinedImage | ( | PT_AttrPropIndex | api | ) | [private] |
References _getObjectKey(), extension, gchar, PD_Document::getAttrProp(), PD_Document::getDataItemFileExtension(), ODe_AbiDocListenerImpl::insertInlinedImage(), m_pCurrentImpl, and m_pDocument.
Referenced by populate().
void ODe_AbiDocListener::_insertMath | ( | PT_AttrPropIndex | api | ) | [private] |
References _closeSpan(), _getObjectKey(), _openSpan(), UT_UTF8String::appendBuf(), UT_UTF8String::clear(), UT_UTF8String::empty(), gchar, PD_Document::getAttrProp(), PD_Document::getDataItemDataByName(), PP_AttrProp::getProperty(), ODe_AbiDocListenerImpl::insertText(), m_pCurrentImpl, m_pDocument, UT_ASSERT_HARMLESS, UT_LAYOUT_RESOLUTION, UT_return_if_fail, UT_SHOULD_NOT_HAPPEN, UT_UTF8String_sprintf(), and UT_UTF8String::utf8_str().
Referenced by populate().
void ODe_AbiDocListener::_openAnnotation | ( | PT_AttrPropIndex | api, | |
const std::string & | defaultName | |||
) | [private] |
void ODe_AbiDocListener::_openBlock | ( | PT_AttrPropIndex | api | ) | [private] |
void ODe_AbiDocListener::_openBookmark | ( | PT_AttrPropIndex | api | ) | [private] |
References gchar, PP_AttrProp::getAttribute(), PD_Document::getAttrProp(), m_bInBookmark, m_bookmarkName, m_pCurrentImpl, m_pDocument, ODe_AbiDocListenerImpl::openBookmark(), UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.
Referenced by populate().
void ODe_AbiDocListener::_openCell | ( | PT_AttrPropIndex | api, | |
bool | recursiveCall = false | |||
) | [private] |
void ODe_AbiDocListener::_openEndnote | ( | PT_AttrPropIndex | api | ) | [private] |
void ODe_AbiDocListener::_openField | ( | const PX_ChangeRecord_Object * | pcro, | |
PT_AttrPropIndex | api | |||
) | [private] |
void ODe_AbiDocListener::_openFootnote | ( | PT_AttrPropIndex | api | ) | [private] |
void ODe_AbiDocListener::_openFrame | ( | PT_AttrPropIndex | api | ) | [private] |
void ODe_AbiDocListener::_openHyperlink | ( | PT_AttrPropIndex | api | ) | [private] |
References PD_Document::getAttrProp(), m_bInHyperlink, m_pCurrentImpl, m_pDocument, and ODe_AbiDocListenerImpl::openHyperlink().
Referenced by populate().
void ODe_AbiDocListener::_openRDFAnchor | ( | PT_AttrPropIndex | api | ) | [private] |
References PD_Document::getAttrProp(), m_pCurrentImpl, m_pDocument, and ODe_AbiDocListenerImpl::openRDFAnchor().
Referenced by populate().
void ODe_AbiDocListener::_openSection | ( | PT_AttrPropIndex | api, | |
bool | recursiveCall = false | |||
) | [private] |
References _handleListenerImplAction(), ODe_ListenerAction::ACTION_NONE, ODe_ListenerAction::getAction(), PD_Document::getAttrProp(), m_bInSection, m_listenerImplAction, m_pCurrentImpl, m_pDocument, ODe_AbiDocListenerImpl::openSection(), ODe_ListenerAction::reset(), and UT_ASSERT.
Referenced by populateStrux().
void ODe_AbiDocListener::_openSpan | ( | PT_AttrPropIndex | api | ) | [private] |
References _closeSpan(), PD_Document::getAttrProp(), m_apiLastSpan, m_bInSpan, m_pCurrentImpl, m_pDocument, and ODe_AbiDocListenerImpl::openSpan().
Referenced by _insertMath(), and populate().
void ODe_AbiDocListener::_openTable | ( | PT_AttrPropIndex | api, | |
bool | recursiveCall = false | |||
) | [private] |
void ODe_AbiDocListener::_openTOC | ( | PT_AttrPropIndex | api | ) | [private] |
References PD_Document::getAttrProp(), m_pCurrentImpl, m_pDocument, and ODe_AbiDocListenerImpl::openTOC().
Referenced by populateStrux().
void ODe_AbiDocListener::_outputData | ( | const UT_UCSChar * | pData, | |
UT_uint32 | length | |||
) | [private] |
References _appendSpaces(), UT_UTF8String::appendUCS4(), UT_UTF8String::clear(), UT_UTF8String::empty(), ODe_AbiDocListenerImpl::insertColumnBreak(), ODe_AbiDocListenerImpl::insertLineBreak(), ODe_AbiDocListenerImpl::insertPageBreak(), ODe_AbiDocListenerImpl::insertTabChar(), ODe_AbiDocListenerImpl::insertText(), m_pCurrentImpl, UT_UTF8String::reserve(), UCS_FF, UCS_LF, UCS_TAB, UCS_VTAB, and UT_ASSERT.
Referenced by populate().
bool ODe_AbiDocListener::change | ( | fl_ContainerLayout * | sfh, | |
const PX_ChangeRecord * | pcr | |||
) | [virtual] |
Implements PL_Listener.
References UT_ASSERT_NOT_REACHED.
void ODe_AbiDocListener::finished | ( | ) |
References _closeBlock(), _closeBookmark(), _closeCell(), _closeField(), _closeHyperlink(), _closeSection(), _closeSpan(), _closeTable(), and m_bookmarkName.
Referenced by IE_Exp_OpenDocument::_writeDocument().
bool ODe_AbiDocListener::insertStrux | ( | fl_ContainerLayout * | sfh, | |
const PX_ChangeRecord * | pcr, | |||
pf_Frag_Strux * | sdh, | |||
PL_ListenerId | lid, | |||
void(*)(pf_Frag_Strux *sdhNew, PL_ListenerId lid, fl_ContainerLayout *sfhNew) | pfnBindHandles | |||
) | [virtual] |
Implements PL_Listener.
References UT_ASSERT_NOT_REACHED.
bool ODe_AbiDocListener::populate | ( | fl_ContainerLayout * | sfh, | |
const PX_ChangeRecord * | pcr | |||
) | [virtual] |
Implements PL_Listener.
References _closeBookmark(), _closeField(), _closeHyperlink(), _closeRDFAnchor(), _closeSpan(), _endAnnotation(), _insertEmbeddedImage(), _insertInlinedImage(), _insertMath(), _openBookmark(), _openField(), _openHyperlink(), _openRDFAnchor(), _openSpan(), _outputData(), gchar, PP_AttrProp::getAttribute(), PD_Document::getAttrProp(), PX_ChangeRecord_Span::getBufIndex(), PX_ChangeRecord_Span::getField(), PX_ChangeRecord::getIndexAP(), PX_ChangeRecord_Span::getLength(), PX_ChangeRecord_Object::getObjectType(), PD_Document::getPointer(), PX_ChangeRecord::getType(), RDFAnchor::isEnd(), m_pCurrentField, m_pDocument, PTO_Annotation, PTO_Bookmark, PTO_Embed, PTO_Field, PTO_Hyperlink, PTO_Image, PTO_Math, PTO_RDFAnchor, PX_ChangeRecord::PXT_InsertFmtMark, PX_ChangeRecord::PXT_InsertObject, PX_ChangeRecord::PXT_InsertSpan, UT_ASSERT_HARMLESS, UT_DEBUGMSG, and UT_TODO.
bool ODe_AbiDocListener::populateStrux | ( | pf_Frag_Strux * | sdh, | |
const PX_ChangeRecord * | pcr, | |||
fl_ContainerLayout ** | psfh | |||
) | [virtual] |
Implements PL_Listener.
References _closeAnnotation(), _closeBlock(), _closeBookmark(), _closeCell(), _closeEndnote(), _closeField(), _closeFootnote(), _closeFrame(), _closeHyperlink(), _closeSection(), _closeSpan(), _closeTable(), _closeTOC(), _openAnnotation(), _openBlock(), _openCell(), _openEndnote(), _openFootnote(), _openFrame(), _openSection(), _openTable(), _openTOC(), gchar, PP_AttrProp::getAttribute(), PD_Document::getAttrProp(), PX_ChangeRecord::getIndexAP(), PX_ChangeRecord::getPosition(), PX_ChangeRecord_Strux::getStruxType(), PX_ChangeRecord::getType(), m_bookmarkName, m_pDocument, PT_ANNOTATION_NUMBER, PTX_Block, PTX_EndAnnotation, PTX_EndCell, PTX_EndEndnote, PTX_EndFootnote, PTX_EndFrame, PTX_EndMarginnote, PTX_EndTable, PTX_EndTOC, PTX_Section, PTX_SectionAnnotation, PTX_SectionCell, PTX_SectionEndnote, PTX_SectionFootnote, PTX_SectionFrame, PTX_SectionHdrFtr, PTX_SectionMarginnote, PTX_SectionTable, PTX_SectionTOC, UT_ASSERT_HARMLESS, UT_return_val_if_fail, and UT_TODO.
bool ODe_AbiDocListener::signal | ( | UT_uint32 | iSignal | ) | [virtual] |
Implements PL_Listener.
References UT_ASSERT_NOT_REACHED.
Referenced by _openSpan().
bool ODe_AbiDocListener::m_bInAnnotation [private] |
Referenced by _closeAnnotation(), and _openAnnotation().
bool ODe_AbiDocListener::m_bInBlock [private] |
Referenced by _closeAnnotation(), _closeBlock(), _closeEndnote(), _closeFootnote(), _openAnnotation(), and _openBlock().
bool ODe_AbiDocListener::m_bInBookmark [private] |
Referenced by _closeBookmark(), and _openBookmark().
bool ODe_AbiDocListener::m_bInHyperlink [private] |
Referenced by _closeHyperlink(), and _openHyperlink().
bool ODe_AbiDocListener::m_bInSection [private] |
Referenced by _closeSection(), and _openSection().
bool ODe_AbiDocListener::m_bInSpan [private] |
Referenced by _closeSpan(), and _openSpan().
Referenced by _closeBookmark(), _openBookmark(), finished(), and populateStrux().
bool ODe_AbiDocListener::m_bPendingAnnotationEnd [private] |
Referenced by _endAnnotation(), and _openAnnotation().
std::string ODe_AbiDocListener::m_currentAnnotationName [private] |
Referenced by _closeAnnotation(), _endAnnotation(), and _openAnnotation().
Referenced by _closeField(), and _openField().
bool ODe_AbiDocListener::m_deleteCurrentWhenPop [private] |
Referenced by _handleListenerImplAction(), and ~ODe_AbiDocListener().
UT_sint32 ODe_AbiDocListener::m_iInCell [private] |
Referenced by _closeCell(), and _openCell().
UT_sint32 ODe_AbiDocListener::m_iInTable [private] |
Referenced by _closeTable(), and _openTable().
Referenced by _handleListenerImplAction(), and ~ODe_AbiDocListener().
fd_Field* ODe_AbiDocListener::m_pCurrentField [private] |
Referenced by _closeField(), _openField(), and populate().
Referenced by _closeAnnotation(), _closeBlock(), _closeBookmark(), _closeCell(), _closeEndnote(), _closeField(), _closeFootnote(), _closeFrame(), _closeHyperlink(), _closeRDFAnchor(), _closeSection(), _closeSpan(), _closeTable(), _closeTOC(), _endAnnotation(), _handleListenerImplAction(), _insertEmbeddedImage(), _insertInlinedImage(), _insertMath(), _openAnnotation(), _openBlock(), _openBookmark(), _openCell(), _openEndnote(), _openField(), _openFootnote(), _openFrame(), _openHyperlink(), _openRDFAnchor(), _openSection(), _openSpan(), _openTable(), _openTOC(), _outputData(), and ~ODe_AbiDocListener().
PD_Document* ODe_AbiDocListener::m_pDocument [private] |
Referenced by _closeBookmark(), _closeRDFAnchor(), _endAnnotation(), _getObjectKey(), _insertEmbeddedImage(), _insertInlinedImage(), _insertMath(), _openAnnotation(), _openBlock(), _openBookmark(), _openCell(), _openEndnote(), _openField(), _openFootnote(), _openFrame(), _openHyperlink(), _openRDFAnchor(), _openSection(), _openSpan(), _openTable(), _openTOC(), populate(), and populateStrux().