Code

:) Wrong line Josh :D
[inkscape.git] / src / jabber_whiteboard / keynode.h
index eb68f40b6af2b3771b28944fb391e50cda5edf59..64c8207329b6aaa35499dc7a8e6736d32a47acb1 100644 (file)
 #include <vector>
 
 #include "xml/node.h"
-
+#include "jabber_whiteboard/defines.h"
 
 namespace Inkscape
 {
 namespace Whiteboard
 {
 
-
 class KeyNodePair
 {
 public:
-   KeyNodePair(const Glib::ustring &keyArg, const XML::Node *nodeArg)
-       {
-       key  = keyArg; 
-       node = (XML::Node *)nodeArg;
-       }
-   KeyNodePair(const KeyNodePair &other)
-       {
-       key  = other.key; 
-       node = other.node;
-       }
-   virtual ~KeyNodePair()
-       {}
-   Glib::ustring key;
-   XML::Node *node;
+
+    KeyNodePair(const Glib::ustring &keyArg, const XML::Node *nodeArg)
+    {
+        this->key  = keyArg; 
+        this->node = (XML::Node *)nodeArg;
+        this->version = 0;
+        this->index = 0;
+        this->history.push_back(Configure("",""));
+    }
+
+    KeyNodePair(const Glib::ustring &keyArg, const XML::Node *nodeArg,
+        unsigned int version, signed int index)
+    {
+        this->key  = keyArg; 
+        this->node = (XML::Node *)nodeArg;
+        this->version = version;
+        this->index = index;
+        this->history.push_back(Configure("",""));
+    }
+
+    KeyNodePair(const KeyNodePair &other)
+    {
+        this->key  = other.key; 
+        this->node = other.node;
+        this->version = other.version;
+        this->index = other.index;
+        this->history = other.history;
+    }
+
+    virtual ~KeyNodePair() {}
+
+    Glib::ustring key;
+    XML::Node *node;
+    unsigned int version;
+    signed int index;
+    std::list< Configure > history;
 };
 
 class KeyNodeTable
@@ -47,11 +68,12 @@ class KeyNodeTable
 public:
 
     KeyNodeTable()
-        {}
+        { this->counter = 0; }
 
     KeyNodeTable(const KeyNodeTable &other)
         {
         items = other.items;
+        this->counter = 0;
         }
 
     virtual ~KeyNodeTable()
@@ -79,6 +101,14 @@ public:
 
     virtual Glib::ustring generateKey(Glib::ustring);
 
+    virtual unsigned int getVersion(XML::Node *node);
+
+    virtual unsigned int incrementVersion(XML::Node *node);
+
+    virtual void addHistory(XML::Node *node, Glib::ustring attribute, Glib::ustring value);
+
+    virtual Glib::ustring getLastHistory(XML::Node *node, Glib::ustring attribute);
+
 private:
 
     std::vector<KeyNodePair> items;