本文整理汇总了C++中AbiCollabSessionManager::getSession方法的典型用法代码示例。如果您正苦于以下问题:C++ AbiCollabSessionManager::getSession方法的具体用法?C++ AbiCollabSessionManager::getSession怎么用?C++ AbiCollabSessionManager::getSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbiCollabSessionManager
的用法示例。
在下文中一共展示了AbiCollabSessionManager::getSession方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: share
void AP_Dialog_CollaborationShare::share(AccountHandler* pAccount, const std::vector<std::string>& vAcl)
{
UT_DEBUGMSG(("AP_Dialog_CollaborationShare::_share()\n"));
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_if_fail(pManager);
// determine which document to share
XAP_Frame* pFrame = XAP_App::getApp()->getLastFocussedFrame();
UT_return_if_fail(pFrame);
PD_Document* pDoc = static_cast<PD_Document *>(pFrame->getCurrentDoc());
UT_return_if_fail(pDoc);
AbiCollab* pSession = NULL;
if (!pManager->isInSession(pDoc))
{
UT_DEBUGMSG(("Sharing document...\n"));
// FIXME: this can cause a race condition: the other side can already be
// offered the session before we actually started it!
// Tell the account handler that we start a new session, so
// it set up things if needed. This call may just setup some stuff
// for a new session, or it might actually start a new session.
bool b = pAccount->startSession(pDoc, m_vAcl, &pSession);
if (!b)
{
XAP_App::getApp()->getLastFocussedFrame()->showMessageBox(
"There was an error sharing this document!",
XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK);
return;
}
// start the session ourselves when the account handler did not...
if (!pSession)
{
// ... and start the session!
UT_UTF8String sSessionId("");
// TODO: we could use/generate a proper descriptor when there is only
// 1 account where we share this document over
pSession = pManager->startSession(pDoc, sSessionId, pAccount, true, NULL, "");
}
}
else
{
pSession = pManager->getSession(pDoc);
}
UT_return_if_fail(pSession);
pManager->updateAcl(pSession, pAccount, vAcl);
}
示例2: _getActiveSession
AbiCollab* AP_Dialog_CollaborationShare::_getActiveSession()
{
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_val_if_fail(pManager, NULL);
XAP_Frame* pFrame = XAP_App::getApp()->getLastFocussedFrame();
UT_return_val_if_fail(pFrame, NULL);
PD_Document* pDoc = static_cast<PD_Document *>(pFrame->getCurrentDoc());
UT_return_val_if_fail(pDoc, NULL);
if (!pManager->isInSession(pDoc))
return NULL;
return pManager->getSession(pDoc);
}
示例3: s_abicollab_record
bool s_abicollab_record(AV_View* /*v*/, EV_EditMethodCallData* /*d*/)
{
UT_DEBUGMSG(("s_abicollab_record\n"));
// this option only works in debug mode
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame();
UT_return_val_if_fail(pFrame, false);
PD_Document* pDoc = static_cast<PD_Document *>(pFrame->getCurrentDoc());
UT_return_val_if_fail(pDoc, false);
// retrieve session
AbiCollab* session = pManager->getSession( pDoc );
if (session)
{
if (session->isRecording()) {
session->stopRecording();
UT_ASSERT(!session->isRecording());
} else {
session->startRecording( new DiskSessionRecorder( session ) );
UT_ASSERT(session->isRecording());
}
}
return true;
}