Code

Update to inkboard
[inkscape.git] / src / jabber_whiteboard / inkboard-node.cpp
1 /**
2  * Inkscape::Whiteboard::InkboardDocument - Inkboard document implementation
3  *
4  * Authors:
5  * Dale Harvey <harveyd@gmail.com>
6  *
7  * Copyright (c) 2005 Authors
8  *
9  * Released under GNU GPL, read the file 'COPYING' for more information
10  */
12 #include <glib.h>
13 #include <glibmm.h>
15 #include "util/ucompose.hpp"
17 #include "jabber_whiteboard/message-utilities.h"
18 #include "jabber_whiteboard/defines.h"
19 #include "jabber_whiteboard/inkboard-document.h"
22 namespace Inkscape {
24 namespace Whiteboard {
26 Glib::ustring
27 InkboardDocument::addNodeToTracker(Inkscape::XML::Node *node)
28 {
29     Glib::ustring key = this->tracker->generateKey(this->getRecipient());
30     this->tracker->put(key,node);
31     return key;
32 }
34 Message::Message
35 InkboardDocument::composeNewMessage(Inkscape::XML::Node *node)
36 {
37     Glib::ustring parentKey;
38     Glib::ustring key = this->tracker->get(node);
39     Inkscape::XML::Node *parent = node->parent();
41     Glib::ustring tempParentKey = this->tracker->get(node->parent());
42     if(tempParentKey.size() < 1)
43         parentKey = Vars::DOCUMENT_ROOT_NODE;
44     else
45         parentKey = tempParentKey;
47     unsigned int index = parent->_childPosition(*node);
49     Message::Message nodeMessage = MessageUtilities::objectToString(node);
50     Message::Message message = String::ucompose(Vars::NEW_MESSAGE,parentKey,key,index,nodeMessage);
52     return message;
53 }
55 void
56 InkboardDocument::changeConfigure(Glib::ustring target, signed int version, 
57         Glib::ustring attribute, Glib::ustring value)
58 {
59 }
61 void 
62 InkboardDocument::changeNew(Glib::ustring target, Glib::ustring, 
63         signed int index, Pedro::Element* data)
64 {
65     Glib::ustring name = data->getName();
67     if(name == "text")
68     { 
69         //XML::Node* parent = this->tracker->get(target);
70         //parent->setContent(date->getValue());
71     }
73 }
75 } // namespace Whiteboard
76 } // namespace Inkscape
79 /*
80   Local Variables:
81   mode:c++
82   c-file-style:"stroustrup"
83   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
84   indent-tabs-mode:nil
85   fill-column:99
86   End:
87 */
88 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :