session-manager.cpp revision a4030d5ca449e7e384bc699cd249ee704faaeab0
/**
* Whiteboard session manager
*
* Authors:
* David Yip <yipdw@rose-hulman.edu>
* Bob Jamison (Pedro port)
*
* Copyright (c) 2005 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <functional>
#include <algorithm>
#include <iostream>
#include <time.h>
#include <gtkmm.h>
#include "util/ucompose.hpp"
#include "xml/node-observer.h"
#include "pedro/pedrodom.h"
#include "ui/view/view-widget.h"
#include "document-private.h"
#include "interface.h"
#include "sp-namedview.h"
#include "document.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "jabber_whiteboard/invitation-confirm-dialog.h"
#include "jabber_whiteboard/message-verifier.h"
#include "jabber_whiteboard/session-manager.h"
#include "jabber_whiteboard/inkboard-document.h"
#include "jabber_whiteboard/defines.h"
#include "jabber_whiteboard/dialog/choose-desktop.h"
namespace Inkscape {
namespace Whiteboard {
//#########################################################################
//# S E S S I O N M A N A G E R
//#########################################################################
void SessionManager::showClient()
{
}
{
if (!sessionManagerInstance)
sessionManagerInstance = new SessionManager();
return *sessionManagerInstance;
}
{
getClient().addXmppEventListener(*this);
this->CheckPendingInvitations =
}
{
getClient().removeXmppEventListener(*this);
getClient().disconnect();
}
/**
* Initiates a shared session with a user or conference room.
*
* \param to The recipient to which this desktop will be linked, specified as a JID.
* \param type Type of the session; i.e. private message or group chat.
*/
void
{
{
{
{
}
}else { return; }
}
}
void
{
for(; i != whiteboards.end(); ++i) {
break;
}
if (i != whiteboards.end()) {
(*i).second->terminateSession();
whiteboards.erase(i);
}
}
void
{
}
{
for(; i != whiteboards.end(); ++i) {
return (*i).second;
}
}
return NULL;
}
void
{
switch (type) {
{
break;
}
{
break;
}
{
break;
}
{
break;
}
{
break;
}
{
break;
}
{
break;
}
{
break;
}
{
break;
}
default:
{
break;
}
}
}
/**
* Handles all incoming messages from pedro within a valid namespace, CONNECT_REQUEST messages
* are handled here, as they have no InkboardDocument to be handled from, all other messages
* are passed to their appropriate Inkboard document, which is identified by the 'session'
* attribute of the 'wb' element
*
*/
void
{
g_warning("Received null DOM; ignoring message.");
return;
}
g_warning("Received incomplete Whiteboard message, missing session identifier; ignoring message.");
return;
}
{
}else
{
}
}
char*
{
// Create a random session identifier
for (int n=0; n<size; n++)
return randomString;
}
/**
* Adds an invitation to a queue to be executed in SessionManager::_checkInvitationQueue()
* as when this method is called, we're still executing in Pedro's context, which causes
* issues when we run a dialog main loop.
*
*/
void
{
// don't insert duplicate invitations
return;
}
bool
{
// The user is currently busy with an action. Defer invitation processing
// until the user is free.
int x, y;
if (mt & GDK_BUTTON1_MASK)
return true;
if (invitations.size() > 0)
{
// There's an invitation to process; process it.
"<span weight=\"bold\" size=\"larger\">" +
"</span>\n\n" +
SPDocument* doc = makeInkboardDocument(g_quark_from_static_string("xml"), "svg:svg", State::WHITEBOARD_PEER, from);
switch (reply) {
case Dialog::ACCEPT_INVITATION:{
break; }
case Dialog::DECLINE_INVITATION: default: {
break; }
}
}
return true;
}
//#########################################################################
//# HELPER FUNCTIONS
//#########################################################################
makeInkboardDocument(int code, gchar const* rootname, State::SessionType type, Glib::ustring const& to)
{
return doc;
}
// TODO: When the switchover to the new GUI is complete, this function should go away
// and be replaced with a call to Inkscape::NSApplication::Editor::createDesktop.
// It currently only exists to correctly mimic the desktop creation functionality
// in file.cpp.
//
// \see sp_file_new
{
return dt;
}
} // namespace Whiteboard
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :