selector.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGNOMEDBMM_SELECTOR_H
00004 #define _LIBGNOMEDBMM_SELECTOR_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 // -*- C++ -*- // 
00010 
00011 /* selector.hg
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 <gtkmm/box.h>
00031 #include <libgdamm/dict.h>
00032 
00033 
00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00035 typedef struct _GnomeDbSelector GnomeDbSelector;
00036 typedef struct _GnomeDbSelectorClass GnomeDbSelectorClass;
00037 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00038 
00039 
00040 namespace Gnome
00041 {
00042 
00043 namespace Db
00044 { class Selector_Class; } // namespace Db
00045 
00046 } // namespace Gnome
00047 namespace Gnome
00048 {
00049 
00050 namespace Db
00051 {
00052 
00066 enum SelectorMode
00067 {
00068   DB_SELECTOR_DATA_TYPES = 1 << 0,
00069   DB_SELECTOR_FUNCTIONS = 1 << 1,
00070   DB_SELECTOR_AGGREGATES = 1 << 2,
00071   DB_SELECTOR_TABLES = 1 << 3,
00072   DB_SELECTOR_FIELDS = 1 << 5,
00073   DB_SELECTOR_QUERIES = 1 << 4,
00074   DB_SELECTOR_TARGETS = 1 << 6,
00075   DB_SELECTOR_JOINS = 1 << 7,
00076   DB_SELECTOR_QVIS_FIELDS = 1 << 8,
00077   DB_SELECTOR_QALL_FIELDS = 1 << 9,
00078   DB_SELECTOR_SUB_QUERIES = 1 << 10,
00079   DB_SELECTOR_TARGETS_CTS = 1 << 13,
00080   DB_SELECTOR_GRAPHS = 1 << 11,
00081   DB_SELECTOR_FORMS = 1 << 12
00082 };
00083 
00085 inline SelectorMode operator|(SelectorMode lhs, SelectorMode rhs)
00086   { return static_cast<SelectorMode>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00087 
00089 inline SelectorMode operator&(SelectorMode lhs, SelectorMode rhs)
00090   { return static_cast<SelectorMode>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00091 
00093 inline SelectorMode operator^(SelectorMode lhs, SelectorMode rhs)
00094   { return static_cast<SelectorMode>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00095 
00097 inline SelectorMode operator~(SelectorMode flags)
00098   { return static_cast<SelectorMode>(~static_cast<unsigned>(flags)); }
00099 
00101 inline SelectorMode& operator|=(SelectorMode& lhs, SelectorMode rhs)
00102   { return (lhs = static_cast<SelectorMode>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00103 
00105 inline SelectorMode& operator&=(SelectorMode& lhs, SelectorMode rhs)
00106   { return (lhs = static_cast<SelectorMode>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00107 
00109 inline SelectorMode& operator^=(SelectorMode& lhs, SelectorMode rhs)
00110   { return (lhs = static_cast<SelectorMode>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00111 
00112 } // namespace Db
00113 
00114 } // namespace Gnome
00115 
00116 
00117 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00118 namespace Glib
00119 {
00120 
00121 template <>
00122 class Value<Gnome::Db::SelectorMode> : public Glib::Value_Flags<Gnome::Db::SelectorMode>
00123 {
00124 public:
00125   static GType value_type() G_GNUC_CONST;
00126 };
00127 
00128 } // namespace Glib
00129 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00130 
00131 
00132 namespace Gnome
00133 {
00134 
00135 namespace Db
00136 {
00137 
00149 enum SelectorColumn
00150 {
00151   DB_SELECTOR_COLUMN_OWNER = 1 << 1,
00152   DB_SELECTOR_COLUMN_COMMENTS = 1 << 2,
00153   DB_SELECTOR_COLUMN_TYPE = 1 << 3,
00154   DB_SELECTOR_COLUMN_FIELD_LENGTH = 1 << 4,
00155   DB_SELECTOR_COLUMN_FIELD_NNUL = 1 << 5,
00156   DB_SELECTOR_COLUMN_FIELD_DEFAULT = 1 << 6,
00157   DB_SELECTOR_COLUMN_QFIELD_VALUE = 1 << 7,
00158   DB_SELECTOR_COLUMN_QFIELD_TYPE = 1 << 8
00159 };
00160 
00162 inline SelectorColumn operator|(SelectorColumn lhs, SelectorColumn rhs)
00163   { return static_cast<SelectorColumn>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00164 
00166 inline SelectorColumn operator&(SelectorColumn lhs, SelectorColumn rhs)
00167   { return static_cast<SelectorColumn>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00168 
00170 inline SelectorColumn operator^(SelectorColumn lhs, SelectorColumn rhs)
00171   { return static_cast<SelectorColumn>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00172 
00174 inline SelectorColumn operator~(SelectorColumn flags)
00175   { return static_cast<SelectorColumn>(~static_cast<unsigned>(flags)); }
00176 
00178 inline SelectorColumn& operator|=(SelectorColumn& lhs, SelectorColumn rhs)
00179   { return (lhs = static_cast<SelectorColumn>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00180 
00182 inline SelectorColumn& operator&=(SelectorColumn& lhs, SelectorColumn rhs)
00183   { return (lhs = static_cast<SelectorColumn>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00184 
00186 inline SelectorColumn& operator^=(SelectorColumn& lhs, SelectorColumn rhs)
00187   { return (lhs = static_cast<SelectorColumn>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00188 
00189 } // namespace Db
00190 
00191 } // namespace Gnome
00192 
00193 
00194 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00195 namespace Glib
00196 {
00197 
00198 template <>
00199 class Value<Gnome::Db::SelectorColumn> : public Glib::Value_Flags<Gnome::Db::SelectorColumn>
00200 {
00201 public:
00202   static GType value_type() G_GNUC_CONST;
00203 };
00204 
00205 } // namespace Glib
00206 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00207 
00208 
00209 namespace Gnome
00210 {
00211 
00212 namespace Db
00213 {
00214 
00215 
00220 class Selector : public Gtk::VBox
00221 {
00222   public:
00223 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00224   typedef Selector CppObjectType;
00225   typedef Selector_Class CppClassType;
00226   typedef GnomeDbSelector BaseObjectType;
00227   typedef GnomeDbSelectorClass BaseClassType;
00228 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00229 
00230   virtual ~Selector();
00231 
00232 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00233 
00234 private:
00235   friend class Selector_Class;
00236   static CppClassType selector_class_;
00237 
00238   // noncopyable
00239   Selector(const Selector&);
00240   Selector& operator=(const Selector&);
00241 
00242 protected:
00243   explicit Selector(const Glib::ConstructParams& construct_params);
00244   explicit Selector(GnomeDbSelector* castitem);
00245 
00246 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00247 
00248 public:
00249 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00250   static GType get_type()      G_GNUC_CONST;
00251   static GType get_base_type() G_GNUC_CONST;
00252 #endif
00253 
00255   GnomeDbSelector*       gobj()       { return reinterpret_cast<GnomeDbSelector*>(gobject_); }
00256 
00258   const GnomeDbSelector* gobj() const { return reinterpret_cast<GnomeDbSelector*>(gobject_); }
00259 
00260 
00261 public:
00262   //C++ methods used to invoke GTK+ virtual functions:
00263 #ifdef GLIBMM_VFUNCS_ENABLED
00264 #endif //GLIBMM_VFUNCS_ENABLED
00265 
00266 protected:
00267   //GTK+ Virtual Functions (override these to change behaviour):
00268 #ifdef GLIBMM_VFUNCS_ENABLED
00269 #endif //GLIBMM_VFUNCS_ENABLED
00270 
00271   //Default Signal Handlers::
00272 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00273   virtual void on_selection_changed(const Glib::RefPtr<Glib::Object>& ref_obj);
00274   virtual void on_row_activated(const Glib::RefPtr<Glib::Object>& ref_obj);
00275 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00276 
00277 
00278 private:
00279 
00280 public:
00281   explicit Selector(const Glib::RefPtr<Gda::Dict>& dict, const Glib::RefPtr<Glib::Object>& ref_obj, SelectorMode mode, SelectorColumn columns);
00282   //TODO: Documentation:
00283   Selector(const Glib::RefPtr<Gda::Dict>& dict, SelectorMode mode, SelectorColumn columns);
00284   
00285   
00295   void set_mode_columns(const Glib::RefPtr<Glib::Object>& ref_object, SelectorMode mode, SelectorColumn columns);
00296 
00297   //TODO: Documentation:
00298   void set_mode_columns(SelectorMode mode, SelectorColumn columns);
00299   
00300   
00305   bool set_selected_object(const Glib::RefPtr<Glib::Object>& selection);
00306   
00307   
00310   void set_headers_visible(bool visible = true);
00311   
00314   void set_column_label(guint column, const Glib::ustring& label);
00315   
00316   
00319   void expand_all();
00320   
00323   void collapse_all();
00324   
00325   //TODO: Is Glib::Object the best thing to return here? Investigate what these methods are good for. murrayc
00326   
00331   Glib::RefPtr<Glib::Object> get_selected_object();
00332   
00337   Glib::RefPtr<const Glib::Object> get_selected_object() const;
00338 
00339   
00342   Glib::RefPtr<Glib::Object> get_selected_object_parent();
00343   
00346   Glib::RefPtr<const Glib::Object> get_selected_object_parent() const;
00347   
00348   
00354   Glib::SignalProxy1< void,const Glib::RefPtr<Glib::Object>& > signal_selection_changed();
00355 
00356   
00362   Glib::SignalProxy1< void,const Glib::RefPtr<Glib::Object>& > signal_row_activated();
00363   
00364 
00365 };
00366 
00367 } // namespace Db
00368 } // namespace Gnome
00369 
00370 
00371 namespace Glib
00372 {
00378   Gnome::Db::Selector* wrap(GnomeDbSelector* object, bool take_copy = false);
00379 } //namespace Glib
00380 
00381 
00382 #endif /* _LIBGNOMEDBMM_SELECTOR_H */
00383 

Generated on Mon Feb 12 16:49:00 2007 for libgnomedbmm by  doxygen 1.4.7