datawidget.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGNOMEDBMM_DATAWIDGET_H
00004 #define _LIBGNOMEDBMM_DATAWIDGET_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 // -*- C++ -*- // 
00010 
00011 /* datawidget.h
00012  * 
00013  * Copyright 2006 libgnomedbmm 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 <libgnomedb/gnome-db-data-widget.h>
00031 
00032 #include <glibmm/interface.h>
00033 #include <gtkmm/actiongroup.h>
00034 
00035 #include <libgdamm/datamodel.h>
00036 #include <libgdamm/dataproxy.h>
00037 #include <libgdamm/datamodeliter.h>
00038 
00039 
00040 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00041 typedef struct _GnomeDbDataWidget GnomeDbDataWidget;
00042 typedef struct _GnomeDbDataWidgetClass GnomeDbDataWidgetClass;
00043 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00044 
00045 
00046 namespace Gnome
00047 {
00048 
00049 namespace Db
00050 { class DataWidget_Class; } // namespace Db
00051 
00052 } // namespace Gnome
00053 namespace Gnome
00054 {
00055 
00056 namespace Db
00057 {
00058 
00064 enum Action
00065 {
00066   DB_ACTION_NEW_DATA,
00067   DB_ACTION_WRITE_MODIFIED_DATA,
00068   DB_ACTION_DELETE_SELECTED_DATA,
00069   DB_ACTION_UNDELETE_SELECTED_DATA,
00070   DB_ACTION_RESET_DATA,
00071   DB_ACTION_MOVE_FIRST_RECORD,
00072   DB_ACTION_MOVE_PREV_RECORD,
00073   DB_ACTION_MOVE_NEXT_RECORD,
00074   DB_ACTION_MOVE_LAST_RECORD,
00075   DB_ACTION_MOVE_FIRST_CHUNCK,
00076   DB_ACTION_MOVE_PREV_CHUNCK,
00077   DB_ACTION_MOVE_NEXT_CHUNCK,
00078   DB_ACTION_MOVE_LAST_CHUNCK
00079 };
00080 
00081 } // namespace Db
00082 
00083 } // namespace Gnome
00084 
00085 
00086 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00087 namespace Glib
00088 {
00089 
00090 template <>
00091 class Value<Gnome::Db::Action> : public Glib::Value_Enum<Gnome::Db::Action>
00092 {
00093 public:
00094   static GType value_type() G_GNUC_CONST;
00095 };
00096 
00097 } // namespace Glib
00098 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00099 
00100 
00101 namespace Gnome
00102 {
00103 
00104 namespace Db
00105 {
00106 
00107 // TODO: Do we need bit operations for this enum?
00111 enum DataWidgetWriteMode
00112 {
00113   DB_DATA_WIDGET_WRITE_ON_DEMAND,
00114   DB_DATA_WIDGET_WRITE_ON_ROW_CHANGE,
00115   DB_DATA_WIDGET_WRITE_ON_VALUE_ACTIVATED,
00116   DB_DATA_WIDGET_WRITE_ON_VALUE_CHANGE
00117 };
00118 
00119 } // namespace Db
00120 
00121 } // namespace Gnome
00122 
00123 
00124 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00125 namespace Glib
00126 {
00127 
00128 template <>
00129 class Value<Gnome::Db::DataWidgetWriteMode> : public Glib::Value_Enum<Gnome::Db::DataWidgetWriteMode>
00130 {
00131 public:
00132   static GType value_type() G_GNUC_CONST;
00133 };
00134 
00135 } // namespace Glib
00136 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00137 
00138 
00139 namespace Gnome
00140 {
00141 
00142 namespace Db
00143 {
00144 
00145 
00146 class DataWidget : public Glib::Interface
00147 {
00148   
00149 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00150 
00151 public:
00152   typedef DataWidget CppObjectType;
00153   typedef DataWidget_Class CppClassType;
00154   typedef GnomeDbDataWidget BaseObjectType;
00155   typedef GnomeDbDataWidgetIface BaseClassType;
00156 
00157 private:
00158   friend class DataWidget_Class;
00159   static CppClassType datawidget_class_;
00160 
00161   // noncopyable
00162   DataWidget(const DataWidget&);
00163   DataWidget& operator=(const DataWidget&);
00164 
00165 protected:
00166   DataWidget(); // you must derive from this class
00167   explicit DataWidget(GnomeDbDataWidget* castitem);
00168 
00169 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00170 
00171 public:
00172   virtual ~DataWidget();
00173 
00174   static void add_interface(GType gtype_implementer);
00175 
00176 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00177   static GType get_type()      G_GNUC_CONST;
00178   static GType get_base_type() G_GNUC_CONST;
00179 #endif
00180 
00182   GnomeDbDataWidget*       gobj()       { return reinterpret_cast<GnomeDbDataWidget*>(gobject_); }
00183 
00185   const GnomeDbDataWidget* gobj() const { return reinterpret_cast<GnomeDbDataWidget*>(gobject_); }
00186 
00187 private:
00188 
00189 
00190   // This does not belong to this class
00191   
00192 
00193 public:
00194   
00198   Glib::RefPtr<Gda::DataProxy> get_proxy();
00199   
00203   Glib::RefPtr<const Gda::DataProxy> get_proxy() const;
00204 
00205   
00209   void column_show(int column);
00210   
00214   void column_hide(int column);
00215   
00220   void column_set_editable(int column, bool editable);
00221   
00227   void column_show_actions(int column, bool show_actions);
00228 
00229   
00243   Glib::RefPtr<Gtk::ActionGroup> get_actions_group();
00244   
00258   Glib::RefPtr<const Gtk::ActionGroup> get_actions_group() const;
00259  
00260   
00267   void perform_action(Action action);
00268 
00269   
00275   Glib::RefPtr<Gda::DataModelIter> get_current_data();
00276   
00282   Glib::RefPtr<const Gda::DataModelIter> get_current_data() const;
00283 
00284   
00288   Glib::RefPtr<Gda::DataModel> get_gda_model();
00289   
00293   Glib::RefPtr<const Gda::DataModel> get_gda_model() const;
00294 
00295   
00299   void set_gda_model(const Glib::RefPtr<Gda::DataModel>& model);
00300 
00301   
00302   DataWidgetWriteMode get_write_mode() const;
00303   
00304   void set_write_mode(DataWidgetWriteMode mode);
00305 
00306   // Qualify DataProxy fully here so that it is found by the generated code
00307   // (in the default signal handler)
00308    
00309 
00315   Glib::SignalProxy1< void,const Glib::RefPtr<Gnome::Gda::DataProxy>& > signal_proxy_changed();
00316 
00317 
00318 protected:
00319   //TODO: I think the C API has _vfunc suffixes, but we add these in gtkmm too, 
00320   //so we should maybe hack gmmproc to add a no-vfunc-suffix option to _WRAP_VFUNC(). murrayc.
00321   #ifdef GLIBMM_VFUNCS_ENABLED
00322   virtual Glib::RefPtr<Gda::DataProxy> get_proxy_vfunc_vfunc();
00323 #endif //GLIBMM_VFUNCS_ENABLED
00324 
00325   #ifdef GLIBMM_VFUNCS_ENABLED
00326   virtual void col_set_show_vfunc_vfunc(int column, bool shown);
00327 #endif //GLIBMM_VFUNCS_ENABLED
00328 
00329   #ifdef GLIBMM_VFUNCS_ENABLED
00330   virtual void set_column_editable_vfunc_vfunc(int column, bool editable);
00331 #endif //GLIBMM_VFUNCS_ENABLED
00332 
00333   #ifdef GLIBMM_VFUNCS_ENABLED
00334   virtual void show_column_actions_vfunc_vfunc(int column, bool show_actions);
00335 #endif //GLIBMM_VFUNCS_ENABLED
00336 
00337   #ifdef GLIBMM_VFUNCS_ENABLED
00338   virtual Glib::RefPtr<Gtk::ActionGroup> get_actions_group_vfunc_vfunc();
00339 #endif //GLIBMM_VFUNCS_ENABLED
00340 
00341   #ifdef GLIBMM_VFUNCS_ENABLED
00342   virtual GdaDataModelIter* get_data_set_vfunc_vfunc();
00343 #endif //GLIBMM_VFUNCS_ENABLED
00344 
00345   #ifdef GLIBMM_VFUNCS_ENABLED
00346   virtual Glib::RefPtr<Gda::DataModel> get_gda_model_vfunc_vfunc();
00347 #endif //GLIBMM_VFUNCS_ENABLED
00348 
00349   #ifdef GLIBMM_VFUNCS_ENABLED
00350   virtual void set_gda_model_vfunc(const Glib::RefPtr<Gda::DataModel>& model);
00351 #endif //GLIBMM_VFUNCS_ENABLED
00352 
00353 
00354 public:
00355 
00356 public:
00357   //C++ methods used to invoke GTK+ virtual functions:
00358 #ifdef GLIBMM_VFUNCS_ENABLED
00359 #endif //GLIBMM_VFUNCS_ENABLED
00360 
00361 protected:
00362   //GTK+ Virtual Functions (override these to change behaviour):
00363 #ifdef GLIBMM_VFUNCS_ENABLED
00364 #endif //GLIBMM_VFUNCS_ENABLED
00365 
00366   //Default Signal Handlers::
00367 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00368   virtual void on_proxy_changed(const Glib::RefPtr<Gnome::Gda::DataProxy>& proxy);
00369 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00370 
00371 
00372 };
00373 
00374 } // namespace Db
00375 
00376 } // namespace Gnome
00377 
00378 
00379 namespace Glib
00380 {
00386   Glib::RefPtr<Gnome::Db::DataWidget> wrap(GnomeDbDataWidget* object, bool take_copy = false);
00387 
00388 } // namespace Glib
00389 
00390 
00391 #endif /* _LIBGNOMEDBMM_DATAWIDGET_H */
00392 

Generated on Mon Feb 12 16:48:59 2007 for libgnomedbmm by  doxygen 1.4.7