00001
00002
00003 #ifndef _LIBGNOMEDBMM_GRID_H
00004 #define _LIBGNOMEDBMM_GRID_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 <gtkmm/box.h>
00031 #include <libgdamm/datamodel.h>
00032 #include <libgnomedbmm/rawgrid.h>
00033 #include <libgnomedbmm/datawidgetinfo.h>
00034
00035
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 typedef struct _GnomeDbGrid GnomeDbGrid;
00038 typedef struct _GnomeDbGridClass GnomeDbGridClass;
00039 #endif
00040
00041
00042 namespace Gnome
00043 {
00044
00045 namespace Db
00046 { class Grid_Class; }
00047
00048 }
00049 namespace Gnome
00050 {
00051
00052 namespace Db
00053 {
00054
00055
00056 class Grid : public Gtk::VBox
00057 {
00058 public:
00059 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00060 typedef Grid CppObjectType;
00061 typedef Grid_Class CppClassType;
00062 typedef GnomeDbGrid BaseObjectType;
00063 typedef GnomeDbGridClass BaseClassType;
00064 #endif
00065
00066 virtual ~Grid();
00067
00068 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00069
00070 private:
00071 friend class Grid_Class;
00072 static CppClassType grid_class_;
00073
00074
00075 Grid(const Grid&);
00076 Grid& operator=(const Grid&);
00077
00078 protected:
00079 explicit Grid(const Glib::ConstructParams& construct_params);
00080 explicit Grid(GnomeDbGrid* castitem);
00081
00082 #endif
00083
00084 public:
00085 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00086 static GType get_type() G_GNUC_CONST;
00087 static GType get_base_type() G_GNUC_CONST;
00088 #endif
00089
00091 GnomeDbGrid* gobj() { return reinterpret_cast<GnomeDbGrid*>(gobject_); }
00092
00094 const GnomeDbGrid* gobj() const { return reinterpret_cast<GnomeDbGrid*>(gobject_); }
00095
00096
00097 public:
00098
00099 #ifdef GLIBMM_VFUNCS_ENABLED
00100 #endif //GLIBMM_VFUNCS_ENABLED
00101
00102 protected:
00103
00104 #ifdef GLIBMM_VFUNCS_ENABLED
00105 #endif //GLIBMM_VFUNCS_ENABLED
00106
00107
00108 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00109 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00110
00111
00112 private:
00113
00114
00115 public:
00116 explicit Grid(const Glib::RefPtr<Gda::DataModel>& model);
00117
00118 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00119
00120
00121 struct IntTraits
00122 {
00123 typedef int CppType;
00124 typedef gpointer CType;
00125 typedef gpointer CTypeNonConst;
00126
00127 static CType to_c_type (const CppType& obj) { return GINT_TO_POINTER(obj); }
00128 static CType to_c_type (const CType& obj) { return GINT_TO_POINTER(obj); }
00129 static CppType to_cpp_type (const CType& obj) { return GPOINTER_TO_INT(obj); }
00130 static void release_c_type (const CType&) {}
00131 };
00132 #endif //DOXYGEN_SHOULD_SKIP_THIS
00133
00134 typedef Glib::ListHandle<int, IntTraits> IntListHandle;
00135
00136
00137
00138
00139
00143 Grid::IntListHandle get_selection() const;
00144
00145
00148 void set_sample_size(int sample_size);
00149
00150
00151
00152
00153
00154
00155
00156
00159 RawGrid* get_raw_grid();
00160
00163 const RawGrid* get_raw_grid() const;
00164
00165 #ifdef GLIBMM_PROPERTIES_ENABLED
00166
00172 Glib::PropertyProxy_ReadOnly<RawGrid*> property_raw_grid() const;
00173 #endif //#GLIBMM_PROPERTIES_ENABLED
00174
00175
00176 #ifdef GLIBMM_PROPERTIES_ENABLED
00177
00183 Glib::PropertyProxy_ReadOnly<DataWidgetInfo*> property_widget_info() const;
00184 #endif //#GLIBMM_PROPERTIES_ENABLED
00185
00186
00187 #ifdef GLIBMM_PROPERTIES_ENABLED
00188
00194 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gda::DataModel> > property_model() const;
00195 #endif //#GLIBMM_PROPERTIES_ENABLED
00196
00197
00198 };
00199
00200 }
00201 }
00202
00203
00204 namespace Glib
00205 {
00211 Gnome::Db::Grid* wrap(GnomeDbGrid* object, bool take_copy = false);
00212 }
00213
00214
00215 #endif
00216