// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgdamm/query.h>
#include <libgdamm/private/query_p.h>

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

/* query.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 <libgdamm/query.h>
#include <libgda/gda-query.h>
#include <libgda/gda-enum-types.h>

namespace Gnome
{

namespace Gda
{

Query::Query(const Glib::RefPtr<Dict>& dict, QueryType type)
  : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  QueryObject(Glib::ConstructParams(query_class_.init(), "dict",Glib::unwrap(dict), static_cast<char*>(0)))
{
  set_query_type(type);
}

} /* namespace Gda */

} /* namespace Gnome */


namespace
{


static const Glib::SignalProxyInfo Query_signal_type_changed_info =
{
  "type_changed",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


static const Glib::SignalProxyInfo Query_signal_condition_changed_info =
{
  "condition_changed",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


static void Query_signal_target_added_callback(GdaQuery* self, GdaQueryTarget* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<QueryTarget>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_target_added_info =
{
  "target_added",
  (GCallback) &Query_signal_target_added_callback,
  (GCallback) &Query_signal_target_added_callback
};


static void Query_signal_target_removed_callback(GdaQuery* self, GdaQueryTarget* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<QueryTarget>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_target_removed_info =
{
  "target_removed",
  (GCallback) &Query_signal_target_removed_callback,
  (GCallback) &Query_signal_target_removed_callback
};


static void Query_signal_target_updated_callback(GdaQuery* self, GdaQueryTarget* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<QueryTarget>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_target_updated_info =
{
  "target_updated",
  (GCallback) &Query_signal_target_updated_callback,
  (GCallback) &Query_signal_target_updated_callback
};


static void Query_signal_join_added_callback(GdaQuery* self, GdaQueryJoin* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<QueryJoin>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_join_added_info =
{
  "join_added",
  (GCallback) &Query_signal_join_added_callback,
  (GCallback) &Query_signal_join_added_callback
};


static void Query_signal_join_removed_callback(GdaQuery* self, GdaQueryJoin* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<QueryJoin>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_join_removed_info =
{
  "join_removed",
  (GCallback) &Query_signal_join_removed_callback,
  (GCallback) &Query_signal_join_removed_callback
};


static void Query_signal_join_updated_callback(GdaQuery* self, GdaQueryJoin* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<QueryJoin>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_join_updated_info =
{
  "join_updated",
  (GCallback) &Query_signal_join_updated_callback,
  (GCallback) &Query_signal_join_updated_callback
};


static void Query_signal_sub_query_added_callback(GdaQuery* self, GdaQuery* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<Query>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_sub_query_added_info =
{
  "sub_query_added",
  (GCallback) &Query_signal_sub_query_added_callback,
  (GCallback) &Query_signal_sub_query_added_callback
};


static void Query_signal_sub_query_removed_callback(GdaQuery* self, GdaQuery* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<Query>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_sub_query_removed_info =
{
  "sub_query_removed",
  (GCallback) &Query_signal_sub_query_removed_callback,
  (GCallback) &Query_signal_sub_query_removed_callback
};


static void Query_signal_sub_query_updated_callback(GdaQuery* self, GdaQuery* p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,const Glib::RefPtr<Query>& > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Query_signal_sub_query_updated_info =
{
  "sub_query_updated",
  (GCallback) &Query_signal_sub_query_updated_callback,
  (GCallback) &Query_signal_sub_query_updated_callback
};


} // anonymous namespace

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

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


Gnome::Gda::QueryError::QueryError(Gnome::Gda::QueryError::Code error_code, const Glib::ustring& error_message)
:
  Glib::Error (GDA_QUERY_ERROR, error_code, error_message)
{}

Gnome::Gda::QueryError::QueryError(GError* gobject)
:
  Glib::Error (gobject)
{}

Gnome::Gda::QueryError::Code Gnome::Gda::QueryError::code() const
{
  return static_cast<Code>(Glib::Error::code());
}

#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Gnome::Gda::QueryError::throw_func(GError* gobject)
{
  throw Gnome::Gda::QueryError(gobject);
}
#else
//When not using exceptions, we just pass the Exception object around without throwing it:
std::auto_ptr<Glib::Error> Gnome::Gda::QueryError::throw_func(GError* gobject)
{
  return std::auto_ptr<Glib::Error>(new Gnome::Gda::QueryError(gobject));
}
#endif //GLIBMM_EXCEPTIONS_ENABLED

// static
GType Glib::Value<Gnome::Gda::QueryError::Code>::value_type()
{
  return gda_query_error_get_type();
}


namespace Glib
{

Glib::RefPtr<Gnome::Gda::Query> wrap(GdaQuery* object, bool take_copy)
{
  return Glib::RefPtr<Gnome::Gda::Query>( dynamic_cast<Gnome::Gda::Query*> (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& Query_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_ = &Query_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_get_type());

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

  }

  return *this;
}

void Query_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
  klass->type_changed = &type_changed_callback;
  klass->condition_changed = &condition_changed_callback;
  klass->target_added = &target_added_callback;
  klass->target_removed = &target_removed_callback;
  klass->target_updated = &target_updated_callback;
  klass->join_added = &join_added_callback;
  klass->join_removed = &join_removed_callback;
  klass->join_updated = &join_updated_callback;
  klass->sub_query_added = &sub_query_added_callback;
  klass->sub_query_removed = &sub_query_removed_callback;
  klass->sub_query_updated = &sub_query_updated_callback;
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
}

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Query_Class::type_changed_callback(GdaQuery* self)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_type_changed();
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->type_changed)
    (*base->type_changed)(self);
}
void Query_Class::condition_changed_callback(GdaQuery* self)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_condition_changed();
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->condition_changed)
    (*base->condition_changed)(self);
}
void Query_Class::target_added_callback(GdaQuery* self, GdaQueryTarget* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_target_added(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->target_added)
    (*base->target_added)(self, p0);
}
void Query_Class::target_removed_callback(GdaQuery* self, GdaQueryTarget* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_target_removed(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->target_removed)
    (*base->target_removed)(self, p0);
}
void Query_Class::target_updated_callback(GdaQuery* self, GdaQueryTarget* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_target_updated(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->target_updated)
    (*base->target_updated)(self, p0);
}
void Query_Class::join_added_callback(GdaQuery* self, GdaQueryJoin* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_join_added(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->join_added)
    (*base->join_added)(self, p0);
}
void Query_Class::join_removed_callback(GdaQuery* self, GdaQueryJoin* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_join_removed(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->join_removed)
    (*base->join_removed)(self, p0);
}
void Query_Class::join_updated_callback(GdaQuery* self, GdaQueryJoin* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_join_updated(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->join_updated)
    (*base->join_updated)(self, p0);
}
void Query_Class::sub_query_added_callback(GdaQuery* self, GdaQuery* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_sub_query_added(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->sub_query_added)
    (*base->sub_query_added)(self, p0);
}
void Query_Class::sub_query_removed_callback(GdaQuery* self, GdaQuery* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_sub_query_removed(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->sub_query_removed)
    (*base->sub_query_removed)(self, p0);
}
void Query_Class::sub_query_updated_callback(GdaQuery* self, GdaQuery* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_sub_query_updated(Glib::wrap(p0)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }
  
  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->sub_query_updated)
    (*base->sub_query_updated)(self, p0);
}
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


Glib::ObjectBase* Query_Class::wrap_new(GObject* object)
{
  return new Query((GdaQuery*)object);
}


/* The implementation: */

GdaQuery* Query::gobj_copy()
{
  reference();
  return gobj();
}

Query::Query(const Glib::ConstructParams& construct_params)
:
  QueryObject(construct_params)
{

}

Query::Query(GdaQuery* castitem)
:
  QueryObject((GdaQueryObject*)(castitem))
{}

Query::~Query()
{}


Query::CppClassType Query::query_class_; // initialize static member

GType Query::get_type()
{
  return query_class_.init().get_type();
}

GType Query::get_base_type()
{
  return gda_query_get_type();
}


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

}

Glib::RefPtr<Query> Query::create(const Glib::RefPtr<Dict>& dict)
{
  return Glib::RefPtr<Query>( new Query(dict) );
}
Glib::RefPtr<Query> Query::create(const Glib::RefPtr<Dict>& dict, QueryType type)
{
  return Glib::RefPtr<Query>( new Query(dict, type) );
}
void Query::set_query_type(QueryType type)
{
gda_query_set_query_type(gobj(), ((GdaQueryType)(type))); 
}

QueryType Query::get_query_type() const
{
  return ((QueryType)(gda_query_get_query_type(const_cast<GdaQuery*>(gobj()))));
}

Glib::ustring Query::get_query_type_string() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gda_query_get_query_type_string(const_cast<GdaQuery*>(gobj())));
}

bool Query::is_select_query() const
{
  return gda_query_is_select_query(const_cast<GdaQuery*>(gobj()));
}

bool Query::is_insert_query() const
{
  return gda_query_is_insert_query(const_cast<GdaQuery*>(gobj()));
}

bool Query::is_update_query() const
{
  return gda_query_is_update_query(const_cast<GdaQuery*>(gobj()));
}

bool Query::is_delete_query() const
{
  return gda_query_is_delete_query(const_cast<GdaQuery*>(gobj()));
}

bool Query::is_modify_query() const
{
  return gda_query_is_modify_query(const_cast<GdaQuery*>(gobj()));
}

#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool Query::is_well_formed(const Glib::RefPtr<ParameterList>& context) const
#else
bool Query::is_well_formed(const Glib::RefPtr<ParameterList>& context, std::auto_ptr<Glib::Error>& error) const
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
  GError* gerror = 0;
  bool retvalue = gda_query_is_well_formed(const_cast<GdaQuery*>(gobj()), Glib::unwrap(context), &(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_EXCEPTIONS_ENABLED
void Query::set_sql_text(const Glib::ustring& sql)
#else
void Query::set_sql_text(const Glib::ustring& sql, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
  GError* gerror = 0;
  gda_query_set_sql_text(gobj(), sql.c_str(), &(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


}

Glib::ustring Query::get_sql_text() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gda_query_get_sql_text(const_cast<GdaQuery*>(gobj())));
}

Glib::SListHandle<Glib::RefPtr<Parameter> > Query::get_parameters()
{
  return Glib::SListHandle<Glib::RefPtr<Parameter> >(gda_query_get_parameters(gobj()), Glib::OWNERSHIP_DEEP);
}

Glib::RefPtr<ParameterList> Query::get_parameter_list()
{

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

}

Glib::RefPtr<const ParameterList> Query::get_parameter_list() const
{
  return const_cast<Query*>(this)->get_parameter_list();
}

#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<Object> Query::execute(const Glib::RefPtr<ParameterList>& params, bool iter_model_only_requested)
#else
Glib::RefPtr<Object> Query::execute(const Glib::RefPtr<ParameterList>& params, bool iter_model_only_requested, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
  GError* gerror = 0;
  Glib::RefPtr<Object> retvalue = Glib::wrap(gda_query_execute(gobj(), Glib::unwrap(params), static_cast<int>(iter_model_only_requested), &(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;

}

Glib::RefPtr<Query> Query::get_parent_query()
{

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

}

Glib::RefPtr<const Query> Query::get_parent_query() const
{
  return const_cast<Query*>(this)->get_parent_query();
}

Glib::SListHandle<Glib::RefPtr<Query> > Query::get_sub_queries()
{
  return Glib::SListHandle<Glib::RefPtr<Query> >(gda_query_get_sub_queries(gobj()), Glib::OWNERSHIP_SHALLOW);
}

void Query::add_param_source(const Glib::RefPtr<DataModel>& param_source)
{
gda_query_add_param_source(gobj(), Glib::unwrap(param_source)); 
}

void Query::del_param_source(const Glib::RefPtr<DataModel>& param_source)
{
gda_query_del_param_source(gobj(), Glib::unwrap(param_source)); 
}

Glib::SListHandle<Glib::RefPtr<const Query> > Query::get_param_sources() const
{
  return Glib::SListHandle<Glib::RefPtr<const Query> >(const_cast<GSList*>(gda_query_get_param_sources(const_cast<GdaQuery*>(gobj()))), Glib::OWNERSHIP_NONE);
}

void Query::add_sub_query(const Glib::RefPtr<Query>& sub_query)
{
gda_query_add_sub_query(gobj(), Glib::unwrap(sub_query)); 
}

void Query::del_sub_query(const Glib::RefPtr<Query>& sub_query)
{
gda_query_del_sub_query(gobj(), Glib::unwrap(sub_query)); 
}

#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool Query::add_target(const Glib::RefPtr<QueryTarget>& target)
#else
bool Query::add_target(const Glib::RefPtr<QueryTarget>& target, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
  GError* gerror = 0;
  bool retvalue = gda_query_add_target(gobj(), Glib::unwrap(target), &(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;

}

void Query::del_target(const Glib::RefPtr<QueryTarget>& target)
{
gda_query_del_target(gobj(), Glib::unwrap(target)); 
}

Glib::SListHandle<Glib::RefPtr<QueryTarget> > Query::get_targets()
{
  return Glib::SListHandle<Glib::RefPtr<QueryTarget> >(gda_query_get_targets(gobj()), Glib::OWNERSHIP_SHALLOW);
}

Glib::SListHandle<Glib::RefPtr<const QueryTarget> > Query::get_targets() const
{
  return Glib::SListHandle<Glib::RefPtr<const QueryTarget> >(gda_query_get_targets(const_cast<GdaQuery*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

Glib::RefPtr<QueryTarget> Query::get_target_by_xml_id(const Glib::ustring& xml_id)
{

  Glib::RefPtr<QueryTarget> retvalue = Glib::wrap(gda_query_get_target_by_xml_id(gobj(), xml_id.c_str()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const QueryTarget> Query::get_target_by_xml_id(const Glib::ustring& xml_id) const
{
  return const_cast<Query*>(this)->get_target_by_xml_id(xml_id);
}

Glib::RefPtr<QueryTarget> Query::get_target_by_alias(const Glib::ustring& alias_or_name)
{

  Glib::RefPtr<QueryTarget> retvalue = Glib::wrap(gda_query_get_target_by_alias(gobj(), alias_or_name.c_str()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const QueryTarget> Query::get_target_by_alias(const Glib::ustring& alias_or_name) const
{
  return const_cast<Query*>(this)->get_target_by_alias(alias_or_name);
}

Glib::SListHandle<Glib::RefPtr<QueryField> > Query::get_target_pkfields(const Glib::RefPtr<QueryTarget>& target)
{
  return Glib::SListHandle<Glib::RefPtr<QueryField> >(gda_query_get_target_pkfields(gobj(), Glib::unwrap(target)), Glib::OWNERSHIP_SHALLOW);
}

Glib::SListHandle<Glib::RefPtr<const QueryField> > Query::get_target_pkfields(const Glib::RefPtr<QueryTarget>& target) const
{
  return Glib::SListHandle<Glib::RefPtr<const QueryField> >(gda_query_get_target_pkfields(const_cast<GdaQuery*>(gobj()), Glib::unwrap(target)), Glib::OWNERSHIP_SHALLOW);
}

bool Query::add_join(const Glib::RefPtr<QueryJoin>& join)
{
  return gda_query_add_join(gobj(), Glib::unwrap(join));
}

void Query::del_join(const Glib::RefPtr<QueryJoin>& join)
{
gda_query_del_join(gobj(), Glib::unwrap(join)); 
}

Glib::SListHandle<Glib::RefPtr<QueryJoin> > Query::get_joins()
{
  return Glib::SListHandle<Glib::RefPtr<QueryJoin> >(gda_query_get_joins(gobj()), Glib::OWNERSHIP_SHALLOW);
}

Glib::SListHandle<Glib::RefPtr<const QueryJoin> > Query::get_joins() const
{
  return Glib::SListHandle<Glib::RefPtr<const QueryJoin> >(gda_query_get_joins(const_cast<GdaQuery*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

Glib::RefPtr<QueryJoin> Query::get_join_by_targets(const Glib::RefPtr<QueryTarget>& target1, const Glib::RefPtr<QueryTarget>& target2)
{

  Glib::RefPtr<QueryJoin> retvalue = Glib::wrap(gda_query_get_join_by_targets(gobj(), Glib::unwrap(target1), Glib::unwrap(target2)));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const QueryJoin> Query::get_join_by_targets(const Glib::RefPtr<QueryTarget>& target1, const Glib::RefPtr<QueryTarget>& target2) const
{
  return const_cast<Query*>(this)->get_join_by_targets(target1, target2);
}

Glib::RefPtr<QueryCondition> Query::get_condition()
{

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

}

Glib::RefPtr<const QueryCondition> Query::get_condition() const
{
  return const_cast<Query*>(this)->get_condition();
}

void Query::set_condition(const Glib::RefPtr<QueryCondition>& cond)
{
gda_query_set_condition(gobj(), Glib::unwrap(cond)); 
}

void Query::append_condition(const Glib::RefPtr<QueryCondition>& cond, bool append_as_and)
{
gda_query_append_condition(gobj(), Glib::unwrap(cond), static_cast<int>(append_as_and)); 
}

Glib::SListHandle<Glib::RefPtr<QueryCondition> > Query::get_main_conditions()
{
  return Glib::SListHandle<Glib::RefPtr<QueryCondition> >(gda_query_get_main_conditions(gobj()), Glib::OWNERSHIP_SHALLOW);
}

Glib::SListHandle<Glib::RefPtr<const QueryCondition> > Query::get_main_conditions() const
{
  return Glib::SListHandle<Glib::RefPtr<const QueryCondition> >(gda_query_get_main_conditions(const_cast<GdaQuery*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

void Query::set_order_by_field(const Glib::RefPtr<QueryField>& field, int order, bool ascendant)
{
gda_query_set_order_by_field(gobj(), Glib::unwrap(field), order, static_cast<int>(ascendant)); 
}

#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<QueryField> Query::add_field_from_sql(const Glib::ustring& field)
#else
Glib::RefPtr<QueryField> Query::add_field_from_sql(const Glib::ustring& field, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
  GError* gerror = 0;
  Glib::RefPtr<QueryField> retvalue = Glib::wrap(gda_query_add_field_from_sql(gobj(), field.c_str(), &(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

  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::SListHandle<Glib::RefPtr<QueryField> > Query::get_all_fields()
{
  return Glib::SListHandle<Glib::RefPtr<QueryField> >(gda_query_get_all_fields(gobj()), Glib::OWNERSHIP_SHALLOW);
}

Glib::SListHandle<Glib::RefPtr<const QueryField> > Query::get_all_fields() const
{
  return Glib::SListHandle<Glib::RefPtr<const QueryField> >(gda_query_get_all_fields(const_cast<GdaQuery*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

Glib::RefPtr<QueryField> Query::get_field_by_sql_naming(const Glib::ustring& sql_name)
{

  Glib::RefPtr<QueryField> retvalue = Glib::wrap(gda_query_get_field_by_sql_naming(gobj(), sql_name.c_str()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const QueryField> Query::get_field_by_sql_naming(const Glib::ustring& sql_name) const
{
  return const_cast<Query*>(this)->get_field_by_sql_naming(sql_name);
}

Glib::RefPtr<QueryField> Query::get_field_by_param_name(const Glib::ustring& param_name)
{

  Glib::RefPtr<QueryField> retvalue = Glib::wrap(gda_query_get_field_by_param_name(gobj(), param_name.c_str()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const QueryField> Query::get_field_by_param_name(const Glib::ustring& param_name) const
{
  return const_cast<Query*>(this)->get_field_by_param_name(param_name);
}

Glib::RefPtr<QueryField> Query::get_field_by_ref_field(const Glib::RefPtr<QueryTarget>& target, const Glib::RefPtr<EntityField>& ref_field, QueryFieldState field_state)
{

  Glib::RefPtr<QueryField> retvalue = Glib::wrap(gda_query_get_field_by_ref_field(gobj(), Glib::unwrap(target), Glib::unwrap(ref_field), ((GdaQueryFieldState)(field_state))));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const QueryField> Query::get_field_by_ref_field(const Glib::RefPtr<QueryTarget>& target, const Glib::RefPtr<EntityField>& field, QueryFieldState field_state) const
{
  return const_cast<Query*>(this)->get_field_by_ref_field(target, field, field_state);
}

Glib::RefPtr<QueryField> Query::get_first_field_for_target(const Glib::RefPtr<QueryTarget>& target)
{

  Glib::RefPtr<QueryField> retvalue = Glib::wrap(gda_query_get_first_field_for_target(gobj(), Glib::unwrap(target)));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const QueryField> Query::get_first_field_for_target(const Glib::RefPtr<QueryTarget>& target) const
{
  return const_cast<Query*>(this)->get_first_field_for_target(target);
}

Glib::SListHandle<Glib::RefPtr<QueryField> > Query::expand_all_field(const Glib::RefPtr<QueryTarget>& target)
{
  return Glib::SListHandle<Glib::RefPtr<QueryField> >(gda_query_expand_all_field(gobj(), Glib::unwrap(target)), Glib::OWNERSHIP_SHALLOW);
}

void Query::order_fields_using_join_conds()
{
gda_query_order_fields_using_join_conds(gobj()); 
}

Glib::SListHandle<Glib::RefPtr<QueryField> > Query::get_fields_by_target(const Glib::RefPtr<QueryTarget>& target, bool visible_fields_only)
{
  return Glib::SListHandle<Glib::RefPtr<QueryField> >(gda_query_get_fields_by_target(gobj(), Glib::unwrap(target), static_cast<int>(visible_fields_only)), Glib::OWNERSHIP_SHALLOW);
}

Glib::SListHandle<Glib::RefPtr<const QueryField> > Query::get_fields_by_target(const Glib::RefPtr<QueryTarget>& target, bool visible_fields_only) const
{
  return Glib::SListHandle<Glib::RefPtr<const QueryField> >(gda_query_get_fields_by_target(const_cast<GdaQuery*>(gobj()), Glib::unwrap(target), static_cast<int>(visible_fields_only)), Glib::OWNERSHIP_SHALLOW);
}


Glib::SignalProxy0< void > Query::signal_type_changed()
{
  return Glib::SignalProxy0< void >(this, &Query_signal_type_changed_info);
}


Glib::SignalProxy0< void > Query::signal_condition_changed()
{
  return Glib::SignalProxy0< void >(this, &Query_signal_condition_changed_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<QueryTarget>& > Query::signal_target_added()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<QueryTarget>& >(this, &Query_signal_target_added_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<QueryTarget>& > Query::signal_target_removed()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<QueryTarget>& >(this, &Query_signal_target_removed_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<QueryTarget>& > Query::signal_target_updated()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<QueryTarget>& >(this, &Query_signal_target_updated_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<QueryJoin>& > Query::signal_join_added()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<QueryJoin>& >(this, &Query_signal_join_added_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<QueryJoin>& > Query::signal_join_removed()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<QueryJoin>& >(this, &Query_signal_join_removed_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<QueryJoin>& > Query::signal_join_updated()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<QueryJoin>& >(this, &Query_signal_join_updated_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<Query>& > Query::signal_sub_query_added()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<Query>& >(this, &Query_signal_sub_query_added_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<Query>& > Query::signal_sub_query_removed()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<Query>& >(this, &Query_signal_sub_query_removed_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<Query>& > Query::signal_sub_query_updated()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<Query>& >(this, &Query_signal_sub_query_updated_info);
}


#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Gnome::Gda::Query::on_type_changed()
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->type_changed)
    (*base->type_changed)(gobj());
}
void Gnome::Gda::Query::on_condition_changed()
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->condition_changed)
    (*base->condition_changed)(gobj());
}
void Gnome::Gda::Query::on_target_added(const Glib::RefPtr<QueryTarget>& target)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->target_added)
    (*base->target_added)(gobj(),Glib::unwrap(target));
}
void Gnome::Gda::Query::on_target_removed(const Glib::RefPtr<QueryTarget>& target)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->target_removed)
    (*base->target_removed)(gobj(),Glib::unwrap(target));
}
void Gnome::Gda::Query::on_target_updated(const Glib::RefPtr<QueryTarget>& target)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->target_updated)
    (*base->target_updated)(gobj(),Glib::unwrap(target));
}
void Gnome::Gda::Query::on_join_added(const Glib::RefPtr<QueryJoin>& join)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->join_added)
    (*base->join_added)(gobj(),Glib::unwrap(join));
}
void Gnome::Gda::Query::on_join_removed(const Glib::RefPtr<QueryJoin>& join)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->join_removed)
    (*base->join_removed)(gobj(),Glib::unwrap(join));
}
void Gnome::Gda::Query::on_join_updated(const Glib::RefPtr<QueryJoin>& join)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->join_updated)
    (*base->join_updated)(gobj(),Glib::unwrap(join));
}
void Gnome::Gda::Query::on_sub_query_added(const Glib::RefPtr<Query>& query)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->sub_query_added)
    (*base->sub_query_added)(gobj(),Glib::unwrap(query));
}
void Gnome::Gda::Query::on_sub_query_removed(const Glib::RefPtr<Query>& query)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->sub_query_removed)
    (*base->sub_query_removed)(gobj(),Glib::unwrap(query));
}
void Gnome::Gda::Query::on_sub_query_updated(const Glib::RefPtr<Query>& query)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->sub_query_updated)
    (*base->sub_query_updated)(gobj(),Glib::unwrap(query));
}
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED


} // namespace Gda

} // namespace Gnome


