#include <AbiCollab_Import.h>
Public Member Functions | |
| ABI_Collab_Import (AbiCollab *pAbiCollab, PD_Document *doc) | |
| ~ABI_Collab_Import () | |
| bool | import (const SessionPacket &sPacket, const Buddy &collaborator) |
| std::map< std::string, UT_sint32 > & | getRemoteRevisions () |
| PT_DocPosition | getEndOfDoc () |
| void | setInitialRemoteRev (const UT_UTF8String &collaborator, UT_sint32 iRev) |
Private Member Functions | |
| bool | _isOverlapping (UT_sint32 pos1, UT_sint32 length1, UT_sint32 pos2, UT_sint32 length2) |
| void | _calculateCollisionSeqence (UT_sint32 iIncomingRemoteRev, const UT_UTF8String &sIncomingDocUUID, UT_sint32 &iStart, UT_sint32 &iEnd) |
| UT_sint32 | _getIncomingAdjustmentForState (const UT_GenericVector< ChangeAdjust * > *pExpAdjusts, UT_sint32 iStart, UT_sint32 iEnd, UT_sint32 iIncomingPos, UT_sint32 iIncomingLength, const UT_UTF8String &sIncomingUUID, std::deque< int > &impAdjs) |
| bool | _checkForCollision (const AbstractChangeRecordSessionPacket &acrsp, UT_sint32 &iRev, UT_sint32 &iImportAdjustment) |
| bool | _handleCollision (UT_sint32 iIncommingRev, UT_sint32 iLocalRev, const Buddy &collaborator) |
| bool | _shouldIgnore (const Buddy &collaborator) |
| void | _disableUpdates (UT_GenericVector< AV_View * > &vecViews, bool bIsGlob) |
| void | _enableUpdates (UT_GenericVector< AV_View * > &vecViews, bool bIsGlob) |
| bool | _import (const SessionPacket &packet, UT_sint32 iImportAdjustment, const Buddy &collaborator, bool inGlob=false) |
Private Attributes | |
| PD_Document * | m_pDoc |
| AbiCollab * | m_pAbiCollab |
| std::map< std::string, UT_sint32 > | m_remoteRevs |
| std::vector< std::pair < UT_UTF8String, UT_sint32 > > | m_revertSet |
| std::deque< UT_sint32 > | m_iAlreadyRevertedRevs |
Friends | |
| class | FakeAccountHandler |
| ABI_Collab_Import::ABI_Collab_Import | ( | AbiCollab * | pAbiCollab, | |
| PD_Document * | doc | |||
| ) |
| ABI_Collab_Import::~ABI_Collab_Import | ( | ) |
| bool ABI_Collab_Import::import | ( | const SessionPacket & | sPacket, | |
| const Buddy & | collaborator | |||
| ) |
References _checkForCollision(), _disableUpdates(), _enableUpdates(), _handleCollision(), _import(), _shouldIgnore(), SessionPacket::getDocUUID(), AD_Document::getOrigDocUUIDString(), AbstractChangeRecordSessionPacket::getRev(), AbstractChangeRecordSessionPacket::isInstanceOf(), m_pDoc, PCT_GlobSessionPacket, PCT_RevertAckSessionPacket, PCT_RevertSessionPacket, PCT_SignalSessionPacket, AD_Document::setMyUUID(), SessionPacket::toStr(), UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_NOT_IMPLEMENTED, and UT_UTF8String::utf8_str().
Referenced by AbiCollab::import().
| std::map<std::string, UT_sint32>& ABI_Collab_Import::getRemoteRevisions | ( | ) | [inline] |
References m_remoteRevs.
Referenced by AbiCollab::_fillRemoteRev(), and AbiCollab::_removeCollaborator().
| PT_DocPosition ABI_Collab_Import::getEndOfDoc | ( | void | ) |
| void ABI_Collab_Import::setInitialRemoteRev | ( | const UT_UTF8String & | collaborator, | |
| UT_sint32 | iRev | |||
| ) | [inline] |
References m_remoteRevs, UT_return_if_fail, and UT_UTF8String::utf8_str().
Referenced by AbiCollab::AbiCollab().
| bool ABI_Collab_Import::_isOverlapping | ( | UT_sint32 | pos1, | |
| UT_sint32 | length1, | |||
| UT_sint32 | pos2, | |||
| UT_sint32 | length2 | |||
| ) | [private] |
Referenced by _checkForCollision(), and _getIncomingAdjustmentForState().
| void ABI_Collab_Import::_calculateCollisionSeqence | ( | UT_sint32 | iIncomingRemoteRev, | |
| const UT_UTF8String & | sIncomingDocUUID, | |||
| UT_sint32 & | iStart, | |||
| UT_sint32 & | iEnd | |||
| ) | [private] |
References ABI_Collab_Export::getAdjusts(), AbiCollab::getExport(), UT_GenericVector< T >::getItemCount(), ChangeAdjust::getLocalAdjust(), ChangeAdjust::getLocalLength(), ChangeAdjust::getLocalPos(), ChangeAdjust::getLocalRev(), UT_GenericVector< T >::getNthItem(), ChangeAdjust::getRemoteDocUUID(), m_pAbiCollab, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_if_fail, UT_SHOULD_NOT_HAPPEN, and UT_UTF8String::utf8_str().
Referenced by _checkForCollision().
| UT_sint32 ABI_Collab_Import::_getIncomingAdjustmentForState | ( | const UT_GenericVector< ChangeAdjust * > * | pExpAdjusts, | |
| UT_sint32 | iStart, | |||
| UT_sint32 | iEnd, | |||
| UT_sint32 | iIncomingPos, | |||
| UT_sint32 | iIncomingLength, | |||
| const UT_UTF8String & | sIncomingUUID, | |||
| std::deque< int > & | impAdjs | |||
| ) | [private] |
| bool ABI_Collab_Import::_checkForCollision | ( | const AbstractChangeRecordSessionPacket & | acrsp, | |
| UT_sint32 & | iRev, | |||
| UT_sint32 & | iImportAdjustment | |||
| ) | [private] |
Scan back through the CR's we've emitted since this remote CR was sent and see if any overlap this one. return true if there is a collision.
References _calculateCollisionSeqence(), _getIncomingAdjustmentForState(), _isOverlapping(), ABI_Collab_Export::getAdjusts(), SessionPacket::getDocUUID(), AbiCollab::getExport(), AbstractChangeRecordSessionPacket::getLength(), ChangeAdjust::getLocalAdjust(), ChangeAdjust::getLocalLength(), ChangeAdjust::getLocalPos(), ChangeAdjust::getLocalRev(), UT_GenericVector< T >::getNthItem(), AbstractChangeRecordSessionPacket::getPos(), ChangeAdjust::getRemoteDocUUID(), AbstractChangeRecordSessionPacket::getRemoteRev(), AbiCollab_ImportRuleSet::isOverlapAllowed(), m_pAbiCollab, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, and UT_UTF8String::utf8_str().
Referenced by import().
| bool ABI_Collab_Import::_handleCollision | ( | UT_sint32 | iIncommingRev, | |
| UT_sint32 | iLocalRev, | |||
| const Buddy & | collaborator | |||
| ) | [private] |
References UT_GenericVector< T >::deleteNthItem(), ABI_Collab_Export::getAdjusts(), AbiCollab::getExport(), UT_GenericVector< T >::getItemCount(), ChangeAdjust::getLocalAdjust(), ChangeAdjust::getLocalPos(), ChangeAdjust::getLocalRev(), Buddy::getName(), UT_GenericVector< T >::getNthItem(), AD_Document::getOrigDocUUIDString(), ChangeAdjust::getRemoteDocUUID(), AbiCollab::getSessionId(), AbiCollab::isLocallyControlled(), m_iAlreadyRevertedRevs, m_pAbiCollab, m_pDoc, m_revertSet, AbiCollab::push(), AbiCollab::setIsReverting(), ChangeAdjust::setLocalPos(), PD_Document::undoCmd(), UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, and UT_UTF8String::utf8_str().
Referenced by import().
| bool ABI_Collab_Import::_shouldIgnore | ( | const Buddy & | collaborator | ) | [private] |
References Buddy::getName(), AbiCollab::isLocallyControlled(), m_pAbiCollab, m_revertSet, UT_DEBUGMSG, and UT_UTF8String::utf8_str().
Referenced by import().
| void ABI_Collab_Import::_disableUpdates | ( | UT_GenericVector< AV_View * > & | vecViews, | |
| bool | bIsGlob | |||
| ) | [private] |
References PD_Document::beginUserAtomicGlob(), PD_Document::disableListUpdates(), PD_Document::getAllViews(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), m_pDoc, PD_Document::notifyPieceTableChangeStart(), AV_View::setActivityMask(), and PD_Document::setDontImmediatelyLayout().
Referenced by import().
| void ABI_Collab_Import::_enableUpdates | ( | UT_GenericVector< AV_View * > & | vecViews, | |
| bool | bIsGlob | |||
| ) | [private] |
References PD_Document::enableListUpdates(), PD_Document::endUserAtomicGlob(), FV_View::fixInsertionPointCoords(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), m_pDoc, PD_Document::notifyPieceTableChangeEnd(), PD_SIGNAL_UPDATE_LAYOUT, AV_View::setActivityMask(), PD_Document::setDontImmediatelyLayout(), FV_View::shouldScreenUpdateOnGeneralUpdate(), PD_Document::signalListeners(), and PD_Document::updateDirtyLists().
Referenced by import().
| bool ABI_Collab_Import::_import | ( | const SessionPacket & | packet, | |
| UT_sint32 | iImportAdjustment, | |||
| const Buddy & | collaborator, | |||
| bool | inGlob = false | |||
| ) | [private] |
Take a packet contained with a UT_UTF8string, interpret it's contents and apply the implied operations on the document.
References _PCT_FirstChangeRecord, _PCT_LastChangeRecord, AV_CHG_FMTBLOCK, AV_CHG_FMTCHAR, AV_CHG_FMTSTYLE, AV_CHG_PAGECOUNT, AV_CHG_TYPING, PD_Document::changeDocPropeties(), PD_Document::changeSpanFmt(), PD_Document::changeStruxFmt(), PD_Document::createAndSendCR(), PD_Document::createDataItem(), PD_Document::deleteFmtMark(), PD_Document::deleteSpan(), PD_Document::deleteStrux(), gchar, XAP_App::getApp(), Props_ChangeRecordSessionPacket::getAttribute(), Props_ChangeRecordSessionPacket::getAtts(), XAP_Frame::getCurrentView(), getEndOfDoc(), XAP_App::getLastFocussedFrame(), ChangeRecordSessionPacket::getLength(), PD_Style::getName(), Buddy::getName(), GlobSessionPacket::getPackets(), ChangeRecordSessionPacket::getPos(), Props_ChangeRecordSessionPacket::getProps(), ChangeRecordSessionPacket::getPXType(), ChangeRecordSessionPacket::getRev(), RevertSessionPacket::getRev(), GlobSessionPacket::getRev(), SignalSessionPacket::getSignalType(), PD_Document::getStruxOfTypeFromPosition(), PD_Document::getStyleFromSDH(), PD_Document::insertObject(), PD_Document::insertSpan(), PD_Document::insertStrux(), UT_UCS4String::length(), Data_ChangeRecordSessionPacket::m_bTokenSet, Object_ChangeRecordSessionPacket::m_eObjectType, DeleteStrux_ChangeRecordSessionPacket::m_eStruxType, ChangeStrux_ChangeRecordSessionPacket::m_eStruxType, m_iAlreadyRevertedRevs, m_pDoc, m_remoteRevs, m_revertSet, InsertSpan_ChangeRecordSessionPacket::m_sText, Data_ChangeRecordSessionPacket::m_sToken, Data_ChangeRecordSessionPacket::m_vecData, FV_View::notifyListeners(), PCT_GlobSessionPacket, PCT_RevertAckSessionPacket, PCT_RevertSessionPacket, PCT_SignalSessionPacket, PT_DATAITEM_ATTRIBUTE_NAME, PT_STYLE_ATTRIBUTE_NAME, PTC_SetExactly, PTX_Block, PX_ChangeRecord::PXT_ChangeDocProp, 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, PP_AttrProp::setAttributes(), PP_AttrProp::setProperties(), PD_Document::signalListeners(), szName, UT_UCS4String::ucs4_str(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_NOT_IMPLEMENTED, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, and UT_UTF8String::utf8_str().
Referenced by FakeAccountHandler::_import(), and import().
friend class FakeAccountHandler [friend] |
PD_Document* ABI_Collab_Import::m_pDoc [private] |
Referenced by _disableUpdates(), _enableUpdates(), _handleCollision(), _import(), getEndOfDoc(), and import().
AbiCollab* ABI_Collab_Import::m_pAbiCollab [private] |
Referenced by _calculateCollisionSeqence(), _checkForCollision(), _handleCollision(), and _shouldIgnore().
std::map<std::string, UT_sint32> ABI_Collab_Import::m_remoteRevs [private] |
Referenced by _import(), getRemoteRevisions(), and setInitialRemoteRev().
std::vector<std::pair<UT_UTF8String, UT_sint32> > ABI_Collab_Import::m_revertSet [private] |
Referenced by _handleCollision(), _import(), and _shouldIgnore().
std::deque<UT_sint32> ABI_Collab_Import::m_iAlreadyRevertedRevs [private] |
Referenced by _handleCollision(), and _import().
1.5.5