// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _LIBGDAMM_FIELDATTRIBUTES_H
#define _LIBGDAMM_FIELDATTRIBUTES_H

#include <glibmm.h>

/* $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 <libgdamm/transaction.h>
#include <glibmm/object.h>


#include <libgdamm/value.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" { typedef struct _GdaFieldAttributes GdaFieldAttributes; }
#endif

namespace Gnome
{

namespace Gda
{

class FieldAttributes
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  typedef FieldAttributes CppObjectType;
  typedef GdaFieldAttributes BaseObjectType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

  FieldAttributes();

  // Use make_a_copy=true when getting it directly from a struct.
  explicit FieldAttributes(GdaFieldAttributes* castitem, bool make_a_copy = false);

  FieldAttributes(const FieldAttributes& src);
  FieldAttributes& operator=(const FieldAttributes& src);

  ~FieldAttributes();

  GdaFieldAttributes*       gobj()       { return gobject_; }
  const GdaFieldAttributes* gobj() const { return gobject_; }

  ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
  GdaFieldAttributes* gobj_copy() const;

protected:
  GdaFieldAttributes* gobject_;

private:

  
public:

  
  glong get_defined_size() const;
  
  void set_defined_size(glong size);
  
  Glib::ustring get_name() const;
  
  void set_name(const Glib::ustring& name);
  
  Glib::ustring get_table() const;
  
  void set_table(const Glib::ustring& table);
  
  Glib::ustring get_caption() const;
  
  void set_caption(const Glib::ustring& caption);
  
  glong get_scale() const;
  
  void set_scale(glong scale);
  
  ValueType get_gdatype() const;
  
  void set_gdatype(ValueType type);
  
  bool get_allow_null() const;
  
  void set_allow_null(bool allow = true);
  
  bool get_primary_key() const;
  
  void set_primary_key(bool pk = true);
  
  bool get_unique_key() const;
  
  void set_unique_key(bool uk = true);
  
  Glib::ustring get_references();
  
  void set_references(const Glib::ustring& ref);
  
  bool get_auto_increment() const;
  
  void set_auto_increment(bool is_auto = true);
  
  gint get_position() const;
  
  void set_position(gint 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.
   

  Value get_default_value() const;
  
  
  void set_default_value(const Value& default_value);


};

} // namespace Gda
} // namespace Gnome


namespace Gnome
{

namespace Gda
{

/** @relates Gnome::Gda::FieldAttributes
 * @param lhs The left-hand side
 * @param rhs The right-hand side
 * @result The result
 */
bool operator==(const FieldAttributes& lhs, const FieldAttributes& rhs);

/** @relates Gnome::Gda::FieldAttributes
 * @param lhs The left-hand side
 * @param rhs The right-hand side
 * @result The result
 */
bool operator!=(const FieldAttributes& lhs, const FieldAttributes& rhs);


} // namespace Gda

} // namespace Gnome


namespace Glib
{

  /** @relates Gnome::Gda::FieldAttributes
   * @param object The C instance
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
   * @result A C++ instance that wraps this C instance.
   */
Gnome::Gda::FieldAttributes wrap(GdaFieldAttributes* object, bool take_copy = false);

} // namespace Glib

#endif /* _LIBGDAMM_FIELDATTRIBUTES_H */

