datahandler.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGDAMM_DATAHANDLER_H
00004 #define _LIBGDAMM_DATAHANDLER_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in
00010 
00011 /* datahandler.h
00012  *
00013  * Copyright 2003 libgdamm Development Team
00014  *
00015  * This library is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU Library General Public
00017  * License as published by the Free Software Foundation; either
00018  * version 2 of the License, or (at your option) any later version.
00019  *
00020  * This library is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00023  * Library General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU Library General Public
00026  * License along with this library; if not, write to the Free
00027  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 /* DOXYGEN_SHOULD_SKIP_THIS */
00039 
00040 
00041 namespace Gnome
00042 {
00043 
00044 namespace Gda
00045 { class DataHandler_Class; } // namespace Gda
00046 
00047 } // namespace Gnome
00048 namespace Gnome
00049 {
00050 
00051 namespace Gda
00052 {
00053 
00054 //TODO: In the libgda documentation, if the "STR" format is the human-readable text representation in the current locale, then say so.
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   // noncopyable
00093   DataHandler(const DataHandler&);
00094   DataHandler& operator=(const DataHandler&);
00095 
00096 protected:
00097   DataHandler(); // you must derive from this class
00098   explicit DataHandler(GdaDataHandler* castitem);
00099 
00100 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
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   // Hand-coded this to get proper return values
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   //TODO: Is this comment meant to be here, or is it just a copy/paste error? murrayc:
00199   //We don't wrap the vfuncs because they are only useful for creating new backends,
00200   //and they have a high code-size and per-object memory cost.
00201 
00202 
00203 public:
00204 
00205 public:
00206   //C++ methods used to invoke GTK+ virtual functions:
00207 #ifdef GLIBMM_VFUNCS_ENABLED
00208 #endif //GLIBMM_VFUNCS_ENABLED
00209 
00210 protected:
00211   //GTK+ Virtual Functions (override these to change behaviour):
00212 #ifdef GLIBMM_VFUNCS_ENABLED
00213 #endif //GLIBMM_VFUNCS_ENABLED
00214 
00215   //Default Signal Handlers::
00216 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00217 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00218 
00219 
00220 };
00221 
00222 } // namespace Gda
00223 } // namespace Gnome
00224 
00225 
00226 namespace Glib
00227 {
00233   Glib::RefPtr<Gnome::Gda::DataHandler> wrap(GdaDataHandler* object, bool take_copy = false);
00234 
00235 } // namespace Glib
00236 
00237 
00238 #endif /* _LIBGDAMM_DATAHANDLER_H */
00239 

Generated on Sat Feb 10 20:06:25 2007 for libgdamm by  doxygen 1.4.7