#include <ie_imp_PasteListener.h>
Public Member Functions | |
IE_Imp_PasteListener (PD_Document *pDocToPaste, PT_DocPosition insPoint, PD_Document *pSourceDoc) | |
virtual | ~IE_Imp_PasteListener () |
virtual bool | populate (fl_ContainerLayout *sfh, const PX_ChangeRecord *pcr) |
virtual bool | populateStrux (pf_Frag_Strux *sdh, const PX_ChangeRecord *pcr, fl_ContainerLayout **psfh) |
virtual bool | change (fl_ContainerLayout *, const PX_ChangeRecord *) |
virtual bool | insertStrux (fl_ContainerLayout *, const PX_ChangeRecord *, pf_Frag_Strux *, PL_ListenerId, void(*)(pf_Frag_Strux *sdhNew, PL_ListenerId lid, fl_ContainerLayout *sfhNew)) |
virtual bool | signal (UT_uint32) |
virtual PLListenerType | getType () const |
Private Member Functions | |
PD_Document * | getDoc (void) const |
Private Attributes | |
PD_Document * | m_pPasteDocument |
PT_DocPosition | m_insPoint |
bool | m_bFirstSection |
bool | m_bFirstBlock |
PD_Document * | m_pSourceDoc |
IE_Imp_PasteListener::IE_Imp_PasteListener | ( | PD_Document * | pDocToPaste, | |
PT_DocPosition | insPoint, | |||
PD_Document * | pSourceDoc | |||
) |
This nifty little class allows all importers to also be used for pasting into the document. The idea is that we create a dummy document which we import to as usual with the impoters. After the Dummy document is completed we do a PD_Document::tellListener on it with this class as the listner class. This class translates all the populate().... and populateStrux()... methods into insertSpan(..) insertStrux(...) methods at the current insertion point.
Hey presto we have pasted into the current document. Pretty cool eh?
virtual IE_Imp_PasteListener::~IE_Imp_PasteListener | ( | ) | [inline, virtual] |
virtual bool IE_Imp_PasteListener::change | ( | fl_ContainerLayout * | , | |
const PX_ChangeRecord * | ||||
) | [inline, virtual] |
Implements PL_Listener.
PD_Document * IE_Imp_PasteListener::getDoc | ( | void | ) | const [private] |
References m_pPasteDocument.
virtual PLListenerType IE_Imp_PasteListener::getType | ( | void | ) | const [inline, virtual] |
Reimplemented from PL_Listener.
virtual bool IE_Imp_PasteListener::insertStrux | ( | fl_ContainerLayout * | , | |
const PX_ChangeRecord * | , | |||
pf_Frag_Strux * | , | |||
PL_ListenerId | , | |||
void(*)(pf_Frag_Strux *sdhNew,PL_ListenerId lid,fl_ContainerLayout *sfhNew) | ||||
) | [inline, virtual] |
Implements PL_Listener.
bool IE_Imp_PasteListener::populate | ( | fl_ContainerLayout * | sfh, | |
const PX_ChangeRecord * | pcr | |||
) | [virtual] |
Implements PL_Listener.
References PD_Document::changeSpanFmt(), PP_AttrProp::getAttributes(), PD_Document::getAttrProp(), PX_ChangeRecord_Span::getBufIndex(), PX_ChangeRecord::getIndexAP(), PX_ChangeRecord_Span::getLength(), PX_ChangeRecord_Object::getObjectType(), PD_Document::getPointer(), PP_AttrProp::getProperties(), PX_ChangeRecord::getType(), PD_Document::insertObject(), PD_Document::insertSpan(), m_insPoint, m_pPasteDocument, m_pSourceDoc, PTC_SetExactly, PX_ChangeRecord::PXT_InsertFmtMark, PX_ChangeRecord::PXT_InsertObject, PX_ChangeRecord::PXT_InsertSpan, UT_ASSERT_HARMLESS, UT_DEBUGMSG, and UT_SHOULD_NOT_HAPPEN.
bool IE_Imp_PasteListener::populateStrux | ( | pf_Frag_Strux * | sdh, | |
const PX_ChangeRecord * | pcr, | |||
fl_ContainerLayout ** | psfh | |||
) | [virtual] |
Implements PL_Listener.
References PD_Document::createDataItem(), PD_Document::enumDataItems(), PP_AttrProp::getAttributes(), PD_Document::getAttrProp(), PX_ChangeRecord::getIndexAP(), pf_Frag::getNext(), PP_AttrProp::getProperties(), pf_Frag::getType(), PX_ChangeRecord::getType(), PD_Document::insertStrux(), m_bFirstBlock, m_bFirstSection, m_insPoint, m_pPasteDocument, m_pSourceDoc, PTX_Block, PTX_EndCell, PTX_EndEndnote, PTX_EndFootnote, PTX_EndFrame, PTX_EndTable, PTX_EndTOC, PTX_Section, PTX_SectionCell, PTX_SectionEndnote, PTX_SectionFootnote, PTX_SectionFrame, PTX_SectionHdrFtr, PTX_SectionTable, PTX_SectionTOC, szName, UT_ASSERT, UT_ASSERT_HARMLESS, UT_DEBUGMSG, and UT_SHOULD_NOT_HAPPEN.
virtual bool IE_Imp_PasteListener::signal | ( | UT_uint32 | ) | [inline, virtual] |
Implements PL_Listener.
bool IE_Imp_PasteListener::m_bFirstBlock [private] |
Referenced by populateStrux().
bool IE_Imp_PasteListener::m_bFirstSection [private] |
Referenced by populateStrux().
Referenced by populate(), and populateStrux().
Referenced by getDoc(), populate(), and populateStrux().
PD_Document* IE_Imp_PasteListener::m_pSourceDoc [private] |
Referenced by populate(), and populateStrux().