00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGDAMM_FIELDATTRIBUTES_H 00004 #define _LIBGDAMM_FIELDATTRIBUTES_H 00005 00006 #include <glibmm.h> 00007 00008 /* $Id: fieldattributes.hg,v 1.3 2004/11/28 15:07:16 murrayc Exp $ */ 00009 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in 00010 00011 /* fieldattributes.h 00012 * 00013 * Copyright 2003 libgdamm 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 <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 /* DOXYGEN_SHOULD_SKIP_THIS */ 00054 00055 FieldAttributes(); 00056 00057 // Use make_a_copy=true when getting it directly from a struct. 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 //We use a custom conversion here because 00129 //- we need to copy the value. 00130 //- gda_field_attributes_get_default_value sometimes returns 0, but we want to return a gda_value_new_null() instead, 00131 // so that we don't need the concept of an invalid value. 00132 00133 00134 Value get_default_value() const; 00135 00136 00137 void set_default_value(const Value& default_value); 00138 00139 00140 }; 00141 00142 } // namespace Gda 00143 } // namespace Gnome 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 } // namespace Gda 00168 00169 } // namespace Gnome 00170 00171 00172 namespace Glib 00173 { 00174 00180 Gnome::Gda::FieldAttributes wrap(GdaFieldAttributes* object, bool take_copy = false); 00181 00182 } // namespace Glib 00183 00184 #endif /* _LIBGDAMM_FIELDATTRIBUTES_H */ 00185