// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgdamm/dictfunction.h>
#include <libgdamm/private/dictfunction_p.h>

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

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

namespace Gnome
{

namespace Gda
{


} // namespace Gda

} /* namespace Gnome */


namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gnome::Gda::DictFunction> wrap(GdaDictFunction* object, bool take_copy)
{
  return Glib::RefPtr<Gnome::Gda::DictFunction>( dynamic_cast<Gnome::Gda::DictFunction*> (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& DictFunction_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_ = &DictFunction_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_function_get_type());

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

  }

  return *this;
}

void DictFunction_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* DictFunction_Class::wrap_new(GObject* object)
{
  return new DictFunction((GdaDictFunction*)object);
}


/* The implementation: */

GdaDictFunction* DictFunction::gobj_copy()
{
  reference();
  return gobj();
}

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

}

DictFunction::DictFunction(GdaDictFunction* castitem)
:
  Gda::Object((GdaObject*)(castitem))
{}

DictFunction::~DictFunction()
{}


DictFunction::CppClassType DictFunction::dictfunction_class_; // initialize static member

GType DictFunction::get_type()
{
  return dictfunction_class_.init().get_type();
}

GType DictFunction::get_base_type()
{
  return gda_dict_function_get_type();
}


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

}

Glib::RefPtr<DictFunction> DictFunction::create(const Glib::RefPtr<Dict>& dict)
{
  return Glib::RefPtr<DictFunction>( new DictFunction(dict) );
}
void DictFunction::set_dbms_id(const Glib::ustring& id)
{
gda_dict_function_set_dbms_id(gobj(), id.c_str()); 
}

Glib::ustring DictFunction::get_dbms_id() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gda_dict_function_get_dbms_id(const_cast<GdaDictFunction*>(gobj())));
}

void DictFunction::set_sqlname(const Glib::ustring& sqlname)
{
gda_dict_function_set_sqlname(gobj(), sqlname.c_str()); 
}

Glib::ustring DictFunction::get_sqlname() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gda_dict_function_get_sqlname(const_cast<GdaDictFunction*>(gobj())));
}

void DictFunction::set_arg_dict_types(const Glib::SListHandle<DictType>& arg_types)
{
gda_dict_function_set_arg_dict_types(gobj(), arg_types.data()); 
}

Glib::SListHandle< Glib::RefPtr<const DictType> > DictFunction::get_arg_dict_types() const
{
  return Glib::SListHandle< Glib::RefPtr<const DictType> >((GSList*)gda_dict_function_get_arg_dict_types(const_cast<GdaDictFunction*>(gobj())), Glib::OWNERSHIP_NONE);
}

void DictFunction::set_ret_dict_type(const Glib::RefPtr<DictType>& dt)
{
gda_dict_function_set_ret_dict_type(gobj(), Glib::unwrap(dt)); 
}

Glib::RefPtr<DictType> DictFunction::get_ret_dict_type()
{

  Glib::RefPtr<DictType> retvalue = Glib::wrap(gda_dict_function_get_ret_dict_type(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const DictType> DictFunction::get_ret_dict_type() const
{
  return const_cast<DictFunction*>(this)->get_ret_dict_type();
}

bool DictFunction::accepts_arg_dict_types(const Glib::SListHandle<DictType>& arg_types)
{
  return gda_dict_function_accepts_arg_dict_types(gobj(), arg_types.data());
}


#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED


} // namespace Gda

} // namespace Gnome


