00001
00002
00003 #ifndef _LIBGDAMM_FIELDATTRIBUTES_H
00004 #define _LIBGDAMM_FIELDATTRIBUTES_H
00005
00006 #include <glibmm.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <libgdamm/transaction.h>
00031 #include <glibmm/object.h>
00032
00033
00034 #include <libgdamm/value.h>
00035
00036
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 extern "C" { typedef struct _GdaFieldAttributes GdaFieldAttributes; }
00039 #endif
00040
00041 namespace Gnome
00042 {
00043
00044 namespace Gda
00045 {
00046
00047 class FieldAttributes
00048 {
00049 public:
00050 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00051 typedef FieldAttributes CppObjectType;
00052 typedef GdaFieldAttributes BaseObjectType;
00053 #endif
00054
00055 FieldAttributes();
00056
00057
00058 explicit FieldAttributes(GdaFieldAttributes* castitem, bool make_a_copy = false);
00059
00060 FieldAttributes(const FieldAttributes& src);
00061 FieldAttributes& operator=(const FieldAttributes& src);
00062
00063 ~FieldAttributes();
00064
00065 GdaFieldAttributes* gobj() { return gobject_; }
00066 const GdaFieldAttributes* gobj() const { return gobject_; }
00067
00069 GdaFieldAttributes* gobj_copy() const;
00070
00071 protected:
00072 GdaFieldAttributes* gobject_;
00073
00074 private:
00075
00076
00077 public:
00078
00079
00080 glong get_defined_size() const;
00081
00082 void set_defined_size(glong size);
00083
00084 Glib::ustring get_name() const;
00085
00086 void set_name(const Glib::ustring& name);
00087
00088 Glib::ustring get_table() const;
00089
00090 void set_table(const Glib::ustring& table);
00091
00092 Glib::ustring get_caption() const;
00093
00094 void set_caption(const Glib::ustring& caption);
00095
00096 glong get_scale() const;
00097
00098 void set_scale(glong scale);
00099
00100 ValueType get_gdatype() const;
00101
00102 void set_gdatype(ValueType type);
00103
00104 bool get_allow_null() const;
00105
00106 void set_allow_null(bool allow = true);
00107
00108 bool get_primary_key() const;
00109
00110 void set_primary_key(bool pk = true);
00111
00112 bool get_unique_key() const;
00113
00114 void set_unique_key(bool uk = true);
00115
00116 Glib::ustring get_references();
00117
00118 void set_references(const Glib::ustring& ref);
00119
00120 bool get_auto_increment() const;
00121
00122 void set_auto_increment(bool is_auto = true);
00123
00124 gint get_position() const;
00125
00126 void set_position(gint position);
00127
00128
00129
00130
00131
00132
00133
00134 Value get_default_value() const;
00135
00136
00137 void set_default_value(const Value& default_value);
00138
00139
00140 };
00141
00142 }
00143 }
00144
00145
00146 namespace Gnome
00147 {
00148
00149 namespace Gda
00150 {
00151
00157 bool operator==(const FieldAttributes& lhs, const FieldAttributes& rhs);
00158
00164 bool operator!=(const FieldAttributes& lhs, const FieldAttributes& rhs);
00165
00166
00167 }
00168
00169 }
00170
00171
00172 namespace Glib
00173 {
00174
00180 Gnome::Gda::FieldAttributes wrap(GdaFieldAttributes* object, bool take_copy = false);
00181
00182 }
00183
00184 #endif
00185