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:
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 setSessionIdent(Glib::ustring const& val);
41 Glib::ustring getSessionIdent() const;
43 void startSessionNegotiation();
44 void terminateSession();
45 void processInkboardEvent(Message::Wrapper mtype, unsigned int seqnum, Glib::ustring const& data);
47 bool sendProtocol(const Glib::ustring &destJid, Message::Wrapper mwrapper,
48 Message::Message message);
51 protected:
52 /**
53 * Copy constructor.
54 *
55 * \param orig Instance to copy.
56 */
57 InkboardDocument(InkboardDocument const& orig) :
58 XML::Node(), XML::SimpleNode(orig), XML::Document(), _recipient(orig._recipient)
59 {
60 _initBindings();
61 }
63 XML::SimpleNode* _duplicate() const
64 {
65 return new InkboardDocument(*this);
66 }
68 private:
70 void _initBindings();
72 SessionManager *_sm;
73 State::SessionType _type;
75 Glib::ustring _session;
76 Glib::ustring _recipient;
78 KeyNodeTable _tracker;
79 };
81 }
83 }
85 #endif
87 /*
88 Local Variables:
89 mode:c++
90 c-file-style:"stroustrup"
91 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
92 indent-tabs-mode:nil
93 fill-column:99
94 End:
95 */
96 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :