Public Member Functions | Private Member Functions | Private Attributes | Friends

ABI_Collab_Export Class Reference

#include <AbiCollab_Export.h>

Inheritance diagram for ABI_Collab_Export:
PL_DocChangeListener PL_Listener

List of all members.

Public Member Functions

 ABI_Collab_Export (AbiCollab *pAbiCollab, PD_Document *pDoc)
virtual ~ABI_Collab_Export ()
virtual bool populate (fl_ContainerLayout *, const PX_ChangeRecord *)
virtual bool populateStrux (pf_Frag_Strux *, const PX_ChangeRecord *, fl_ContainerLayout **)
virtual bool change (fl_ContainerLayout *sfh, const PX_ChangeRecord *pcr)
virtual void deferNotifications (void)
virtual void processDeferredNotifications (void)
virtual bool insertStrux (fl_ContainerLayout *sfh, const PX_ChangeRecord *pcr, pf_Frag_Strux *sdh, PL_ListenerId lid, void(*pfnBindHandles)(pf_Frag_Strux *sdhNew, PL_ListenerId lid, fl_ContainerLayout *sfhNew))
virtual bool signal (UT_uint32 iSignal)
virtual PLListenerType getType () const
virtual void setNewDocument (PD_Document *pDoc)
virtual void removeDocument (void)
const UT_GenericVector
< ChangeAdjust * > * 
getAdjusts (void) const
UT_GenericVector< ChangeAdjust * > * getAdjusts (void)
void masterInit ()
void slaveInit (const std::string &docUUID, UT_sint32 iRemoteRev)

Private Member Functions

ChangeRecordSessionPacket_buildPacket (const PX_ChangeRecord *pcr)
void _handleNewPacket (ChangeRecordSessionPacket *pPacket, const PX_ChangeRecord *pcr)
bool _isGlobEnd (UT_Byte istart, UT_Byte istop)
void _mapPropsAtts (UT_sint32 indx, std::map< UT_UTF8String, UT_UTF8String > &props, std::map< UT_UTF8String, UT_UTF8String > &atts)
void _init ()
void _cleanup ()

Private Attributes

PD_Documentm_pDoc
 Document which is client of this DocListener.
UT_Stack m_sLastContainerLayout
AV_ChangeMask m_chgMaskCached
bool m_bCacheChanges
UT_sint32 m_iBlockIndex
UT_sint32 m_iSectionIndex
AbiCollabm_pAbiCollab
UT_GenericVector< ChangeAdjust * > m_vecAdjusts
GlobSessionPacketm_pGlobPacket

Friends

class AbiCollab

Constructor & Destructor Documentation

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.


Member Function Documentation

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]
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().

bool ABI_Collab_Export::_isGlobEnd ( UT_Byte  istart,
UT_Byte  istop 
) [private]
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.

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 (  ) 
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]
void ABI_Collab_Export::slaveInit ( const std::string &  docUUID,
UT_sint32  iRemoteRev 
)

Friends And Related Function Documentation

friend class AbiCollab [friend]

Member Data Documentation

Referenced by _init().

Document which is client of this DocListener.

Referenced by _buildPacket(), _handleNewPacket(), _mapPropsAtts(), change(), and signal().


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