2 #ifndef __TDocument_hh__
3 #define __TDocument_hh__
8 class TDocument : private DOM::EventListener
14 TNode create(const std::string&, unsigned = 0) const;
15 TNode createG(unsigned id = 0) const { return create("g", id); };
16 TNode createC(const std::string&, unsigned = 0) const;
17 TNode createT(const std::string&, const std::string&, unsigned = 0) const;
18 TNode createI(const std::string& text, unsigned id = 0) const { return createT("i", text, id); };
19 TNode createN(const std::string& text, unsigned id = 0) const { return createT("n", text, id); };
20 TNode createO(const std::string& text, unsigned id = 0) const { return createT("o", text, id); };
22 DOM::Document document(void) const { return doc; };
24 TNode root(void) { return doc.get_documentElement(); };
25 TNode dirtyNode(void) const { return dirty; };
26 void clearDirty(void) { dirty = DOM::Element(0); };
28 void serialize(const char*) const;
34 virtual void handleEvent(const DOM::Event&);
35 static unsigned nodeDepth(const DOM::Node&);
36 static DOM::Node findCommonAncestor(const DOM::Node&, const DOM::Node&);
37 static DOM::Node findIdNode(const DOM::Node&);
40 #endif // __TDocument_hh__