// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgdamm/connectionevent.h>
#include <libgdamm/private/connectionevent_p.h>

/* $Id: connectionevent.ccg,v 1.2 2006/06/11 08:12:29 murrayc Exp $ */
// -*- C++ -*- // this is for the .ccg, I realize gensig puts one in

/* error.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 Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser 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-enum-types.h>

namespace Gnome
{


} /* namespace Gnome */


namespace
{
} // anonymous namespace

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

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


namespace Glib
{

Glib::RefPtr<Gnome::Gda::ConnectionEvent> wrap(GdaConnectionEvent* object, bool take_copy)
{
  return Glib::RefPtr<Gnome::Gda::ConnectionEvent>( dynamic_cast<Gnome::Gda::ConnectionEvent*> (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& ConnectionEvent_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_ = &ConnectionEvent_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_connection_event_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void ConnectionEvent_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);


}


Glib::ObjectBase* ConnectionEvent_Class::wrap_new(GObject* object)
{
  return new ConnectionEvent((GdaConnectionEvent*)object);
}


/* The implementation: */

GdaConnectionEvent* ConnectionEvent::gobj_copy()
{
  reference();
  return gobj();
}

ConnectionEvent::ConnectionEvent(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

ConnectionEvent::ConnectionEvent(GdaConnectionEvent* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


ConnectionEvent::~ConnectionEvent()
{}


ConnectionEvent::CppClassType ConnectionEvent::connectionevent_class_; // initialize static member

GType ConnectionEvent::get_type()
{
  return connectionevent_class_.init().get_type();
}


GType ConnectionEvent::get_base_type()
{
  return gda_connection_event_get_type();
}


ConnectionEvent::ConnectionEvent()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(connectionevent_class_.init()))
{
  

}

Glib::RefPtr<ConnectionEvent> ConnectionEvent::create()
{
  return Glib::RefPtr<ConnectionEvent>( new ConnectionEvent() );
}

void ConnectionEvent::set_event_type(ConnectionEventType type)
{
gda_connection_event_set_event_type(gobj(), ((GdaConnectionEventType)(type))); 
}

ConnectionEventType ConnectionEvent::get_event_type() const
{
  return ((ConnectionEventType)(gda_connection_event_get_event_type(const_cast<GdaConnectionEvent*>(gobj()))));
}

Glib::ustring ConnectionEvent::get_description() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gda_connection_event_get_description(const_cast<GdaConnectionEvent*>(gobj())));
}

void ConnectionEvent::set_description(const Glib::ustring& description)
{
gda_connection_event_set_description(gobj(), description.c_str()); 
}

glong ConnectionEvent::get_code() const
{
  return gda_connection_event_get_code(const_cast<GdaConnectionEvent*>(gobj()));
}

void ConnectionEvent::set_code(glong code)
{
gda_connection_event_set_code(gobj(), code); 
}

ConnectionEventCode ConnectionEvent::get_gda_code() const
{
  return ((ConnectionEventCode)(gda_connection_event_get_gda_code(const_cast<GdaConnectionEvent*>(gobj()))));
}

void ConnectionEvent::set_gda_code(ConnectionEventCode code)
{
gda_connection_event_set_gda_code(gobj(), ((GdaConnectionEventCode)(code))); 
}

Glib::ustring ConnectionEvent::get_source() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gda_connection_event_get_source(const_cast<GdaConnectionEvent*>(gobj())));
}

void ConnectionEvent::set_source(const Glib::ustring& source)
{
gda_connection_event_set_source(gobj(), source.c_str()); 
}

Glib::ustring ConnectionEvent::get_sqlstate() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gda_connection_event_get_sqlstate(const_cast<GdaConnectionEvent*>(gobj())));
}

void ConnectionEvent::set_sqlstate(const Glib::ustring& sqlstate)
{
gda_connection_event_set_sqlstate(gobj(), sqlstate.c_str()); 
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<ConnectionEventType> ConnectionEvent::property_type() 
{
  return Glib::PropertyProxy<ConnectionEventType>(this, "type");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<ConnectionEventType> ConnectionEvent::property_type() const
{
  return Glib::PropertyProxy_ReadOnly<ConnectionEventType>(this, "type");
}
#endif //GLIBMM_PROPERTIES_ENABLED


} // namespace Gda

} // namespace Gnome


