00001
00002
00003 #ifndef _GSTREAMERMM_XML_H
00004 #define _GSTREAMERMM_XML_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <gst/gstxml.h>
00031 #include <gstreamermm/object.h>
00032 #include <libxml++/document.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GstXML GstXML;
00037 typedef struct _GstXMLClass GstXMLClass;
00038 #endif
00039
00040
00041 namespace Gst
00042 { class XML_Class; }
00043 namespace Gst
00044 {
00045
00046 class Element;
00047
00058 class XML : public Object
00059 {
00060
00061 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00062
00063 public:
00064 typedef XML CppObjectType;
00065 typedef XML_Class CppClassType;
00066 typedef GstXML BaseObjectType;
00067 typedef GstXMLClass BaseClassType;
00068
00069 private: friend class XML_Class;
00070 static CppClassType xml_class_;
00071
00072 private:
00073
00074 XML(const XML&);
00075 XML& operator=(const XML&);
00076
00077 protected:
00078 explicit XML(const Glib::ConstructParams& construct_params);
00079 explicit XML(GstXML* castitem);
00080
00081 #endif
00082
00083 public:
00084 virtual ~XML();
00085
00086 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00087 static GType get_type() G_GNUC_CONST;
00088 static GType get_base_type() G_GNUC_CONST;
00089 #endif
00090
00092 GstXML* gobj() { return reinterpret_cast<GstXML*>(gobject_); }
00093
00095 const GstXML* gobj() const { return reinterpret_cast<GstXML*>(gobject_); }
00096
00098 GstXML* gobj_copy();
00099
00100 private:
00101
00102
00103 protected:
00104 XML();
00105
00106 public:
00107
00108 static Glib::RefPtr<XML> create();
00109
00110
00115 static xmlDocPtr write(const Glib::RefPtr<Element>& element);
00116
00123 static void write_to_stream(const Glib::RefPtr<Element>& element, std::ostream& out);
00124
00125
00132 bool parse_doc(xmlpp::Document* doc, Glib::ustring& root);
00133
00146 bool parse_file(const std::string& filename, const Glib::ustring& root);
00147
00155 bool parse_memory(const std::string& buffer, const Glib::ustring& root);
00156
00157
00158
00159
00166 Glib::RefPtr<Element> get_element(const Glib::ustring& name);
00167
00174 Glib::RefPtr<const Element> get_element(const Glib::ustring& name) const;
00175
00176
00183 Glib::ListHandle< Glib::RefPtr<Element> > get_topelements();
00184
00185
00192 Glib::ListHandle< Glib::RefPtr<const Element> > get_topelements() const;
00193
00194
00200 static Glib::RefPtr<Element> make_element(xmlpp::Node* curr, const Glib::RefPtr<Gst::Object>& parent);
00201
00202
00208 Glib::SignalProxy2< void,const Glib::RefPtr<Gst::Object>&,xmlNode* > signal_object_loaded();
00209
00210
00211 public:
00212
00213 public:
00214
00215 #ifdef GLIBMM_VFUNCS_ENABLED
00216 #endif //GLIBMM_VFUNCS_ENABLED
00217
00218 protected:
00219
00220 #ifdef GLIBMM_VFUNCS_ENABLED
00221 #endif //GLIBMM_VFUNCS_ENABLED
00222
00223
00224 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00225 virtual void on_object_loaded(const Glib::RefPtr<Gst::Object>& object, xmlNode* xml_node);
00226 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00227
00228
00229 };
00230
00231 }
00232
00233
00234 namespace Glib
00235 {
00244 Glib::RefPtr<Gst::XML> wrap(GstXML* object, bool take_copy = false);
00245 }
00246
00247
00248 #endif
00249