dictconstraint.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGDAMM_DICTCONSTRAINT_H
00004 #define _LIBGDAMM_DICTCONSTRAINT_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* $Id: dictconstraint.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 /* dictconstraint.h
00013  *
00014  * Copyright 2007 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/dicttable.h>
00034 #include <libgdamm/dictfield.h>
00035 #include <libgdamm/dicttype.h>
00036 #include <libgdamm/referer.h>
00037 
00038 
00039 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00040 typedef struct _GdaDictConstraint GdaDictConstraint;
00041 typedef struct _GdaDictConstraintClass GdaDictConstraintClass;
00042 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00043 
00044 
00045 namespace Gnome
00046 {
00047 
00048 namespace Gda
00049 { class DictConstraint_Class; } // namespace Gda
00050 
00051 } // namespace Gnome
00052 namespace Gnome
00053 {
00054 
00055 namespace Gda
00056 {
00057 
00063 enum DictConstraintType
00064 {
00065   PRIMARY_KEY,
00066   FOREIGN_KEY,
00067   UNIQUE,
00068   NOT_NULL,
00069   CHECK_EXPR,
00070   CHECK_IN_LIST,
00071   CHECK_SETOF_LIST,
00072   UNKNOWN
00073 };
00074 
00075 } // namespace Gda
00076 
00077 } // namespace Gnome
00078 
00079 
00080 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00081 namespace Glib
00082 {
00083 
00084 template <>
00085 class Value<Gnome::Gda::DictConstraintType> : public Glib::Value_Enum<Gnome::Gda::DictConstraintType>
00086 {
00087 public:
00088   static GType value_type() G_GNUC_CONST;
00089 };
00090 
00091 } // namespace Glib
00092 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00093 
00094 
00095 namespace Gnome
00096 {
00097 
00098 namespace Gda
00099 {
00100 
00104 enum DictConstraintFkAction
00105 {
00106   FK_ACTION_CASCADE,
00107   FK_ACTION_SET_NULL,
00108   FK_ACTION_SET_DEFAULT,
00109   FK_ACTION_SET_VALUE,
00110   FK_ACTION_NO_ACTION
00111 };
00112 
00113 } // namespace Gda
00114 
00115 } // namespace Gnome
00116 
00117 
00118 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00119 namespace Glib
00120 {
00121 
00122 template <>
00123 class Value<Gnome::Gda::DictConstraintFkAction> : public Glib::Value_Enum<Gnome::Gda::DictConstraintFkAction>
00124 {
00125 public:
00126   static GType value_type() G_GNUC_CONST;
00127 };
00128 
00129 } // namespace Glib
00130 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00131 
00132 
00133 namespace Gnome
00134 {
00135 
00136 namespace Gda
00137 {
00138 
00139 
00140 class Connection;
00141 
00150 class DictConstraint
00151 : public Gda::Object,
00152   public XmlStorage,
00153   public Referer
00154 {
00155   
00156 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00157 
00158 public:
00159   typedef DictConstraint CppObjectType;
00160   typedef DictConstraint_Class CppClassType;
00161   typedef GdaDictConstraint BaseObjectType;
00162   typedef GdaDictConstraintClass BaseClassType;
00163 
00164 private:  friend class DictConstraint_Class;
00165   static CppClassType dictconstraint_class_;
00166 
00167 private:
00168   // noncopyable
00169   DictConstraint(const DictConstraint&);
00170   DictConstraint& operator=(const DictConstraint&);
00171 
00172 protected:
00173   explicit DictConstraint(const Glib::ConstructParams& construct_params);
00174   explicit DictConstraint(GdaDictConstraint* castitem);
00175 
00176 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00177 
00178 public:
00179   virtual ~DictConstraint();
00180 
00181 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00182   static GType get_type()      G_GNUC_CONST;
00183   static GType get_base_type() G_GNUC_CONST;
00184 #endif
00185 
00187   GdaDictConstraint*       gobj()       { return reinterpret_cast<GdaDictConstraint*>(gobject_); }
00188 
00190   const GdaDictConstraint* gobj() const { return reinterpret_cast<GdaDictConstraint*>(gobject_); }
00191 
00193   GdaDictConstraint* gobj_copy();
00194 
00195 private:
00196 
00197   
00198 protected:
00199 
00200   //TODO: File bug about gda_dict_constraint_new() and gda_dict_constraint_new_with_db() using private API:
00201   explicit DictConstraint(const Glib::RefPtr<DictTable>& table, DictConstraintType type);
00202   explicit DictConstraint(const Glib::RefPtr<DictDatabase>& db);
00203 
00204 public:
00205   
00206   static Glib::RefPtr<DictConstraint> create(const Glib::RefPtr<DictTable>& table, DictConstraintType type);
00207 
00208   
00209   static Glib::RefPtr<DictConstraint> create(const Glib::RefPtr<DictDatabase>& db);
00210 
00211 
00215   DictConstraintType get_constraint_type() const;
00216   //_WRAP_METHOD(bool equal(const Glib::RefPtr<const DictConstraint>& cstr2) const , gda_dict_constraint_equal)
00217 
00218   
00222   Glib::RefPtr<DictTable> get_table();
00223   
00227   Glib::RefPtr<const DictTable> get_table() const;
00228 
00229   
00234   bool uses_field(const Glib::RefPtr<const DictField>& field) const;
00235 
00236 /* Primary KEY specific */
00237  //TODO: Use ListHandle or similar:
00238   
00243   void pkey_set_fields(const GSList *fields);
00244   
00249   GSList* pkey_get_fields();
00250 
00251 /* Foreign KEY specific */
00252   
00260   void fkey_set_fields(const GSList *pairs);
00261 
00262   
00267   Glib::RefPtr<DictTable> fkey_get_ref_table();
00268   
00273   Glib::RefPtr<const DictTable> fkey_get_ref_table() const;
00274 
00275  //TODO: Use ListHandle or similar:
00276   
00283   GSList* fkey_get_fields() const;
00284   
00289   void fkey_set_actions(DictConstraintFkAction on_update,  DictConstraintFkAction on_delete);
00290   
00295   void fkey_get_actions(DictConstraintFkAction& on_update, DictConstraintFkAction& on_delete);
00296 
00297 /* UNIQUE specific */
00298  //TODO: Use ListHandle or similar:
00299   
00302   void unique_set_fields(const GSList *fields);
00303   
00307   GSList* unique_get_fields() const;
00308 
00309 /* NOT NULL specific */
00310   
00311   void not_null_set_field(const Glib::RefPtr<DictField>& field);
00312 
00313   
00314   Glib::RefPtr<DictField> not_null_get_field();
00315   
00316   Glib::RefPtr<const DictField> not_null_get_field() const;
00317 
00318   //TODO: properties, signals, vfuncs.
00319 
00320 
00321 public:
00322 
00323 public:
00324   //C++ methods used to invoke GTK+ virtual functions:
00325 #ifdef GLIBMM_VFUNCS_ENABLED
00326 #endif //GLIBMM_VFUNCS_ENABLED
00327 
00328 protected:
00329   //GTK+ Virtual Functions (override these to change behaviour):
00330 #ifdef GLIBMM_VFUNCS_ENABLED
00331 #endif //GLIBMM_VFUNCS_ENABLED
00332 
00333   //Default Signal Handlers::
00334 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00335 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00336 
00337 
00338 };
00339 
00340 } // namespace Gda
00341 } // namespace Gnome
00342 
00343 
00344 namespace Glib
00345 {
00351   Glib::RefPtr<Gnome::Gda::DictConstraint> wrap(GdaDictConstraint* object, bool take_copy = false);
00352 }
00353 
00354 
00355 #endif /* _LIBGDAMM_DICTCONSTRAINT_H */
00356 

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