summaryrefslogtreecommitdiffstats
path: root/src/jabber_whiteboard/message-utilities.h
blob: 5ca07a398d5008e33d538072ba3dd3829c73a492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
 * Whiteboard session manager
 * Message generation utilities
 * 
 * Authors:
 * David Yip <yipdw@rose-hulman.edu>
 * Jonas Collaros, Stephen Montgomery
 *
 * Copyright (c) 2004-2005 Authors
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#ifndef __WHITEBOARD_MESSAGE_UTILITIES_H__
#define __WHITEBOARD_MESSAGE_UTILITIES_H__

#include <glibmm.h>
#include "xml/repr.h"

#include "xml/node.h"
#include "jabber_whiteboard/defines.h"

using Glib::ustring;

namespace Inkscape {

namespace Util {

template< typename T >
class ptr_shared;

}

namespace Whiteboard {

struct Node {
	ustring tag;
	ustring data;
	ustring::size_type next_pos;
};

class XMLNodeTracker;

class MessageUtilities {
public:
    // Message generation utilities
    static Glib::ustring objectToString(Inkscape::XML::Node *element);
/*
    static void newObjectMessage(Glib::ustring &msgbuf, 
                           KeyNodeTable& newnodesbuf, 
                           NewChildObjectMessageList& childmsgbuf, 
                           XMLNodeTracker* xmt,
                           Inkscape::XML::Node const* node, 
                           bool only_collect_nodes = false,
                           bool collect_children = true); 
    static void objectChangeMessage(Glib::ustring &msgbuf, 
                           XMLNodeTracker* xmt,
                           const Glib::ustring &id, 
                           gchar const* key,
                           gchar const* oldval, 
                           gchar const* newval,
                           bool is_interactive);
    static void objectDeleteMessage(Glib::ustring &msgbuf,
                           XMLNodeTracker* xmt, 
                           Inkscape::XML::Node const& parent,
                           Inkscape::XML::Node const& child,
                           Inkscape::XML::Node const* prev);
    static void contentChangeMessage(Glib::ustring &msgbuf,
                           const Glib::ustring &nodeid,
                           Util::ptr_shared<char> old_value,
                           Util::ptr_shared<char> new_value);
    static void childOrderChangeMessage(Glib::ustring &msgbuf,
                           const Glib::ustring &childid,
                           const Glib::ustring &oldprevid,
                           const Glib::ustring &newprevid);

    // Message parsing utilities
    static bool getFirstMessageTag(struct Node& buf,
                          const Glib::ustring &msg);
    static bool findTag(struct Node& buf, 
                          const Glib::ustring &msg);

    // Message tag generation utilities
    static Glib::ustring makeTagWithContent(const Glib::ustring &tagname,
                                            const Glib::ustring &content);
*/
private:
    // noncopyable, nonassignable
    MessageUtilities(MessageUtilities const&);
    MessageUtilities& operator=(MessageUtilities const&);

};

}

}





/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
#endif