// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgdamm/queryfieldvalue.h>
#include <libgdamm/private/queryfieldvalue_p.h>

// -*- C++ -*- // this is for the .ccg, I realize gensig puts one in

/* queryfieldvalue.cc
 * 
 * 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 <libgda/gda-query-field-value.h>

namespace Gnome
{

namespace Gda
{

QueryFieldValue::QueryFieldValue(const Glib::RefPtr<Query>& query, GType type)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  QueryField(Glib::ConstructParams(queryfieldvalue_class_.init(), "dict",gda_object_get_dict(GDA_OBJECT(query->gobj())),"query",Glib::unwrap(query),"g-type",type, static_cast<char*>(0)))
{
}

QueryFieldValue::QueryFieldValue(const Glib::RefPtr<Query>& query, const Value& value)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  QueryField(Glib::ConstructParams(queryfieldvalue_class_.init(), "dict",gda_object_get_dict(GDA_OBJECT(query->gobj())),"query",Glib::unwrap(query),"g-type",value.get_value_type(), static_cast<char*>(0)))
{
  set_value(value);
}

} /* namespace Gda */

} /* namespace Gnome */


namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gnome::Gda::QueryFieldValue> wrap(GdaQueryFieldValue* object, bool take_copy)
{
  return Glib::RefPtr<Gnome::Gda::QueryFieldValue>( dynamic_cast<Gnome::Gda::QueryFieldValue*> (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& QueryFieldValue_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_ = &QueryFieldValue_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_query_field_value_get_type());

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

  }

  return *this;
}

void QueryFieldValue_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* QueryFieldValue_Class::wrap_new(GObject* object)
{
  return new QueryFieldValue((GdaQueryFieldValue*)object);
}


/* The implementation: */

GdaQueryFieldValue* QueryFieldValue::gobj_copy()
{
  reference();
  return gobj();
}

QueryFieldValue::QueryFieldValue(const Glib::ConstructParams& construct_params)
:
  QueryField(construct_params)
{

}

QueryFieldValue::QueryFieldValue(GdaQueryFieldValue* castitem)
:
  QueryField((GdaQueryField*)(castitem))
{}

QueryFieldValue::~QueryFieldValue()
{}


QueryFieldValue::CppClassType QueryFieldValue::queryfieldvalue_class_; // initialize static member

GType QueryFieldValue::get_type()
{
  return queryfieldvalue_class_.init().get_type();
}

GType QueryFieldValue::get_base_type()
{
  return gda_query_field_value_get_type();
}


Glib::RefPtr<QueryFieldValue> QueryFieldValue::create(const Glib::RefPtr<Query>& query, GType type)
{
  return Glib::RefPtr<QueryFieldValue>( new QueryFieldValue(query, type) );
}
Glib::RefPtr<QueryFieldValue> QueryFieldValue::create(const Glib::RefPtr<Query>& query, const Value& value)
{
  return Glib::RefPtr<QueryFieldValue>( new QueryFieldValue(query, value) );
}
void QueryFieldValue::set_value(const Value& val)
{
gda_query_field_value_set_value(gobj(), (val).gobj()); 
}

Value QueryFieldValue::get_value() const
{
  return Value(gda_query_field_value_get_value(const_cast<GdaQueryFieldValue*>(gobj())));
}

void QueryFieldValue::set_default_value(const Value& default_val)
{
gda_query_field_value_set_default_value(gobj(), (default_val).gobj()); 
}

Value QueryFieldValue::get_default_value() const
{
  return Value(gda_query_field_value_get_default_value(const_cast<GdaQueryFieldValue*>(gobj())));
}

void QueryFieldValue::set_is_parameter(bool is_param)
{
gda_query_field_value_set_is_parameter(gobj(), static_cast<int>(is_param)); 
}

bool QueryFieldValue::get_is_parameter() const
{
  return gda_query_field_value_get_is_parameter(const_cast<GdaQueryFieldValue*>(gobj()));
}

void QueryFieldValue::set_not_null(bool not_null)
{
gda_query_field_value_set_not_null(gobj(), static_cast<int>(not_null)); 
}

bool QueryFieldValue::get_not_null() const
{
  return gda_query_field_value_get_not_null(const_cast<GdaQueryFieldValue*>(gobj()));
}

bool QueryFieldValue::is_value_null(const Glib::RefPtr<ParameterList>& context) const
{
  return gda_query_field_value_is_value_null(const_cast<GdaQueryFieldValue*>(gobj()), Glib::unwrap(context));
}

#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool QueryFieldValue::restrict(const Glib::RefPtr<DataModel>& model, int col)
#else
bool QueryFieldValue::restrict(const Glib::RefPtr<DataModel>& model, int col, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
  GError* gerror = 0;
  bool retvalue = gda_query_field_value_restrict(gobj(), Glib::unwrap(model), col, &(gerror));
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
#else
  if(gerror)
    error = ::Glib::Error::throw_exception(gerror);
#endif //GLIBMM_EXCEPTIONS_ENABLED

  return retvalue;

}


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

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

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<GType> QueryFieldValue::property_g_type() 
{
  return Glib::PropertyProxy<GType>(this, "g-type");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<GType> QueryFieldValue::property_g_type() const
{
  return Glib::PropertyProxy_ReadOnly<GType>(this, "g-type");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Query> > QueryFieldValue::property_query() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Query> >(this, "query");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<int> QueryFieldValue::property_restrict_column() 
{
  return Glib::PropertyProxy<int>(this, "restrict-column");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<int> QueryFieldValue::property_restrict_column() const
{
  return Glib::PropertyProxy_ReadOnly<int>(this, "restrict-column");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<DataModel> > QueryFieldValue::property_restrict_model() 
{
  return Glib::PropertyProxy< Glib::RefPtr<DataModel> >(this, "restrict-model");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> > QueryFieldValue::property_restrict_model() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> >(this, "restrict-model");
}
#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


