Code

Unify stat type for older glib.
[inkscape.git] / src / jabber_whiteboard / message-utilities.h
1 /**
2  * Whiteboard session manager
3  * Message generation utilities
4  * 
5  * Authors:
6  * David Yip <yipdw@rose-hulman.edu>
7  * Jonas Collaros, Stephen Montgomery
8  *
9  * Copyright (c) 2004-2005 Authors
10  *
11  * Released under GNU GPL, read the file 'COPYING' for more information
12  */
14 #ifndef __WHITEBOARD_MESSAGE_UTILITIES_H__
15 #define __WHITEBOARD_MESSAGE_UTILITIES_H__
17 #include <glibmm.h>
18 #include "xml/repr.h"
20 #include "xml/node.h"
21 #include "jabber_whiteboard/defines.h"
23 using Glib::ustring;
25 namespace Inkscape {
27 namespace Util {
29 template< typename T >
30 class ptr_shared;
32 }
34 namespace Whiteboard {
36 struct Node {
37         ustring tag;
38         ustring data;
39         ustring::size_type next_pos;
40 };
42 class XMLNodeTracker;
44 class MessageUtilities {
45 public:
46     // Message generation utilities
47     static Glib::ustring objectToString(Inkscape::XML::Node *element);
48 /*
49     static void newObjectMessage(Glib::ustring &msgbuf, 
50                            KeyNodeTable& newnodesbuf, 
51                            NewChildObjectMessageList& childmsgbuf, 
52                            XMLNodeTracker* xmt,
53                            Inkscape::XML::Node const* node, 
54                            bool only_collect_nodes = false,
55                            bool collect_children = true); 
56     static void objectChangeMessage(Glib::ustring &msgbuf, 
57                            XMLNodeTracker* xmt,
58                            const Glib::ustring &id, 
59                            gchar const* key,
60                            gchar const* oldval, 
61                            gchar const* newval,
62                            bool is_interactive);
63     static void objectDeleteMessage(Glib::ustring &msgbuf,
64                            XMLNodeTracker* xmt, 
65                            Inkscape::XML::Node const& parent,
66                            Inkscape::XML::Node const& child,
67                            Inkscape::XML::Node const* prev);
68     static void contentChangeMessage(Glib::ustring &msgbuf,
69                            const Glib::ustring &nodeid,
70                            Util::ptr_shared<char> old_value,
71                            Util::ptr_shared<char> new_value);
72     static void childOrderChangeMessage(Glib::ustring &msgbuf,
73                            const Glib::ustring &childid,
74                            const Glib::ustring &oldprevid,
75                            const Glib::ustring &newprevid);
77     // Message parsing utilities
78     static bool getFirstMessageTag(struct Node& buf,
79                           const Glib::ustring &msg);
80     static bool findTag(struct Node& buf, 
81                           const Glib::ustring &msg);
83     // Message tag generation utilities
84     static Glib::ustring makeTagWithContent(const Glib::ustring &tagname,
85                                             const Glib::ustring &content);
86 */
87 private:
88     // noncopyable, nonassignable
89     MessageUtilities(MessageUtilities const&);
90     MessageUtilities& operator=(MessageUtilities const&);
92 };
94 }
96 }
102 /*
103   Local Variables:
104   mode:c++
105   c-file-style:"stroustrup"
106   c-file-offsets:((innamespace . 0)(inline-open . 0))
107   indent-tabs-mode:nil
108   fill-column:99
109   End:
110 */
111 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
112 #endif