#include <AbiCollab.h>
AbiCollab::AbiCollab | ( | PD_Document * | pDoc, | |
const std::string & | sSessionId, | |||
AccountHandler * | pAclAccount, | |||
bool | bLocallyOwned | |||
) |
AbiCollab::AbiCollab | ( | const std::string & | sSessionId, | |
PD_Document * | pDoc, | |||
const std::string & | docUUID, | |||
UT_sint32 | iRev, | |||
BuddyPtr | pControler, | |||
AccountHandler * | pAclAccount, | |||
bool | m_bLocallyOwned | |||
) |
AbiCollab::~AbiCollab | ( | void | ) | [virtual] |
bool AbiCollab::_allSlavesAckedSessionTakeover | ( | ) | [private] |
References m_mAckedSessionTakeoverBuddies, and m_vCollaborators.
bool AbiCollab::_allSlavesReconnected | ( | ) | [private] |
References m_vApprovedReconnectBuddies, and UT_DEBUGMSG.
Referenced by _checkRestartAsMaster().
void AbiCollab::_becomeMaster | ( | ) | [private] |
References m_bProposedController, m_pController, m_vCollaborators, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_if_fail, and UT_SHOULD_NOT_HAPPEN.
Referenced by _handleSessionTakeover().
void AbiCollab::_checkRestartAsMaster | ( | ) | [private] |
References _allSlavesReconnected(), _restartAsMaster(), m_bSessionFlushed, and UT_DEBUGMSG.
Referenced by _handleSessionTakeover().
void AbiCollab::_checkRevokeAccess | ( | BuddyPtr | pCollaborator | ) | [private] |
References isLocallyControlled(), m_pAclAccount, m_vAcl, UT_DEBUGMSG, and UT_return_if_fail.
Referenced by removeCollaborator().
bool AbiCollab::_handleSessionTakeover | ( | AbstractSessionTakeoverPacket * | pPacket, | |
BuddyPtr | collaborator | |||
) | [private] |
References _becomeMaster(), _checkRestartAsMaster(), _hasAckedSessionTakeover(), _restartAsSlave(), _shutdownAsMaster(), _switchMaster(), addCollaborator(), AbiCollabSessionManager::constructBuddy(), SessionTakeoverRequestPacket::getBuddyIdentifiers(), SessionPacket::getDocUUID(), AD_Document::getDocUUIDString(), AbiCollabSessionManager::getManager(), SessionReconnectAckPacket::getRev(), m_bProposedController, m_bSessionFlushed, m_eTakeoveState, m_mAckedSessionTakeoverBuddies, m_pController, m_pDoc, m_pProposedController, m_sId, m_vApprovedReconnectBuddies, m_vCollaborators, PCT_SessionFlushedPacket, SessionTakeoverRequestPacket::promote(), STS_NONE, STS_SENT_SESSION_RECONNECT_REQUEST, STS_SENT_TAKEOVER_ACK, STS_SENT_TAKEOVER_REQUEST, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_val_if_fail, and UT_SHOULD_NOT_HAPPEN.
Referenced by import().
bool AbiCollab::_hasAckedSessionTakeover | ( | BuddyPtr | collaborator | ) | [private] |
References m_mAckedSessionTakeoverBuddies.
Referenced by _handleSessionTakeover(), and import().
void AbiCollab::_pushOutgoingQueue | ( | ) | [private] |
References AbiCollab::SessionPacketVector::clear(), m_vOutgoingQueue, push(), and UT_DEBUGMSG.
Referenced by _restartAsMaster(), and _restartAsSlave().
void AbiCollab::_releaseMouseDrag | ( | ) | [private] |
References DELETEP, m_bDoingMouseDrag, m_vIncomingQueue, and UT_continue_if_fail.
Referenced by signalMouse().
void AbiCollab::_removeCollaborator | ( | BuddyPtr | pCollaborator, | |
const std::string & | docUUID | |||
) | [private] |
References ABI_Collab_Import::getRemoteRevisions(), m_Import, m_pDoc, PD_Document::removeCaret(), UT_DEBUGMSG, and UT_return_if_fail.
Referenced by removeCollaborator().
void AbiCollab::_restartAsMaster | ( | ) | [private] |
References _pushOutgoingQueue(), PD_Document::getCRNumber(), AD_Document::getDocUUIDString(), m_eTakeoveState, m_Export, m_Import, m_pDoc, m_sId, m_vCollaborators, ABI_Collab_Export::masterInit(), ABI_Collab_Import::masterInit(), AccountHandler::send(), UT_continue_if_fail, and UT_DEBUGMSG.
Referenced by _checkRestartAsMaster().
bool AbiCollab::_restartAsSlave | ( | const std::string & | sDocUUID, | |
UT_sint32 | iRev | |||
) | [private] |
References _pushOutgoingQueue(), m_eTakeoveState, m_Export, m_Import, m_pController, ABI_Collab_Export::slaveInit(), ABI_Collab_Import::slaveInit(), UT_DEBUGMSG, and UT_return_val_if_fail.
Referenced by _handleSessionTakeover().
void AbiCollab::_setDocListenerId | ( | UT_uint32 | iDocListenerId | ) | [inline, private] |
References m_iDocListenerId.
Referenced by _setDocument().
void AbiCollab::_setDocument | ( | PD_Document * | pDoc | ) | [private] |
References _setDocListenerId(), PD_Document::addListener(), XAP_App::getApp(), XAP_Frame::getCurrentDoc(), XAP_App::getFrame(), XAP_App::getFrameCount(), AbiCollabSessionManager::getManager(), XAP_Frame::getMouse(), m_Export, m_iDocListenerId, m_mMouseListenerIds, m_pDoc, EV_Mouse::registerListener(), UT_continue_if_fail, UT_DEBUGMSG, and UT_return_if_fail.
Referenced by AbiCollab().
void AbiCollab::_shutdownAsMaster | ( | ) | [private] |
void AbiCollab::_switchMaster | ( | ) | [private] |
References addCollaborator(), m_bProposedController, m_pController, m_pProposedController, m_vCollaborators, UT_DEBUGMSG, and UT_return_if_fail.
Referenced by _handleSessionTakeover().
void AbiCollab::addChangeAdjust | ( | ChangeAdjust * | pAdjust | ) |
void AbiCollab::addCollaborator | ( | BuddyPtr | pCollaborator | ) |
References AccountHandler::hasAccess(), isLocallyControlled(), m_vAcl, m_vCollaborators, UT_ASSERT, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_NOT_IMPLEMENTED, UT_return_if_fail, and UT_SHOULD_NOT_HAPPEN.
Referenced by AccountHandler::_handlePacket(), _handleSessionTakeover(), FakeAccountHandler::_import(), _switchMaster(), and AbiCollab().
void AbiCollab::appendAcl | ( | const std::string & | sBuddyDescriptor | ) |
References m_vAcl.
Referenced by TCPAccountHandler::addBuddy().
const std::vector<std::string>& AbiCollab::getAcl | ( | ) | [inline] |
References m_vAcl.
Referenced by AP_Dialog_CollaborationShare::_getSessionACL(), and AccountHandler::_handlePacket().
AccountHandler* AbiCollab::getAclAccount | ( | ) | [inline] |
const AbstractChangeRecordSessionPacket* AbiCollab::getActivePacket | ( | ) | const [inline] |
References m_pActivePacket.
Referenced by ABI_Collab_Export::_handleNewPacket(), and ABI_Collab_Export::change().
const std::map<BuddyPtr, std::string>& AbiCollab::getCollaborators | ( | ) | const [inline] |
PD_Document* AbiCollab::getDocument | ( | void | ) | const [inline] |
References m_pDoc.
Referenced by AccountHandler::_handlePacket(), AbiCollabSaveInterceptor::_save_cb(), AbiCollabSaveInterceptor::_saveFailed(), AbiCollabSessionManager::destroySession(), AbiCollabSessionManager::disconnectSession(), AbiCollabSessionManager::disjoinSession(), AbiCollabSessionManager::findFrameForSession(), AbiCollabSessionManager::getSession(), AbiCollabSessionManager::getSessionFromDocumentId(), AbiCollabSessionManager::isInSession(), AbiCollabSessionManager::isLocallyControlled(), AbiCollabSessionManager::processPacket(), and AbiCollabSessionManager::removeBuddy().
ABI_Collab_Export* AbiCollab::getExport | ( | void | ) | [inline] |
ABI_Collab_Import* AbiCollab::getImport | ( | void | ) | [inline] |
References m_Import.
Referenced by FakeAccountHandler::_import().
const std::string& AbiCollab::getSessionId | ( | ) | const [inline] |
References m_sId.
Referenced by ABI_Collab_Import::_handleCollision(), AccountHandler::_handlePacket(), AbiCollabSessionManager::closeSession(), PacketFactory< _PacketType >::create(), AbiCollabSessionManager::destroyAccount(), AbiCollabSessionManager::disconnectSession(), DiskSessionRecorder::DiskSessionRecorder(), ServiceAccountHandler::getAcl(), AbiCollabSessionManager::getSessionFromSessionId(), FakeAccountHandler::initialize(), AbiCollabSessionManager::isActive(), AbiCollabSessionManager::joinSession(), TelepathyAccountHandler::setAcl(), ServiceAccountHandler::setAcl(), ABI_Collab_Export::signal(), and startRecording().
void AbiCollab::import | ( | SessionPacket * | pPacket, | |
BuddyPtr | collaborator | |||
) |
References _handleSessionTakeover(), _hasAckedSessionTakeover(), Packet::clone(), SessionPacket::getDocUUID(), ABI_Collab_Import::import(), AbstractChangeRecordSessionPacket::isInstanceOf(), AbstractSessionTakeoverPacket::isInstanceOf(), isLocallyControlled(), m_bDoingMouseDrag, m_eTakeoveState, m_Import, m_pActivePacket, m_pRecorder, m_vCollaborators, m_vIncomingQueue, maskExport(), push(), SessionRecorderInterface::storeIncoming(), STS_NONE, STS_SENT_TAKEOVER_REQUEST, unmaskExport(), UT_ASSERT_HARMLESS, UT_continue_if_fail, UT_DEBUGMSG, UT_return_if_fail, and UT_SHOULD_NOT_HAPPEN.
Referenced by AbiCollabSessionManager::processPacket().
void AbiCollab::initiateSessionTakeover | ( | BuddyPtr | pNewMaster | ) |
References AbiCollabSessionManager::beginAsyncOperation(), AbiCollab::SessionPacketVector::clear(), AD_Document::getDocUUIDString(), AbiCollabSessionManager::getManager(), m_bProposedController, m_bSessionFlushed, m_eTakeoveState, m_mAckedSessionTakeoverBuddies, m_pDoc, m_pProposedController, m_sId, m_vApprovedReconnectBuddies, m_vCollaborators, m_vOutgoingQueue, UT_ASSERT_HARMLESS, UT_continue_if_fail, UT_DEBUGMSG, UT_return_if_fail, and UT_SHOULD_NOT_HAPPEN.
Referenced by AbiCollabSessionManager::disconnectSession().
bool AbiCollab::isController | ( | BuddyPtr | pCollaborator | ) | const [inline] |
References m_pController.
Referenced by TelepathyChatroom::isController(), and AbiCollabSessionManager::removeBuddy().
bool AbiCollab::isExportMasked | ( | void | ) | const [inline] |
References m_bExportMasked.
bool AbiCollab::isLocallyControlled | ( | ) | const [inline] |
References m_pController.
Referenced by AbiCollabSessionManager::_canInitiateSessionTakeover(), _checkRevokeAccess(), ABI_Collab_Import::_handleCollision(), AccountHandler::_handlePacket(), ABI_Collab_Import::_shouldIgnore(), addCollaborator(), AbiCollabSessionManager::closeSession(), DiskSessionRecorder::DiskSessionRecorder(), import(), TelepathyChatroom::isLocallyControlled(), AbiCollabSessionManager::isLocallyControlled(), push(), AbiCollabSessionManager::removeBuddy(), and startRecording().
bool AbiCollab::isLocallyOwned | ( | ) | const [inline] |
References m_bLocallyOwned.
Referenced by Defun_EV_GetMenuItemState_Fn().
bool AbiCollab::isRecording | ( | ) | [inline] |
References m_pRecorder.
Referenced by Defun_EV_GetMenuItemState_Fn().
void AbiCollab::maskExport | ( | ) |
References AbiCollab::SessionPacketVector::clear(), m_bExportMasked, and m_vecMaskedPackets.
Referenced by import().
void AbiCollab::push | ( | SessionPacket * | pPacket | ) |
Send this packet. Note, the specified packet does still belong to the calling class. So if we want to store it (for masking), we HAVE to clone it first
References _fillRemoteRev(), Packet::clone(), isLocallyControlled(), m_bExportMasked, m_bIsReverting, m_eTakeoveState, m_pRecorder, m_vCollaborators, m_vecMaskedPackets, m_vOutgoingQueue, AccountHandler::send(), SessionRecorderInterface::storeOutgoing(), UT_continue_if_fail, UT_DEBUGMSG, and UT_return_if_fail.
Referenced by ABI_Collab_Import::_handleCollision(), ABI_Collab_Export::_handleNewPacket(), _pushOutgoingQueue(), ABI_Collab_Export::change(), import(), and ABI_Collab_Export::signal().
bool AbiCollab::push | ( | SessionPacket * | pPacket, | |
BuddyPtr | collaborator | |||
) |
void AbiCollab::removeCollaborator | ( | BuddyPtr | pCollaborator | ) |
References _checkRevokeAccess(), _removeCollaborator(), m_vCollaborators, UT_continue_if_fail, and UT_return_if_fail.
Referenced by AbiCollabSessionManager::processPacket(), and AbiCollabSessionManager::removeBuddy().
void AbiCollab::removeMouse | ( | EV_Mouse * | pMouse | ) | [virtual] |
Implements EV_MouseListener.
References m_mMouseListenerIds, and UT_return_if_fail.
void AbiCollab::setAcl | ( | const std::vector< std::string > | vAcl | ) |
References m_vAcl, and UT_DEBUGMSG.
Referenced by AbiCollabSessionManager::updateAcl().
void AbiCollab::setIsReverting | ( | bool | bIsReverting | ) | [inline] |
References m_bIsReverting.
Referenced by ABI_Collab_Import::_handleCollision().
void AbiCollab::signalMouse | ( | EV_EditBits | eb, | |
UT_sint32 | xPos, | |||
UT_sint32 | yPos | |||
) | [virtual] |
Implements EV_MouseListener.
References _releaseMouseDrag(), EV_EMB__MASK__, EV_EMB_BUTTON0, EV_EMO__MASK__, EV_EMO_DOUBLEDRAG, EV_EMO_DOUBLERELEASE, EV_EMO_DRAG, EV_EMO_RELEASE, m_bDoingMouseDrag, and UT_DEBUGMSG.
void AbiCollab::startRecording | ( | SessionRecorderInterface * | pRecorder | ) |
References ABI_Collab_Export::getAdjusts(), PD_Document::getCRNumber(), AD_Document::getDocUUIDString(), AD_Document::getFilename(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), getSessionId(), isLocallyControlled(), m_Export, JoinSessionRequestResponseEvent::m_iRev, m_pDoc, m_pRecorder, JoinSessionRequestResponseEvent::m_sDocumentId, JoinSessionRequestResponseEvent::m_sDocumentName, JoinSessionRequestResponseEvent::m_sZABW, AbiCollabSessionManager::serializeDocument(), SessionRecorderInterface::storeOutgoing(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_go_basename_from_uri(), UT_NOT_IMPLEMENTED, UT_OK, UT_return_if_fail, and UT_SHOULD_NOT_HAPPEN.
Referenced by AbiCollab().
void AbiCollab::stopRecording | ( | ) |
References DELETEP, and m_pRecorder.
const std::vector< SessionPacket * > & AbiCollab::unmaskExport | ( | ) | [virtual] |
References m_bExportMasked, and m_vecMaskedPackets.
Referenced by import().
friend class ABI_Collab_Export [friend] |
bool AbiCollab::m_bCloseNow [private] |
bool AbiCollab::m_bDoingMouseDrag [private] |
Referenced by _releaseMouseDrag(), import(), and signalMouse().
bool AbiCollab::m_bExportMasked [private] |
Referenced by isExportMasked(), maskExport(), push(), and unmaskExport().
bool AbiCollab::m_bIsReverting [private] |
Referenced by addChangeAdjust(), push(), and setIsReverting().
bool AbiCollab::m_bLocallyOwned [private] |
Referenced by isLocallyOwned().
bool AbiCollab::m_bProposedController [private] |
Referenced by _becomeMaster(), _handleSessionTakeover(), _shutdownAsMaster(), _switchMaster(), and initiateSessionTakeover().
bool AbiCollab::m_bSessionFlushed [private] |
Referenced by _checkRestartAsMaster(), _handleSessionTakeover(), and initiateSessionTakeover().
Referenced by _handleSessionTakeover(), _restartAsMaster(), _restartAsSlave(), import(), initiateSessionTakeover(), and push().
ABI_Collab_Export AbiCollab::m_Export [private] |
Referenced by _restartAsMaster(), _restartAsSlave(), _setDocument(), AbiCollab(), addChangeAdjust(), getExport(), and startRecording().
UT_uint32 AbiCollab::m_iDocListenerId [private] |
Referenced by _setDocListenerId(), _setDocument(), and ~AbiCollab().
ABI_Collab_Import AbiCollab::m_Import [private] |
Referenced by _fillRemoteRev(), _removeCollaborator(), _restartAsMaster(), _restartAsSlave(), AbiCollab(), getImport(), and import().
std::map<BuddyPtr, bool> AbiCollab::m_mAckedSessionTakeoverBuddies [private] |
std::map<EV_Mouse*, UT_sint32> AbiCollab::m_mMouseListenerIds [private] |
Referenced by _setDocument(), removeMouse(), and ~AbiCollab().
AccountHandler* AbiCollab::m_pAclAccount [private] |
Referenced by _checkRevokeAccess(), and getAclAccount().
const AbstractChangeRecordSessionPacket* AbiCollab::m_pActivePacket [private] |
Referenced by getActivePacket(), and import().
CommandLine* AbiCollab::m_pCommandLine [private] |
BuddyPtr AbiCollab::m_pController [private] |
PD_Document* AbiCollab::m_pDoc [private] |
BuddyPtr AbiCollab::m_pProposedController [private] |
Referenced by _handleSessionTakeover(), _switchMaster(), and initiateSessionTakeover().
SessionRecorderInterface* AbiCollab::m_pRecorder [private] |
Referenced by import(), isRecording(), push(), startRecording(), stopRecording(), and ~AbiCollab().
std::string AbiCollab::m_sId [private] |
Referenced by _handleSessionTakeover(), _restartAsMaster(), _shutdownAsMaster(), getSessionId(), and initiateSessionTakeover().
std::vector<std::string> AbiCollab::m_vAcl [private] |
Referenced by _checkRevokeAccess(), addCollaborator(), appendAcl(), getAcl(), and setAcl().
std::map<std::string, bool> AbiCollab::m_vApprovedReconnectBuddies [private] |
Referenced by _allSlavesReconnected(), _handleSessionTakeover(), and initiateSessionTakeover().
std::map<BuddyPtr, std::string> AbiCollab::m_vCollaborators [private] |
Referenced by maskExport(), push(), and unmaskExport().
std::vector<std::pair<SessionPacket*,BuddyPtr> > AbiCollab::m_vIncomingQueue [private] |
Referenced by _releaseMouseDrag(), and import().
Referenced by _pushOutgoingQueue(), initiateSessionTakeover(), and push().