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


#include <glibmm.h>

/* $Id: entityfield.hg,v 1.1 2006/11/08 00:07:37 murrayc Exp $ */
// -*- C++ -*- // this is for the .hg, I realize gensig puts one in

/* entityfield.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/object.h>
#include <libgdamm/dicttype.h>
#include <glibmm/object.h>
#include <libgda/gda-entity-field.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GdaEntityField GdaEntityField;
typedef struct _GdaEntityFieldClass GdaEntityFieldClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{ class EntityField_Class; } // namespace Gda

} // namespace Gnome
namespace Gnome
{

namespace Gda
{

class Entity;

/** Base class to represent a generic field (for tables' fields, etc).
 *
 * @ingroup LesserUsed
 */

class EntityField : public Glib::Interface
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef EntityField CppObjectType;
  typedef EntityField_Class CppClassType;
  typedef GdaEntityField BaseObjectType;
  typedef GdaEntityFieldIface BaseClassType;

private:
  friend class EntityField_Class;
  static CppClassType entityfield_class_;

  // noncopyable
  EntityField(const EntityField&);
  EntityField& operator=(const EntityField&);

protected:
  EntityField(); // you must derive from this class

  /** Called by constructors of derived classes. Provide the result of 
   * the Class init() function to ensure that it is properly 
   * initialized.
   * 
   * @param interface_class The Class object for the derived type.
   */
  explicit EntityField(const Glib::Interface_Class& interface_class);

public:
  // This is public so that C++ wrapper instances can be
  // created for C instances of unwrapped types.
  // For instance, if an unexpected C type implements the C interface. 
  explicit EntityField(GdaEntityField* castitem);

protected:
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
  virtual ~EntityField();

  static void add_interface(GType gtype_implementer);

#ifndef DOXYGEN_SHOULD_SKIP_THIS
  static GType get_type()      G_GNUC_CONST;
  static GType get_base_type() G_GNUC_CONST;
#endif

  ///Provides access to the underlying C GObject.
  GdaEntityField*       gobj()       { return reinterpret_cast<GdaEntityField*>(gobject_); }

  ///Provides access to the underlying C GObject.  
  const GdaEntityField* gobj() const { return reinterpret_cast<GdaEntityField*>(gobject_); }

private:

protected:

public:

  
  /** Get a reference to the object implementing the Gda::Entity interface to which
   * the object implementing the Gda::EntityField is attached to.
   * @return The object implementing the Gda::Entity interface.
   */
  Glib::RefPtr<Entity> get_entity();
  
  /** Get a reference to the object implementing the Gda::Entity interface to which
   * the object implementing the Gda::EntityField is attached to.
   * @return The object implementing the Gda::Entity interface.
   */
  Glib::RefPtr<const Entity> get_entity() const;

  
  /** Get the gda type of the object implementing the Gda::EntityField interface
   * @return The corresponding Type or TYPE_INVALID if the gda type is unknown.
   */
  GType get_g_type() const;

  
  /** Get the data type of the object implementing the Gda::EntityField interface
   * @return The corresponding Gda::DictType.
   */
  Glib::RefPtr<DictType> get_dict_type();
  
  /** Get the data type of the object implementing the Gda::EntityField interface
   * @return The corresponding Gda::DictType.
   */
  Glib::RefPtr<const DictType> get_dict_type() const;
  
  void set_dict_type(const Glib::RefPtr<DictType>& type);

  
  /** Get the name of the object implementing the Gda::EntityField interface
   * @return The name.
   */
  Glib::ustring get_name() const;
  
  /** Get the description of the object implementing the Gda::EntityField interface
   * @return The description.
   */
  Glib::ustring get_description() const;

//TODO: Watch out, this might not do correct reference counting:
  //_WRAP_VFUNC(Glib::RefPtr<Entity> get_entity(), get_entity)
  #ifdef GLIBMM_VFUNCS_ENABLED
  virtual GType get_g_type_vfunc();
#endif //GLIBMM_VFUNCS_ENABLED

  #ifdef GLIBMM_VFUNCS_ENABLED
  virtual void set_dict_type_vfunc(const Glib::RefPtr<DictType>& type);
#endif //GLIBMM_VFUNCS_ENABLED

  //_WRAP_VFUNC(Glib::RefPtr<DictType> get_dict_type(), get_dict_type)
  #ifdef GLIBMM_VFUNCS_ENABLED
  virtual Glib::ustring get_alias_vfunc();
#endif //GLIBMM_VFUNCS_ENABLED


public:

public:
  //C++ methods used to invoke GTK+ virtual functions:
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

protected:
  //GTK+ Virtual Functions (override these to change behaviour):
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

  //Default Signal Handlers::
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


};

} // namespace Gda
} // namespace Gnome


namespace Glib
{
  /** A Glib::wrap() method for this object.
   * 
   * @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.
   *
   * @relates Gnome::Gda::EntityField
   */
  Glib::RefPtr<Gnome::Gda::EntityField> wrap(GdaEntityField* object, bool take_copy = false);

} // namespace Glib


#endif /* _LIBGDAMM_ENTITYFIELD_H */

