Code

more session establishment
[inkscape.git] / src / jabber_whiteboard / inkboard-document.h
1 /**
2  * Inkscape::Whiteboard::InkboardDocument - Inkboard document implementation
3  *
4  * Authors:
5  * David Yip <yipdw@rose-hulman.edu>
6  *
7  * Copyright (c) 2005 Authors
8  *
9  * Released under GNU GPL, read the file 'COPYING' for more information
10  */
12 #ifndef __INKSCAPE_WHITEBOARD_INKBOARDDOCUMENT_H__
13 #define __INKSCAPE_WHITEBOARD_INKBOARDDOCUMENT_H__
15 #include <glibmm.h>
17 #include "xml/document.h"
18 #include "xml/simple-node.h"
20 #include "jabber_whiteboard/keynode.h"
21 #include "jabber_whiteboard/session-manager.h"
23 namespace Inkscape {
25 namespace Whiteboard {
27 class InkboardDocument : public XML::SimpleNode, public XML::Document {
28 public:
29         
30     explicit InkboardDocument(int code, State::SessionType type, Glib::ustring const& to);
32     XML::NodeType type() const
33     {
34         return Inkscape::XML::DOCUMENT_NODE;
35     }
37     void setRecipient(Glib::ustring const& val);
38     Glib::ustring getRecipient() const;
40     void startSessionNegotiation();
41     void terminateSession();
42     void processInkboardEvent(Message::Wrapper mtype, unsigned int seqnum, Glib::ustring const& data);
44     bool sendProtocol(const Glib::ustring &destJid, Message::Wrapper mwrapper, 
45         Message::Message message);
48 protected:
49         /**
50          * Copy constructor.
51          * 
52          * \param orig Instance to copy.
53          */
54         InkboardDocument(InkboardDocument const& orig) :
55                 XML::Node(), XML::SimpleNode(orig), XML::Document(), _recipient(orig._recipient)
56         {
57                 _initBindings();
58         }
60         XML::SimpleNode* _duplicate() const
61         {
62                 return new InkboardDocument(*this);
63         }
65 private:
67     void _initBindings();
69     SessionManager *sm;
70     State::SessionType _type;
71     Glib::ustring _recipient;
73     KeyNodeTable _tracker;
74 };
76 }
78 }
80 #endif
82 /*
83   Local Variables:
84   mode:c++
85   c-file-style:"stroustrup"
86   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
87   indent-tabs-mode:nil
88   fill-column:99
89   End:
90 */
91 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :