Code

patch 1219308 for embedding type 1 fonts into ps/eps output
[inkscape.git] / src / jabber_whiteboard / inkboard-document.h
index fcd3bab6aaeda3994b1298634996f671fdc0a559..5eaeffca8e65ee8434f5707f77fe8003acc63d2a 100644 (file)
@@ -25,17 +25,19 @@ namespace Inkscape {
 
 namespace Whiteboard {
 
-
 class InkboardDocument : public XML::SimpleNode, public XML::Document {
 public:
        
-    explicit InkboardDocument(int code, State::SessionType type, Glib::ustring const& to);
+    explicit InkboardDocument(int code, State::SessionType sessionType, Glib::ustring const& to);
 
     XML::NodeType type() const
     {
        return Inkscape::XML::DOCUMENT_NODE;
     }
 
+    State::SessionState state;
+    KeyNodeTable *tracker;
+
     void setRecipient(Glib::ustring const& val);
     Glib::ustring getRecipient() const;
 
@@ -44,15 +46,35 @@ public:
 
     void startSessionNegotiation();
     void terminateSession();
-    void processInkboardEvent(Message::Wrapper &wrapper, Pedro::Element* data);
 
-    bool sendProtocol(const Glib::ustring &destJid, Message::Wrapper &mwrapper, 
-        Message::Message message);
+    void recieve(Message::Wrapper &wrapper, Pedro::Element* data);
+    bool send(const Glib::ustring &destJid, Message::Wrapper &mwrapper, 
+            Message::Message &message);
+
+    void sendDocument(Inkscape::XML::Node* root);
 
     bool handleOutgoingState(Message::Wrapper &wrapper,Glib::ustring const& message);
     bool handleIncomingState(Message::Wrapper &wrapper,Pedro::Element* data);
 
-    bool handleState(State::SessionState expectedState, State::SessionState newstate);
+    bool handleState(State::SessionState expectedState, 
+            State::SessionState newstate);
+
+    void handleChange(Message::Wrapper &wrapper, Pedro::Element* data);
+
+
+    /* Functions below are defined in inkboard-node.cpp */
+    Glib::ustring addNodeToTracker(Inkscape::XML::Node* node);
+    Message::Message composeNewMessage(Inkscape::XML::Node *node);
+
+    void changeConfigure(Glib::ustring target, unsigned int version,
+            Glib::ustring attribute, Glib::ustring value);
+
+    void changeNew(Glib::ustring target, Glib::ustring, 
+            signed int index, Pedro::Element* data);
+
+    void changeConfigureText(Glib::ustring target, unsigned int version,
+            Glib::ustring text);
+
 
 protected:
        /**
@@ -61,7 +83,7 @@ protected:
         * \param orig Instance to copy.
         */
        InkboardDocument(InkboardDocument const& orig) :
-               XML::Node(), XML::SimpleNode(orig), XML::Document(), _recipient(orig._recipient)
+               XML::Node(), XML::SimpleNode(orig), XML::Document(), recipient(orig.recipient)
        {
                _initBindings();
        }
@@ -75,15 +97,12 @@ private:
 
     void _initBindings();
 
-    SessionManager      *_sm;
-    SPDocument          *_doc;
-    State::SessionType  _type;
-    State::SessionState state;
+    SessionManager      *sm;
 
-    Glib::ustring _session;
-    Glib::ustring _recipient;
+    State::SessionType  sessionType;
 
-    KeyNodeTable _tracker;
+    Glib::ustring sessionId;
+    Glib::ustring recipient;
 };
 
 }