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 #include <gst/gstxml.h>
00029 #include <gstreamermm/object.h>
00030 #include <libxml++/document.h>
00031
00032
00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00034 typedef struct _GstXML GstXML;
00035 typedef struct _GstXMLClass GstXMLClass;
00036 #endif
00037
00038
00039 namespace Gst
00040 { class XML_Class; }
00041 namespace Gst
00042 {
00043
00044 class Element;
00045
00056 class XML : public Object
00057 {
00058
00059 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00060
00061 public:
00062 typedef XML CppObjectType;
00063 typedef XML_Class CppClassType;
00064 typedef GstXML BaseObjectType;
00065 typedef GstXMLClass BaseClassType;
00066
00067 private: friend class XML_Class;
00068 static CppClassType xml_class_;
00069
00070 private:
00071
00072 XML(const XML&);
00073 XML& operator=(const XML&);
00074
00075 protected:
00076 explicit XML(const Glib::ConstructParams& construct_params);
00077 explicit XML(GstXML* castitem);
00078
00079 #endif
00080
00081 public:
00082 virtual ~XML();
00083
00084 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00085 static GType get_type() G_GNUC_CONST;
00086 static GType get_base_type() G_GNUC_CONST;
00087 #endif
00088
00090 GstXML* gobj() { return reinterpret_cast<GstXML*>(gobject_); }
00091
00093 const GstXML* gobj() const { return reinterpret_cast<GstXML*>(gobject_); }
00094
00096 GstXML* gobj_copy();
00097
00098 private:
00099
00100
00101 protected:
00102 XML();
00103
00104 public:
00109 static Glib::RefPtr<XML> create();
00110
00111
00116 static xmlDocPtr write(const Glib::RefPtr<const Gst::Element>& element);
00117
00124 static void write_to_stream(const Glib::RefPtr<const Gst::Element>& element, std::ostream& out);
00125
00126
00133 bool parse_doc(xmlpp::Document* doc, Glib::ustring& root);
00134
00147 bool parse_file(const std::string& filename, const Glib::ustring& root);
00148
00156 bool parse_memory(const std::string& buffer, const Glib::ustring& root);
00157
00158
00165 Glib::RefPtr<Gst::Element> get_element(const Glib::ustring& name);
00166
00173 Glib::RefPtr<const Gst::Element> get_element(const Glib::ustring& name) const;
00174
00175
00182 Glib::ListHandle< Glib::RefPtr<Gst::Element> > get_topelements();
00183
00184
00191 Glib::ListHandle< Glib::RefPtr<const Gst::Element> > get_topelements() const;
00192
00193
00199 static Glib::RefPtr<Gst::Element> make_element(xmlpp::Node* curr, const Glib::RefPtr<Gst::Object>& parent);
00200
00201
00204
00205
00211 Glib::SignalProxy2< void,const Glib::RefPtr<Gst::Object>&,xmlNodePtr > signal_object_loaded();
00212
00213
00214 public:
00215
00216 public:
00217
00218 #ifdef GLIBMM_VFUNCS_ENABLED
00219 #endif //GLIBMM_VFUNCS_ENABLED
00220
00221 protected:
00222
00223 #ifdef GLIBMM_VFUNCS_ENABLED
00224 #endif //GLIBMM_VFUNCS_ENABLED
00225
00226
00227 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00228 virtual void on_object_loaded(const Glib::RefPtr<Gst::Object>& object, xmlNodePtr xml_node);
00229 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00230
00231
00232 };
00233
00234 }
00235
00236
00237 namespace Glib
00238 {
00247 Glib::RefPtr<Gst::XML> wrap(GstXML* object, bool take_copy = false);
00248 }
00249
00250
00251 #endif
00252