00001
00002
00003 #ifndef _LIBGDAMM_DATAHANDLER_H
00004 #define _LIBGDAMM_DATAHANDLER_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 <glibmm/interface.h>
00031 #include <libgdamm/value.h>
00032 #include <libgda/gda-data-handler.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GdaDataHandler GdaDataHandler;
00037 typedef struct _GdaDataHandlerClass GdaDataHandlerClass;
00038 #endif
00039
00040
00041 namespace Gnome
00042 {
00043
00044 namespace Gda
00045 { class DataHandler_Class; }
00046
00047 }
00048 namespace Gnome
00049 {
00050
00051 namespace Gda
00052 {
00053
00054
00055
00077 class DataHandler : public Glib::Interface
00078 {
00079
00080 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00081
00082 public:
00083 typedef DataHandler CppObjectType;
00084 typedef DataHandler_Class CppClassType;
00085 typedef GdaDataHandler BaseObjectType;
00086 typedef GdaDataHandlerClass BaseClassType;
00087
00088 private:
00089 friend class DataHandler_Class;
00090 static CppClassType datahandler_class_;
00091
00092
00093 DataHandler(const DataHandler&);
00094 DataHandler& operator=(const DataHandler&);
00095
00096 protected:
00097 DataHandler();
00098 explicit DataHandler(GdaDataHandler* castitem);
00099
00100 #endif
00101
00102 public:
00103 virtual ~DataHandler();
00104
00105 static void add_interface(GType gtype_implementer);
00106
00107 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00108 static GType get_type() G_GNUC_CONST;
00109 static GType get_base_type() G_GNUC_CONST;
00110 #endif
00111
00113 GdaDataHandler* gobj() { return reinterpret_cast<GdaDataHandler*>(gobject_); }
00114
00116 const GdaDataHandler* gobj() const { return reinterpret_cast<GdaDataHandler*>(gobject_); }
00117
00118 private:
00119
00120 public:
00121
00122
00128 Glib::ustring get_sql_from_value(const Value& value) const;
00129
00136 Glib::ustring get_str_from_value(const Value& value) const;
00137
00138
00139
00140
00152 Value get_value_from_sql(const Glib::ustring& sql, GType type) const;
00153
00165 Value get_value_from_str(const Glib::ustring& str, GType type) const;
00166
00173 Value get_sane_init_value(GType type) const;
00174
00175
00179 unsigned int get_nb_g_types() const;
00180
00184 bool accepts_g_type(GType type) const;
00185
00189 GType get_g_type_index(guint index) const;
00190
00194 Glib::ustring get_descr() const;
00195
00196 protected:
00197
00198
00199
00200
00201
00202
00203 public:
00204
00205 public:
00206
00207 #ifdef GLIBMM_VFUNCS_ENABLED
00208 #endif //GLIBMM_VFUNCS_ENABLED
00209
00210 protected:
00211
00212 #ifdef GLIBMM_VFUNCS_ENABLED
00213 #endif //GLIBMM_VFUNCS_ENABLED
00214
00215
00216 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00217 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00218
00219
00220 };
00221
00222 }
00223 }
00224
00225
00226 namespace Glib
00227 {
00233 Glib::RefPtr<Gnome::Gda::DataHandler> wrap(GdaDataHandler* object, bool take_copy = false);
00234
00235 }
00236
00237
00238 #endif
00239