summaryrefslogtreecommitdiffstats
path: root/src/jabber_whiteboard/inkboard-document.cpp
diff options
context:
space:
mode:
authordaleharvey <daleharvey@users.sourceforge.net>2006-06-23 13:15:16 +0000
committerdaleharvey <daleharvey@users.sourceforge.net>2006-06-23 13:15:16 +0000
commitfcadbfb31e9e8bd463a16369e3de2ec96a413a6a (patch)
tree41c3f39b304687f41ec169c8aa95a5984aa5910f /src/jabber_whiteboard/inkboard-document.cpp
parentquick g_message UndoStackObserver for tracing calls to the undo system (diff)
downloadinkscape-fcadbfb31e9e8bd463a16369e3de2ec96a413a6a.tar.gz
inkscape-fcadbfb31e9e8bd463a16369e3de2ec96a413a6a.zip
manually merging the INKBOARD_PEDRO branch into trunk
(bzr r1268)
Diffstat (limited to 'src/jabber_whiteboard/inkboard-document.cpp')
-rw-r--r--src/jabber_whiteboard/inkboard-document.cpp91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/jabber_whiteboard/inkboard-document.cpp b/src/jabber_whiteboard/inkboard-document.cpp
new file mode 100644
index 000000000..a3881af39
--- /dev/null
+++ b/src/jabber_whiteboard/inkboard-document.cpp
@@ -0,0 +1,91 @@
+/**
+ * Inkscape::Whiteboard::InkboardDocument - Inkboard document implementation
+ *
+ * Authors:
+ * David Yip <yipdw@rose-hulman.edu>
+ *
+ * Copyright (c) 2005 Authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include <glib.h>
+#include <glibmm.h>
+
+#include "jabber_whiteboard/inkboard-document.h"
+
+#include "xml/simple-session.h"
+#include "jabber_whiteboard/inkboard-session.h"
+
+#include "jabber_whiteboard/session-manager.h"
+
+namespace Inkscape {
+
+namespace Whiteboard {
+
+InkboardDocument::InkboardDocument(int code, SessionType type, Glib::ustring const& to) :
+ XML::SimpleNode(code), _type(type), _recipient(to)
+{
+ _initBindings();
+}
+
+void
+InkboardDocument::_initBindings()
+{
+ _bindDocument(*this);
+ _bindLogger(*(new XML::SimpleSession()));
+}
+
+void
+InkboardDocument::setRecipient(Glib::ustring const& val)
+{
+ this->_recipient = val;
+}
+
+Glib::ustring
+InkboardDocument::getRecipient() const
+{
+ return this->_recipient;
+}
+
+void
+InkboardDocument::startSessionNegotiation()
+{
+ SessionManager& sm = SessionManager::instance();
+ switch (_type) {
+ case INKBOARD_MUC:
+ sm.sendGroup(_recipient, CHATROOM_SYNCHRONIZE_REQUEST, " ");
+ break;
+ case INKBOARD_PRIVATE:
+ default:
+ sm.send(_recipient, CONNECT_REQUEST_USER, " ");
+ break;
+ }
+}
+
+void
+InkboardDocument::terminateSession()
+{
+
+}
+
+void
+InkboardDocument::processInkboardEvent(MessageType mtype, unsigned int seqnum, Glib::ustring const& data)
+{
+ g_log(NULL, G_LOG_LEVEL_DEBUG, "Processing Inkboard event: mtype=%d seqnum=%d data=%s\n", mtype, seqnum, data.c_str());
+}
+
+}
+
+}
+
+/*
+ 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:encoding=utf-8:textwidth=99 :