// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgdamm/dictfield.h>
#include <libgdamm/private/dictfield_p.h>

/* $Id: dicttype.ccg,v 1.3 2006/11/08 00:52:25 murrayc Exp $ */
// -*- C++ -*- // this is for the .ccg, I realize gensig puts one in

/* dict.cc
 * 
 * Copyright 2006 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 <libgda/gda-dict-type.h>
#include <libgdamm/dict.h>
#include <libgdamm/connection.h>
#include <libgda/gda-enum-types.h>

namespace Gnome
{

namespace Gda
{

Value DictField::get_default_value() const
{
  return Value(gda_dict_field_get_default_value(const_cast<GdaDictField*>(gobj())));
}

} //namespace Gda


} // namespace Gnome


namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gnome::Gda::DictFieldAttribute>::value_type()
{
  return gda_dict_field_attribute_get_type();
}


namespace Glib
{

Glib::RefPtr<Gnome::Gda::DictField> wrap(GdaDictField* object, bool take_copy)
{
  return Glib::RefPtr<Gnome::Gda::DictField>( dynamic_cast<Gnome::Gda::DictField*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gnome
{

namespace Gda
{


/* The *_Class implementation: */

const Glib::Class& DictField_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &DictField_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gda_dict_field_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:
  XmlStorage::add_interface(get_type());

  }

  return *this;
}

void DictField_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
}

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


Glib::ObjectBase* DictField_Class::wrap_new(GObject* object)
{
  return new DictField((GdaDictField*)object);
}


/* The implementation: */

GdaDictField* DictField::gobj_copy()
{
  reference();
  return gobj();
}

DictField::DictField(const Glib::ConstructParams& construct_params)
:
  Gda::Object(construct_params)
{

}

DictField::DictField(GdaDictField* castitem)
:
  Gda::Object((GdaObject*)(castitem))
{}

DictField::~DictField()
{}


DictField::CppClassType DictField::dictfield_class_; // initialize static member

GType DictField::get_type()
{
  return dictfield_class_.init().get_type();
}

GType DictField::get_base_type()
{
  return gda_dict_field_get_type();
}


DictField::DictField(const Glib::RefPtr<Dict>& dict, const Glib::RefPtr<DictType>& type)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Gda::Object(Glib::ConstructParams(dictfield_class_.init(), "dict", Glib::unwrap(dict), "type", Glib::unwrap(type), static_cast<char*>(0)))
{
  

}

Glib::RefPtr<DictField> DictField::create(const Glib::RefPtr<Dict>& dict, const Glib::RefPtr<DictType>& type)
{
  return Glib::RefPtr<DictField>( new DictField(dict, type) );
}
void DictField::set_length(int length)
{
gda_dict_field_set_length(gobj(), length); 
}

int DictField::get_length() const
{
  return gda_dict_field_get_length(const_cast<GdaDictField*>(gobj()));
}

void DictField::set_scale(int length)
{
gda_dict_field_set_scale(gobj(), length); 
}

int DictField::get_scale() const
{
  return gda_dict_field_get_scale(const_cast<GdaDictField*>(gobj()));
}

Glib::SListHandle< Glib::RefPtr<Connection> > DictField::get_constraints()
{
  return Glib::SListHandle< Glib::RefPtr<Connection> >(gda_dict_field_get_constraints(gobj()), Glib::OWNERSHIP_SHALLOW);
}

Glib::SListHandle< Glib::RefPtr<const Connection> > DictField::get_constraints() const
{
  return Glib::SListHandle< Glib::RefPtr<const Connection> >(gda_dict_field_get_constraints(const_cast<GdaDictField*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

void DictField::set_default_value(const Value& value)
{
gda_dict_field_set_default_value(gobj(), (value).gobj()); 
}

bool DictField::is_null_allowed() const
{
  return gda_dict_field_is_null_allowed(const_cast<GdaDictField*>(gobj()));
}

bool DictField::is_pkey_part() const
{
  return gda_dict_field_is_pkey_part(const_cast<GdaDictField*>(gobj()));
}

bool DictField::is_pkey_alone() const
{
  return gda_dict_field_is_pkey_alone(const_cast<GdaDictField*>(gobj()));
}

bool DictField::is_fkey_part() const
{
  return gda_dict_field_is_fkey_part(const_cast<GdaDictField*>(gobj()));
}

bool DictField::is_fkey_alone() const
{
  return gda_dict_field_is_fkey_alone(const_cast<GdaDictField*>(gobj()));
}

void DictField::set_attributes(DictFieldAttribute attributes)
{
gda_dict_field_set_attributes(gobj(), ((GdaDictFieldAttribute)(attributes))); 
}

DictFieldAttribute DictField::get_attributes() const
{
  return ((DictFieldAttribute)(gda_dict_field_get_attributes(const_cast<GdaDictField*>(gobj()))));
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<std::string> DictField::property_entry_plugin() 
{
  return Glib::PropertyProxy<std::string>(this, "entry-plugin");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<std::string> DictField::property_entry_plugin() const
{
  return Glib::PropertyProxy_ReadOnly<std::string>(this, "entry-plugin");
}
#endif //GLIBMM_PROPERTIES_ENABLED


#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED


} // namespace Gda

} // namespace Gnome


