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"
19 #include "jabber_whiteboard/defines.h"
20 #include "jabber_whiteboard/keynode.h"
21 #include "jabber_whiteboard/session-manager.h"
23 namespace Inkscape {
25 namespace Whiteboard {
28 class InkboardDocument : public XML::SimpleNode, public XML::Document {
29 public:
31 explicit InkboardDocument(int code, State::SessionType type, Glib::ustring const& to);
33 XML::NodeType type() const
34 {
35 return Inkscape::XML::DOCUMENT_NODE;
36 }
38 void setRecipient(Glib::ustring const& val);
39 Glib::ustring getRecipient() const;
41 void setSessionIdent(Glib::ustring const& val);
42 Glib::ustring getSessionIdent() const;
44 void startSessionNegotiation();
45 void terminateSession();
46 void processInkboardEvent(Message::Wrapper mtype, Glib::ustring const& data);
48 bool sendProtocol(const Glib::ustring &destJid, Message::Wrapper mwrapper,
49 Message::Message message);
52 protected:
53 /**
54 * Copy constructor.
55 *
56 * \param orig Instance to copy.
57 */
58 InkboardDocument(InkboardDocument const& orig) :
59 XML::Node(), XML::SimpleNode(orig), XML::Document(), _recipient(orig._recipient)
60 {
61 _initBindings();
62 }
64 XML::SimpleNode* _duplicate() const
65 {
66 return new InkboardDocument(*this);
67 }
69 private:
71 void _initBindings();
73 SessionManager *_sm;
74 State::SessionType _type;
76 Glib::ustring _session;
77 Glib::ustring _recipient;
79 KeyNodeTable _tracker;
80 };
82 }
84 }
86 #endif
88 /*
89 Local Variables:
90 mode:c++
91 c-file-style:"stroustrup"
92 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
93 indent-tabs-mode:nil
94 fill-column:99
95 End:
96 */
97 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :