/* $Id: fieldattributes.hg,v 1.3 2004/11/28 15:07:16 murrayc Exp $ */ // -*- C++ -*- // this is for the .hg, I realize gensig puts one in /* fieldattributes.h * * Copyright 2003 libgdamm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include _DEFS(libgdamm,libgda) _PINCLUDE(glibmm/private/object_p.h) #include #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { typedef struct _GdaFieldAttributes GdaFieldAttributes; } #endif namespace Gnome { namespace Gda { class FieldAttributes { _CLASS_OPAQUE_COPYABLE(FieldAttributes, GdaFieldAttributes, gda_field_attributes_new, gda_field_attributes_copy, gda_field_attributes_free) _IGNORE(gda_field_attributes_copy, gda_field_attributes_free) public: _WRAP_EQUAL(gda_field_attributes_equal) _IGNORE(gda_field_attributes_equal) _WRAP_METHOD(glong get_defined_size() const, gda_field_attributes_get_defined_size) _WRAP_METHOD(void set_defined_size(glong size), gda_field_attributes_set_defined_size) _WRAP_METHOD(Glib::ustring get_name() const, gda_field_attributes_get_name) _WRAP_METHOD(void set_name(const Glib::ustring& name), gda_field_attributes_set_name) _WRAP_METHOD(Glib::ustring get_table() const, gda_field_attributes_get_table) _WRAP_METHOD(void set_table(const Glib::ustring& table), gda_field_attributes_set_table) _WRAP_METHOD(Glib::ustring get_caption() const, gda_field_attributes_get_caption) _WRAP_METHOD(void set_caption(const Glib::ustring& caption), gda_field_attributes_set_caption) _WRAP_METHOD(glong get_scale() const, gda_field_attributes_get_scale) _WRAP_METHOD(void set_scale(glong scale), gda_field_attributes_set_scale) _WRAP_METHOD(ValueType get_gdatype() const, gda_field_attributes_get_gdatype) _WRAP_METHOD(void set_gdatype(ValueType type), gda_field_attributes_set_gdatype) _WRAP_METHOD(bool get_allow_null() const, gda_field_attributes_get_allow_null) _WRAP_METHOD(void set_allow_null(bool allow = true), gda_field_attributes_set_allow_null) _WRAP_METHOD(bool get_primary_key() const, gda_field_attributes_get_primary_key) _WRAP_METHOD(void set_primary_key(bool pk = true), gda_field_attributes_set_primary_key) _WRAP_METHOD(bool get_unique_key() const, gda_field_attributes_get_unique_key) _WRAP_METHOD(void set_unique_key(bool uk = true), gda_field_attributes_set_unique_key) _WRAP_METHOD(Glib::ustring get_references(), gda_field_attributes_get_references) _WRAP_METHOD(void set_references(const Glib::ustring& ref), gda_field_attributes_set_references) _WRAP_METHOD(bool get_auto_increment() const, gda_field_attributes_get_auto_increment) _WRAP_METHOD(void set_auto_increment(bool is_auto = true), gda_field_attributes_set_auto_increment) _WRAP_METHOD(gint get_position() const, gda_field_attributes_get_position) _WRAP_METHOD(void set_position(gint position), gda_field_attributes_set_position) //We use a custom conversion here because //- we need to copy the value. //- gda_field_attributes_get_default_value sometimes returns 0, but we want to return a gda_value_new_null() instead, // so that we don't need the concept of an invalid value. #m4 _CONVERSION(`const GdaValue*',`Value',`(($3) ? Glib::wrap(const_cast($3), true /* take_copy */) : Value() )') _WRAP_METHOD(Value get_default_value() const, gda_field_attributes_get_default_value) _WRAP_METHOD(void set_default_value(const Value& default_value), gda_field_attributes_set_default_value) }; } // namespace Gda } // namespace Gnome