// Generated by gmmproc 2.38.1 -- DO NOT MODIFY!


#include <glibmm.h>

#include <libgdamm/dataselect.h>
#include <libgdamm/private/dataselect_p.h>


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

/* dataselect.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-data-select.h>
#include <libgdamm/connection.h>

namespace Gnome
{

namespace Gda
{

} /* namespace Gda */

} /* namespace Gnome */


namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gnome::Gda::DataSelect> wrap(GdaDataSelect* object, bool take_copy)
{
  return Glib::RefPtr<Gnome::Gda::DataSelect>( dynamic_cast<Gnome::Gda::DataSelect*> (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& DataSelect_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_ = &DataSelect_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_data_select_get_type());

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

  }

  return *this;
}


void DataSelect_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* DataSelect_Class::wrap_new(GObject* object)
{
  return new DataSelect((GdaDataSelect*)object);
}


/* The implementation: */

GdaDataSelect* DataSelect::gobj_copy()
{
  reference();
  return gobj();
}

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

}

DataSelect::DataSelect(GdaDataSelect* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


DataSelect::~DataSelect()
{}


DataSelect::CppClassType DataSelect::dataselect_class_; // initialize static member

GType DataSelect::get_type()
{
  return dataselect_class_.init().get_type();
}


GType DataSelect::get_base_type()
{
  return gda_data_select_get_type();
}


bool DataSelect::set_row_selection_condition_sql(const Glib::ustring& sql_where)
{
  GError* gerror = 0;
  bool retvalue = gda_data_select_set_row_selection_condition_sql(gobj(), sql_where.c_str(), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

void DataSelect::compute_row_selection_condition()
{
  GError* gerror = 0;
  gda_data_select_compute_row_selection_condition(gobj(), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
}

void DataSelect::set_modification_statement(const Glib::RefPtr<Statement>& mod_stmt)
{
  GError* gerror = 0;
  gda_data_select_set_modification_statement(gobj(), Glib::unwrap(mod_stmt), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
}

void DataSelect::set_modification_statement_sql(const Glib::ustring& sql)
{
  GError* gerror = 0;
  gda_data_select_set_modification_statement_sql(gobj(), sql.c_str(), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
}

void DataSelect::compute_modification_statements()
{
  GError* gerror = 0;
  gda_data_select_compute_modification_statements(gobj(), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
}

void DataSelect::compute_columns_attributes()
{
  GError* gerror = 0;
  gda_data_select_compute_columns_attributes(gobj(), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
}

Glib::RefPtr<Connection> DataSelect::get_connection()
{
  return Glib::wrap(gda_data_select_get_connection(gobj()));
}

void DataSelect::rerun()
{
  GError* gerror = 0;
  gda_data_select_rerun(gobj(), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< bool > DataSelect::property_auto_reset() 
{
  return Glib::PropertyProxy< bool >(this, "auto-reset");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< bool > DataSelect::property_auto_reset() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "auto-reset");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< bool > DataSelect::property_store_all_rows() 
{
  return Glib::PropertyProxy< bool >(this, "store-all-rows");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< bool > DataSelect::property_store_all_rows() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "store-all-rows");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Connection> > DataSelect::property_connection() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Connection> >(this, "connection");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Statement> > DataSelect::property_delete_stmt() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Statement> >(this, "delete-stmt");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> > DataSelect::property_delete_stmt() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> >(this, "delete-stmt");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Statement> > DataSelect::property_insert_stmt() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Statement> >(this, "insert-stmt");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> > DataSelect::property_insert_stmt() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> >(this, "insert-stmt");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Statement> > DataSelect::property_prepared_stmt() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Statement> >(this, "prepared-stmt");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> > DataSelect::property_prepared_stmt() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> >(this, "prepared-stmt");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<Statement> > DataSelect::property_update_stmt() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Statement> >(this, "update-stmt");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> > DataSelect::property_update_stmt() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> >(this, "update-stmt");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Set> > DataSelect::property_exec_params() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Set> >(this, "exec-params");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< guint > DataSelect::property_model_usage() const
{
  return Glib::PropertyProxy_ReadOnly< guint >(this, "model-usage");
}
#endif //GLIBMM_PROPERTIES_ENABLED


} // namespace Gda

} // namespace Gnome


