Code

aa726b1f912751f262d331ad3537bb2b5545c4b2
[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, 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 send(const Glib::ustring &destJid, Message::Wrapper mwrapper, Message::Message message);
45     bool send(const Glib::ustring &destJid, Message::Wrapper mwrapper, const Glib::ustring &data);
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     SessionType _type;
70     Glib::ustring _recipient;
72     KeyNodeTable _tracker;
73 };
75 }
77 }
79 #endif
81 /*
82   Local Variables:
83   mode:c++
84   c-file-style:"stroustrup"
85   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
86   indent-tabs-mode:nil
87   fill-column:99
88   End:
89 */
90 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :