00001
00002
00003 #ifndef _LIBGDAMM_PARAMETERLIST_H
00004 #define _LIBGDAMM_PARAMETERLIST_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
00031 #include <glibmm/object.h>
00032 #include <libgdamm/parameter.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GdaParameterList GdaParameterList;
00037 typedef struct _GdaParameterListClass GdaParameterListClass;
00038 #endif
00039
00040
00041 namespace Gnome
00042 {
00043
00044 namespace Gda
00045 { class ParameterList_Class; }
00046
00047 }
00048 namespace Gnome
00049 {
00050
00051 namespace Gda
00052 {
00053
00056 class ParameterListError : public Glib::Error
00057 {
00058 public:
00059 enum Code
00060 {
00061 PARAMETER_LIST_NO_NODE_ERROR,
00062 PARAMETER_LIST_NODE_OUTDATED_ERROR,
00063 PARAMETER_LIST_VALUE_PROV_OBJ_TYPE_ERROR,
00064 PARAMETER_LIST_VALUE_PROV_DATA_TYPE_ERROR,
00065 PARAMETER_LIST_VALUE_PROV_INVISIBLE_ERROR,
00066 PARAMETER_LIST_VALUE_PROV_QUERY_TYPE_ERROR,
00067 PARAMETER_LIST_DEPENDENCY_NOT_IN_PARAMLIST_ERROR,
00068 PARAMETER_LIST_DEPENDENCY_POSITION_ERROR,
00069 PARAMETER_LIST_XML_SPEC_ERROR
00070 };
00071
00072 ParameterListError(Code error_code, const Glib::ustring& error_message);
00073 explicit ParameterListError(GError* gobject);
00074 Code code() const;
00075
00076 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00077 private:
00078
00079 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00080 static void throw_func(GError* gobject);
00081 #else
00082
00083 static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
00084 #endif //GLIBMM_EXCEPTIONS_ENABLED
00085
00086 friend void wrap_init();
00087 #endif
00088 };
00089
00090 }
00091
00092 }
00093
00094 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00095 namespace Glib
00096 {
00097
00098 template <>
00099 class Value<Gnome::Gda::ParameterListError::Code> : public Glib::Value_Enum<Gnome::Gda::ParameterListError::Code>
00100 {
00101 public:
00102 static GType value_type() G_GNUC_CONST;
00103 };
00104
00105 }
00106 #endif
00107
00108
00109 namespace Gnome
00110 {
00111
00112 namespace Gda
00113 {
00114
00115
00126 class ParameterList : public Glib::Object
00127 {
00128
00129 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00130
00131 public:
00132 typedef ParameterList CppObjectType;
00133 typedef ParameterList_Class CppClassType;
00134 typedef GdaParameterList BaseObjectType;
00135 typedef GdaParameterListClass BaseClassType;
00136
00137 private: friend class ParameterList_Class;
00138 static CppClassType parameterlist_class_;
00139
00140 private:
00141
00142 ParameterList(const ParameterList&);
00143 ParameterList& operator=(const ParameterList&);
00144
00145 protected:
00146 explicit ParameterList(const Glib::ConstructParams& construct_params);
00147 explicit ParameterList(GdaParameterList* castitem);
00148
00149 #endif
00150
00151 public:
00152 virtual ~ParameterList();
00153
00154 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00155 static GType get_type() G_GNUC_CONST;
00156 static GType get_base_type() G_GNUC_CONST;
00157 #endif
00158
00160 GdaParameterList* gobj() { return reinterpret_cast<GdaParameterList*>(gobject_); }
00161
00163 const GdaParameterList* gobj() const { return reinterpret_cast<GdaParameterList*>(gobject_); }
00164
00166 GdaParameterList* gobj_copy();
00167
00168 private:
00169
00170 protected:
00171
00172 ParameterList();
00173
00174 public:
00175
00176 static Glib::RefPtr<ParameterList> create();
00177
00178
00179 operator bool() const;
00180
00181
00184 guint get_length();
00185
00186
00193 void add_parameter(const Glib::RefPtr<Parameter>& param);
00194
00202 Glib::RefPtr<Parameter> add_parameter(const Glib::ustring& name, GType type, const Glib::ustring& str);
00203
00210 Glib::RefPtr<Parameter> add_parameter(const Glib::ustring& name, const Value& value);
00211
00212
00219 void add_param(const Glib::RefPtr<Parameter>& param);
00220
00228 Glib::RefPtr<Parameter> add_param_from_string(const Glib::ustring& name, GType type, const Glib::ustring& str);
00229
00236 Glib::RefPtr<Parameter> add_param_from_value(const Glib::ustring& name, const Value& value);
00237
00241 void merge(const Glib::RefPtr<ParameterList>& paramlist_to_merge);
00242
00246 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00247 bool is_coherent() const;
00248 #else
00249 bool is_coherent(std::auto_ptr<Glib::Error>& error) const;
00250 #endif //GLIBMM_EXCEPTIONS_ENABLED
00251
00252
00256 bool is_valid() const;
00257
00258
00263 Glib::RefPtr<Parameter> find_param(const Glib::ustring& param_name);
00264
00265
00266
00267
00268
00269
00270
00271
00272
00281 void set_param_default_value(const Glib::RefPtr<const Parameter>& param, const Value& value);
00282
00283 void set_param_default_alias(const Glib::RefPtr<const Parameter>& param, const Glib::RefPtr<const Parameter>& alias);
00284 Value get_param_default_value(const Glib::RefPtr<const Parameter>& param) const;
00285
00286
00291 Glib::ustring get_spec() const;
00292
00295 guint get_length() const;
00296
00297
00303 Glib::SignalProxy0< void > signal_public_data_changed();
00304
00305
00311 Glib::SignalProxy1< void,Glib::RefPtr<Parameter> > signal_param_plugin_changed();
00312
00313
00319 Glib::SignalProxy1< void,Glib::RefPtr<Parameter> > signal_param_changed();
00320
00321
00327 Glib::SignalProxy1< void,Glib::RefPtr<Parameter> > signal_param_attr_changed();
00328
00329
00330 public:
00331
00332 public:
00333
00334 #ifdef GLIBMM_VFUNCS_ENABLED
00335 #endif //GLIBMM_VFUNCS_ENABLED
00336
00337 protected:
00338
00339 #ifdef GLIBMM_VFUNCS_ENABLED
00340 #endif //GLIBMM_VFUNCS_ENABLED
00341
00342
00343 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00344 virtual void on_public_data_changed();
00345 virtual void on_param_plugin_changed(Glib::RefPtr<Parameter> parameter);
00346 virtual void on_param_changed(Glib::RefPtr<Parameter> parameter);
00347 virtual void on_param_attr_changed(Glib::RefPtr<Parameter> parameter);
00348 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00349
00350
00351 };
00352
00353 }
00354 }
00355
00356
00357 namespace Glib
00358 {
00364 Glib::RefPtr<Gnome::Gda::ParameterList> wrap(GdaParameterList* object, bool take_copy = false);
00365 }
00366
00367
00368 #endif
00369