#include <AbiCollab_Export.h>
ABI_Collab_Export::ABI_Collab_Export | ( | AbiCollab * | pAbiCollab, | |
PD_Document * | pDoc | |||
) |
References _init(), and UT_DEBUGMSG.
ABI_Collab_Export::~ABI_Collab_Export | ( | ) | [virtual] |
References _cleanup(), and UT_DEBUGMSG.
ChangeRecordSessionPacket * ABI_Collab_Export::_buildPacket | ( | const PX_ChangeRecord * | pcr | ) | [private] |
This method converts a change record into a AbiCollab session packet
References _mapPropsAtts(), UT_UTF8String::appendUCS4(), gchar, Props_ChangeRecordSessionPacket::getAttMap(), PD_Document::getAttrProp(), PX_ChangeRecord_SpanChange::getBufIndex(), PD_Document::getDataItemDataByName(), PX_ChangeRecord_Glob::getFlags(), PX_ChangeRecord::getIndexAP(), PX_ChangeRecord_SpanChange::getLength(), PX_ChangeRecord_ObjectChange::getObjectType(), PX_ChangeRecord_Object::getObjectType(), PD_Document::getPointer(), Props_ChangeRecordSessionPacket::getPropMap(), PX_ChangeRecord_StruxChange::getStruxType(), PX_ChangeRecord_Strux::getStruxType(), PX_ChangeRecord::getType(), Data_ChangeRecordSessionPacket::m_bTokenSet, DeleteStrux_ChangeRecordSessionPacket::m_eStruxType, ChangeStrux_ChangeRecordSessionPacket::m_eStruxType, m_iBlockIndex, Glob_ChangeRecordSessionPacket::m_iGLOBType, m_iSectionIndex, m_pAbiCollab, m_pDoc, InsertSpan_ChangeRecordSessionPacket::m_sText, Data_ChangeRecordSessionPacket::m_sToken, Data_ChangeRecordSessionPacket::m_vecData, PT_DATAITEM_ATTRIBUTE_NAME, PTX_Block, PTX_Section, PTX_SectionAnnotation, PTX_SectionCell, PTX_SectionEndnote, PTX_SectionFootnote, PTX_SectionFrame, PTX_SectionHdrFtr, PTX_SectionTable, PTX_SectionTOC, PX_ChangeRecord::PXT_ChangeDocProp, PX_ChangeRecord::PXT_ChangeDocRDF, PX_ChangeRecord::PXT_ChangeFmtMark, PX_ChangeRecord::PXT_ChangeObject, PX_ChangeRecord::PXT_ChangePoint, PX_ChangeRecord::PXT_ChangeSpan, PX_ChangeRecord::PXT_ChangeStrux, PX_ChangeRecord::PXT_CreateDataItem, PX_ChangeRecord::PXT_DeleteFmtMark, PX_ChangeRecord::PXT_DeleteObject, PX_ChangeRecord::PXT_DeleteSpan, PX_ChangeRecord::PXT_DeleteStrux, PX_ChangeRecord::PXT_GlobMarker, PX_ChangeRecord::PXT_InsertFmtMark, PX_ChangeRecord::PXT_InsertObject, PX_ChangeRecord::PXT_InsertSpan, PX_ChangeRecord::PXT_InsertStrux, PX_ChangeRecord::PXT_ListUpdate, PX_ChangeRecord::PXT_RemoveList, PX_ChangeRecord::PXT_StopList, PX_ChangeRecord::PXT_UpdateField, PX_ChangeRecord::PXT_UpdateLayout, ChangeRecordSessionPacket::setAdjust(), ChangeRecordSessionPacket::setLength(), Object_ChangeRecordSessionPacket::setObjectType(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_NOT_IMPLEMENTED, UT_return_val_if_fail, and UT_SHOULD_NOT_HAPPEN.
Referenced by change(), and insertStrux().
void ABI_Collab_Export::_cleanup | ( | ) | [private] |
References DELETEP, UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), m_pGlobPacket, and m_vecAdjusts.
Referenced by masterInit(), slaveInit(), and ~ABI_Collab_Export().
void ABI_Collab_Export::_handleNewPacket | ( | ChangeRecordSessionPacket * | pPacket, | |
const PX_ChangeRecord * | pcr | |||
) | [private] |
Handles new packet, by either adding it to a glob if we're doing a glob, or by pushing it to the collab session directly
References AbiCollab::addChangeAdjust(), GlobSessionPacket::addPacket(), DELETEP, AbiCollab::getActivePacket(), AD_Document::getMyUUIDString(), AbstractChangeRecordSessionPacket::getPos(), m_pAbiCollab, m_pDoc, m_pGlobPacket, AbiCollab::push(), and UT_return_if_fail.
Referenced by change(), and insertStrux().
void ABI_Collab_Export::_init | ( | ) | [private] |
References UT_GenericVector< T >::clear(), m_bCacheChanges, m_chgMaskCached, m_iBlockIndex, m_iSectionIndex, m_pGlobPacket, and m_vecAdjusts.
Referenced by ABI_Collab_Export(), masterInit(), and slaveInit().
Returns true if the stop flag matches the start.
References PX_ChangeRecord_Glob::PXF_MultiStepEnd, PX_ChangeRecord_Glob::PXF_MultiStepStart, PX_ChangeRecord_Glob::PXF_UserAtomicEnd, and PX_ChangeRecord_Glob::PXF_UserAtomicStart.
Referenced by change().
void ABI_Collab_Export::_mapPropsAtts | ( | UT_sint32 | indx, | |
std::map< UT_UTF8String, UT_UTF8String > & | props, | |||
std::map< UT_UTF8String, UT_UTF8String > & | atts | |||
) | [private] |
This method extracts all the attributes (including the property string from the index provides and maps them to a utf-8 string. The result can be placed inside an XML name space.
References gchar, PP_AttrProp::getAttributeCount(), PD_Document::getAttrProp(), PP_AttrProp::getNthAttribute(), PP_AttrProp::getNthProperty(), PP_AttrProp::getPropertyCount(), m_pDoc, szName, UT_DEBUGMSG, and UT_return_if_fail.
Referenced by _buildPacket().
bool ABI_Collab_Export::change | ( | fl_ContainerLayout * | sfh, | |
const PX_ChangeRecord * | pcr | |||
) | [virtual] |
Implements the "change" method of the document listener class. It takes the supplied change record and makes an XML-like representation of it. Eventually these can either be stored in a file or sent over the internet to a remote AbiWord where it can be translated back.
Implements PL_Listener.
References _buildPacket(), _handleNewPacket(), _isGlobEnd(), AbiCollab::addChangeAdjust(), GlobSessionPacket::addPacket(), DELETEP, AbiCollab::getActivePacket(), SessionPacket::getDocUUID(), PX_ChangeRecord_Glob::getFlags(), AD_Document::getMyUUIDString(), GlobSessionPacket::getPackets(), AbstractChangeRecordSessionPacket::getPos(), SessionPacket::getSessionId(), PX_ChangeRecord::getType(), m_pAbiCollab, m_pDoc, m_pGlobPacket, AbiCollab::push(), and UT_return_val_if_fail.
virtual void ABI_Collab_Export::deferNotifications | ( | void | ) | [inline, virtual] |
Reimplemented from PL_Listener.
const UT_GenericVector<ChangeAdjust *>* ABI_Collab_Export::getAdjusts | ( | void | ) | const [inline] |
UT_GenericVector<ChangeAdjust *>* ABI_Collab_Export::getAdjusts | ( | void | ) | [inline] |
References m_vecAdjusts.
PLListenerType ABI_Collab_Export::getType | ( | ) | const [virtual] |
Reimplemented from PL_Listener.
bool ABI_Collab_Export::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 the "insertStrux" method of the document listener class. It takes the supplied change record and makes an XML-like representation of it. Eventually these can either be stored in a file or sent over the internet to a remote AbiWord where it can be translated back.
Implements PL_Listener.
References _buildPacket(), _handleNewPacket(), and UT_return_val_if_fail.
void ABI_Collab_Export::masterInit | ( | ) |
References _cleanup(), _init(), and UT_DEBUGMSG.
Referenced by AbiCollab::_restartAsMaster(), and AbiCollab::AbiCollab().
virtual bool ABI_Collab_Export::populate | ( | fl_ContainerLayout * | , | |
const PX_ChangeRecord * | ||||
) | [inline, virtual] |
Implements PL_Listener.
virtual bool ABI_Collab_Export::populateStrux | ( | pf_Frag_Strux * | , | |
const PX_ChangeRecord * | , | |||
fl_ContainerLayout ** | ||||
) | [inline, virtual] |
Implements PL_Listener.
virtual void ABI_Collab_Export::processDeferredNotifications | ( | void | ) | [inline, virtual] |
Reimplemented from PL_Listener.
void ABI_Collab_Export::removeDocument | ( | void | ) | [virtual] |
This virtual method is called if the attached document is deleted with an attached AbiCollab_Export connected to the document.
Implements PL_DocChangeListener.
References AbiCollabSessionManager::disconnectSession(), AbiCollabSessionManager::getManager(), m_pAbiCollab, UT_DEBUGMSG, and UT_return_if_fail.
void ABI_Collab_Export::setNewDocument | ( | PD_Document * | pDoc | ) | [virtual] |
This virtual method is called from the AbiWord main tree upon doing a replace document with an attached AbiCollab_Export connected to the document.
Note: this is a really weird signal, coming from a PD_Document Note: If anything, a Frame should emit this signal to its listeners
Implements PL_DocChangeListener.
References AbiCollabSessionManager::disconnectSession(), AbiCollabSessionManager::getManager(), m_pAbiCollab, UT_DEBUGMSG, and UT_return_if_fail.
bool ABI_Collab_Export::signal | ( | UT_uint32 | iSignal | ) | [virtual] |
Implements the signal() method of the Document listener class.
Implements PL_Listener.
References GlobSessionPacket::addPacket(), AD_Document::getOrigDocUUIDString(), AbiCollab::getSessionId(), m_pAbiCollab, m_pDoc, m_pGlobPacket, PD_SIGNAL_SAVEDOC, AbiCollab::push(), and UT_DEBUGMSG.
void ABI_Collab_Export::slaveInit | ( | const std::string & | docUUID, | |
UT_sint32 | iRemoteRev | |||
) |
References _cleanup(), _init(), AbiCollab::addChangeAdjust(), m_pAbiCollab, SessionPacket::setDocUUID(), ChangeRecordSessionPacket::setRev(), and UT_DEBUGMSG.
Referenced by AbiCollab::_restartAsSlave(), and AbiCollab::AbiCollab().
friend class AbiCollab [friend] |
bool ABI_Collab_Export::m_bCacheChanges [private] |
Referenced by _init().
Referenced by _init().
UT_sint32 ABI_Collab_Export::m_iBlockIndex [private] |
Referenced by _buildPacket(), and _init().
UT_sint32 ABI_Collab_Export::m_iSectionIndex [private] |
Referenced by _buildPacket(), and _init().
AbiCollab* ABI_Collab_Export::m_pAbiCollab [private] |
Referenced by _buildPacket(), _handleNewPacket(), change(), removeDocument(), setNewDocument(), signal(), and slaveInit().
PD_Document* ABI_Collab_Export::m_pDoc [private] |
Document which is client of this DocListener.
Referenced by _buildPacket(), _handleNewPacket(), _mapPropsAtts(), change(), and signal().
Referenced by _cleanup(), _handleNewPacket(), _init(), change(), and signal().
UT_GenericVector<ChangeAdjust *> ABI_Collab_Export::m_vecAdjusts [private] |
Referenced by _cleanup(), _init(), and getAdjusts().