dictfield.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGDAMM_DICTFIELD_H
00004 #define _LIBGDAMM_DICTFIELD_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* $Id: dictfield.hg,v 1.2 2006/11/08 00:07:37 murrayc Exp $ */
00010 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in
00011 
00012 /* dictfield.h
00013  *
00014  * Copyright 2006 libgdamm Development Team
00015  *
00016  * This library is free software; you can redistribute it and/or
00017  * modify it under the terms of the GNU Library General Public
00018  * License as published by the Free Software Foundation; either
00019  * version 2 of the License, or(at your option) any later version.
00020  *
00021  * This library is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00024  * Library General Public License for more details.
00025  *
00026  * You should have received a copy of the GNU Library General Public
00027  * License along with this library; if not, write to the Free
00028  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00029  */
00030 
00031 #include <libgdamm/object.h>
00032 #include <libgdamm/xmlstorage.h>
00033 #include <libgdamm/value.h>
00034 #include <libgdamm/dicttype.h>
00035 
00036 
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 typedef struct _GdaDictField GdaDictField;
00039 typedef struct _GdaDictFieldClass GdaDictFieldClass;
00040 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00041 
00042 
00043 namespace Gnome
00044 {
00045 
00046 namespace Gda
00047 { class DictField_Class; } // namespace Gda
00048 
00049 } // namespace Gnome
00050 namespace Gnome
00051 {
00052 
00053 namespace Gda
00054 {
00055 
00069 enum DictFieldAttribute
00070 {
00071   AUTO_INCREMENT = 1 << 0
00072 };
00073 
00075 inline DictFieldAttribute operator|(DictFieldAttribute lhs, DictFieldAttribute rhs)
00076   { return static_cast<DictFieldAttribute>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00077 
00079 inline DictFieldAttribute operator&(DictFieldAttribute lhs, DictFieldAttribute rhs)
00080   { return static_cast<DictFieldAttribute>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00081 
00083 inline DictFieldAttribute operator^(DictFieldAttribute lhs, DictFieldAttribute rhs)
00084   { return static_cast<DictFieldAttribute>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00085 
00087 inline DictFieldAttribute operator~(DictFieldAttribute flags)
00088   { return static_cast<DictFieldAttribute>(~static_cast<unsigned>(flags)); }
00089 
00091 inline DictFieldAttribute& operator|=(DictFieldAttribute& lhs, DictFieldAttribute rhs)
00092   { return (lhs = static_cast<DictFieldAttribute>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00093 
00095 inline DictFieldAttribute& operator&=(DictFieldAttribute& lhs, DictFieldAttribute rhs)
00096   { return (lhs = static_cast<DictFieldAttribute>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00097 
00099 inline DictFieldAttribute& operator^=(DictFieldAttribute& lhs, DictFieldAttribute rhs)
00100   { return (lhs = static_cast<DictFieldAttribute>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00101 
00102 } // namespace Gda
00103 
00104 } // namespace Gnome
00105 
00106 
00107 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00108 namespace Glib
00109 {
00110 
00111 template <>
00112 class Value<Gnome::Gda::DictFieldAttribute> : public Glib::Value_Flags<Gnome::Gda::DictFieldAttribute>
00113 {
00114 public:
00115   static GType value_type() G_GNUC_CONST;
00116 };
00117 
00118 } // namespace Glib
00119 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00120 
00121 
00122 namespace Gnome
00123 {
00124 
00125 namespace Gda
00126 {
00127 
00128 
00129 class Connection;
00130 
00139 class DictField
00140 : public Gda::Object,
00141   public XmlStorage
00142 {
00143   
00144 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00145 
00146 public:
00147   typedef DictField CppObjectType;
00148   typedef DictField_Class CppClassType;
00149   typedef GdaDictField BaseObjectType;
00150   typedef GdaDictFieldClass BaseClassType;
00151 
00152 private:  friend class DictField_Class;
00153   static CppClassType dictfield_class_;
00154 
00155 private:
00156   // noncopyable
00157   DictField(const DictField&);
00158   DictField& operator=(const DictField&);
00159 
00160 protected:
00161   explicit DictField(const Glib::ConstructParams& construct_params);
00162   explicit DictField(GdaDictField* castitem);
00163 
00164 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00165 
00166 public:
00167   virtual ~DictField();
00168 
00169 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00170   static GType get_type()      G_GNUC_CONST;
00171   static GType get_base_type() G_GNUC_CONST;
00172 #endif
00173 
00175   GdaDictField*       gobj()       { return reinterpret_cast<GdaDictField*>(gobject_); }
00176 
00178   const GdaDictField* gobj() const { return reinterpret_cast<GdaDictField*>(gobject_); }
00179 
00181   GdaDictField* gobj_copy();
00182 
00183 private:
00184 
00185   
00186 protected:
00187 
00188   explicit DictField(const Glib::RefPtr<Dict>& dict, const Glib::RefPtr<DictType>& type);
00189 
00190 public:
00191   
00192   static Glib::RefPtr<DictField> create(const Glib::RefPtr<Dict>& dict, const Glib::RefPtr<DictType>& type);
00193 
00194 
00195   void set_length(int length);
00196   
00200   int get_length() const;
00201   
00202   void set_scale(int length);
00203   
00207   int get_scale() const;
00208 
00209   //TODO: Use ListHandle or similar:
00210   
00215   GSList* get_constraints();
00216 
00217   
00221   void set_dict_type(const Glib::RefPtr<DictType>& type);
00222 
00223   
00229   void set_default_value(const Value& value);
00230   //TODO: _WRAP_METHOD(Value get_default_value() const, gda_dict_field_get_default_value)
00231 
00232   
00235   bool is_null_allowed() const;
00236   
00239   bool is_pkey_part() const;
00240   
00243   bool is_pkey_alone() const;
00244   
00247   bool is_fkey_part() const;
00248   
00253   bool is_fkey_alone() const;
00254 
00255   
00256   void set_attributes(DictFieldAttribute attributes);
00257   
00258   DictFieldAttribute get_attributes() const;
00259 
00260  //TODO: properties, signals, vfuncs.
00261 
00262 
00263 public:
00264 
00265 public:
00266   //C++ methods used to invoke GTK+ virtual functions:
00267 #ifdef GLIBMM_VFUNCS_ENABLED
00268 #endif //GLIBMM_VFUNCS_ENABLED
00269 
00270 protected:
00271   //GTK+ Virtual Functions (override these to change behaviour):
00272 #ifdef GLIBMM_VFUNCS_ENABLED
00273 #endif //GLIBMM_VFUNCS_ENABLED
00274 
00275   //Default Signal Handlers::
00276 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00277 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00278 
00279 
00280 };
00281 
00282 } // namespace Gda
00283 } // namespace Gnome
00284 
00285 
00286 namespace Glib
00287 {
00293   Glib::RefPtr<Gnome::Gda::DictField> wrap(GdaDictField* object, bool take_copy = false);
00294 }
00295 
00296 
00297 #endif /* _LIBGDAMM_DICTFIELD_H */
00298 

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