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:
00111 static Glib::RefPtr<XML> create();
00112
00113
00118 static xmlDocPtr write(const Glib::RefPtr<Gst::Element>& element);
00119
00126 static void write_to_stream(const Glib::RefPtr<Gst::Element>& element, std::ostream& out);
00127
00128
00135 bool parse_doc(xmlpp::Document* doc, Glib::ustring& root);
00136
00149 bool parse_file(const std::string& filename, const Glib::ustring& root);
00150
00158 bool parse_memory(const std::string& buffer, const Glib::ustring& root);
00159
00160
00161
00162
00169 Glib::RefPtr<Gst::Element> get_element(const Glib::ustring& name);
00170
00177 Glib::RefPtr<const Gst::Element> get_element(const Glib::ustring& name) const;
00178
00179
00186 Glib::ListHandle< Glib::RefPtr<Gst::Element> > get_topelements();
00187
00188
00195 Glib::ListHandle< Glib::RefPtr<const Gst::Element> > get_topelements() const;
00196
00197
00203 static Glib::RefPtr<Gst::Element> make_element(xmlpp::Node* curr, const Glib::RefPtr<Gst::Object>& parent);
00204
00205
00212 Glib::SignalProxy2< void,const Glib::RefPtr<Gst::Object>&,xmlNode* > signal_object_loaded();
00213
00214
00215 public:
00216
00217 public:
00218
00219 #ifdef GLIBMM_VFUNCS_ENABLED
00220 #endif //GLIBMM_VFUNCS_ENABLED
00221
00222 protected:
00223
00224 #ifdef GLIBMM_VFUNCS_ENABLED
00225 #endif //GLIBMM_VFUNCS_ENABLED
00226
00227
00228 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00229 virtual void on_object_loaded(const Glib::RefPtr<Gst::Object>& object, xmlNode* xml_node);
00230 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00231
00232
00233 };
00234
00235 }
00236
00237
00238 namespace Glib
00239 {
00248 Glib::RefPtr<Gst::XML> wrap(GstXML* object, bool take_copy = false);
00249 }
00250
00251
00252 #endif
00253