// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgdamm/dataproxy.h>
#include <libgdamm/private/dataproxy_p.h>

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

/* dataproxy.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-data-proxy.h>
#include <libgdamm/dataproxy.h>

namespace Gnome
{

namespace Gda
{

ValueSList DataProxy::get_values(int proxy_row, const Glib::ArrayHandle<int>& cols_index) const
{
  return ValueSList(gda_data_proxy_get_values(const_cast<GdaDataProxy*>(gobj()), proxy_row, const_cast<gint*>(cols_index.data()), cols_index.size()), Glib::OWNERSHIP_SHALLOW);
}

} /* namespace Gda */

} /* namespace Gnome */


namespace
{


static void DataProxy_signal_row_delete_changed_callback(GdaDataProxy* self, gint p0,gboolean p1,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,int,bool > 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))(p0
, p1
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo DataProxy_signal_row_delete_changed_info =
{
  "row-delete-changed",
  (GCallback) &DataProxy_signal_row_delete_changed_callback,
  (GCallback) &DataProxy_signal_row_delete_changed_callback
};


static void DataProxy_signal_sample_changed_callback(GdaDataProxy* self, gint p0,gint p1,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,int,int > 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))(p0
, p1
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo DataProxy_signal_sample_changed_info =
{
  "sample-changed",
  (GCallback) &DataProxy_signal_sample_changed_callback,
  (GCallback) &DataProxy_signal_sample_changed_callback
};


static void DataProxy_signal_sample_size_changed_callback(GdaDataProxy* self, gint p0,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,int > 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))(p0
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo DataProxy_signal_sample_size_changed_info =
{
  "sample-size-changed",
  (GCallback) &DataProxy_signal_sample_size_changed_callback,
  (GCallback) &DataProxy_signal_sample_size_changed_callback
};


static gboolean DataProxy_signal_pre_changes_applied_callback(GdaDataProxy* self, gint p0,gint p1,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< bool,int,int > 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))
        return static_cast<int>((*static_cast<SlotType*>(slot))(p0
, p1
));
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef gboolean RType;
  return RType();
}

static gboolean DataProxy_signal_pre_changes_applied_notify_callback(GdaDataProxy* self, gint p0,gint p1, void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,int,int > 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))(p0
, p1
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }

  typedef gboolean RType;
  return RType();
}

static const Glib::SignalProxyInfo DataProxy_signal_pre_changes_applied_info =
{
  "pre-changes-applied",
  (GCallback) &DataProxy_signal_pre_changes_applied_callback,
  (GCallback) &DataProxy_signal_pre_changes_applied_notify_callback
};


static void DataProxy_signal_post_changes_applied_callback(GdaDataProxy* self, gint p0,gint p1,void* data)
{
  using namespace Gnome::Gda;
  typedef sigc::slot< void,int,int > 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))(p0
, p1
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo DataProxy_signal_post_changes_applied_info =
{
  "post-changes-applied",
  (GCallback) &DataProxy_signal_post_changes_applied_callback,
  (GCallback) &DataProxy_signal_post_changes_applied_callback
};


} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gnome::Gda::DataProxy> wrap(GdaDataProxy* object, bool take_copy)
{
  return Glib::RefPtr<Gnome::Gda::DataProxy>( dynamic_cast<Gnome::Gda::DataProxy*> (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& DataProxy_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_ = &DataProxy_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_proxy_get_type());

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

  }

  return *this;
}

void DataProxy_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->row_delete_changed = &row_delete_changed_callback;
  klass->sample_changed = &sample_changed_callback;
  klass->sample_size_changed = &sample_size_changed_callback;
  klass->pre_changes_applied = &pre_changes_applied_callback;
  klass->post_changes_applied = &post_changes_applied_callback;
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
}

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void DataProxy_Class::row_delete_changed_callback(GdaDataProxy* self, gint p0, gboolean p1)
{
  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_row_delete_changed(p0
, p1
);
        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->row_delete_changed)
    (*base->row_delete_changed)(self, p0, p1);
}
void DataProxy_Class::sample_changed_callback(GdaDataProxy* self, gint p0, gint p1)
{
  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_sample_changed(p0
, p1
);
        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->sample_changed)
    (*base->sample_changed)(self, p0, p1);
}
void DataProxy_Class::sample_size_changed_callback(GdaDataProxy* self, gint 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_sample_size_changed(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->sample_size_changed)
    (*base->sample_size_changed)(self, p0);
}
gboolean DataProxy_Class::pre_changes_applied_callback(GdaDataProxy* self, gint p0, gint p1)
{
  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.
        return static_cast<int>(obj->on_pre_changes_applied(p0
, p1
));
      #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->pre_changes_applied)
    return (*base->pre_changes_applied)(self, p0, p1);

  typedef gboolean RType;
  return RType();
}
void DataProxy_Class::post_changes_applied_callback(GdaDataProxy* self, gint p0, gint p1)
{
  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_post_changes_applied(p0
, p1
);
        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->post_changes_applied)
    (*base->post_changes_applied)(self, p0, p1);
}
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


Glib::ObjectBase* DataProxy_Class::wrap_new(GObject* object)
{
  return new DataProxy((GdaDataProxy*)object);
}


/* The implementation: */

GdaDataProxy* DataProxy::gobj_copy()
{
  reference();
  return gobj();
}

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

}

DataProxy::DataProxy(GdaDataProxy* castitem)
:
  Object((GdaObject*)(castitem))
{}

DataProxy::~DataProxy()
{}


DataProxy::CppClassType DataProxy::dataproxy_class_; // initialize static member

GType DataProxy::get_type()
{
  return dataproxy_class_.init().get_type();
}

GType DataProxy::get_base_type()
{
  return gda_data_proxy_get_type();
}


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

}

Glib::RefPtr<DataProxy> DataProxy::create(const Glib::RefPtr<DataModel>& model)
{
  return Glib::RefPtr<DataProxy>( new DataProxy(model) );
}
Glib::RefPtr<DataModel> DataProxy::get_proxied_model()
{

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

}

Glib::RefPtr<const DataModel> DataProxy::get_proxied_model() const
{
  return const_cast<DataProxy*>(this)->get_proxied_model();
}

int DataProxy::get_proxied_model_n_cols() const
{
  return gda_data_proxy_get_proxied_model_n_cols(const_cast<GdaDataProxy*>(gobj()));
}

int DataProxy::get_proxied_model_n_rows() const
{
  return gda_data_proxy_get_proxied_model_n_rows(const_cast<GdaDataProxy*>(gobj()));
}

bool DataProxy::is_read_only() const
{
  return gda_data_proxy_is_read_only(const_cast<GdaDataProxy*>(gobj()));
}

ValueAttribute DataProxy::get_value_attributes(int proxy_row, int col) const
{
  return ((ValueAttribute)(gda_data_proxy_get_value_attributes(const_cast<GdaDataProxy*>(gobj()), proxy_row, col)));
}

void DataProxy::alter_value_attributes(int proxy_row, int col, ValueAttribute alter_flags)
{
gda_data_proxy_alter_value_attributes(gobj(), proxy_row, col, ((GdaValueAttribute)(alter_flags))); 
}

int DataProxy::get_proxied_model_row(int proxy_row) const
{
  return gda_data_proxy_get_proxied_model_row(const_cast<GdaDataProxy*>(gobj()), proxy_row);
}

void DataProxy::erase(int proxy_row)
{
gda_data_proxy_delete(gobj(), proxy_row); 
}

void DataProxy::unerase(int proxy_row)
{
gda_data_proxy_undelete(gobj(), proxy_row); 
}

bool DataProxy::row_is_deleted(int proxy_row) const
{
  return gda_data_proxy_row_is_deleted(const_cast<GdaDataProxy*>(gobj()), proxy_row);
}

bool DataProxy::row_is_inserted(int proxy_row) const
{
  return gda_data_proxy_row_is_inserted(const_cast<GdaDataProxy*>(gobj()), proxy_row);
}

int DataProxy::find_row_from_values(const ValueSList& values, const Glib::ArrayHandle<int>& cols_index) const
{
  return gda_data_proxy_find_row_from_values(const_cast<GdaDataProxy*>(gobj()), (values).data(), const_cast<gint*>((cols_index).data()));
}

void DataProxy::cancel_row_changes(int proxy_row, int col)
{
gda_data_proxy_cancel_row_changes(gobj(), proxy_row, col); 
}

#ifdef GLIBMM_EXCEPTIONS_ENABLED
void DataProxy::apply_row_changes(int proxy_row)
#else
void DataProxy::apply_row_changes(int proxy_row, std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
  GError* gerror = 0;
  gda_data_proxy_apply_row_changes(gobj(), proxy_row, &(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


}

bool DataProxy::has_changed() const
{
  return gda_data_proxy_has_changed(const_cast<GdaDataProxy*>(gobj()));
}

bool DataProxy::row_has_changed(int proxy_row) const
{
  return gda_data_proxy_row_has_changed(const_cast<GdaDataProxy*>(gobj()), proxy_row);
}

int DataProxy::get_n_new_rows() const
{
  return gda_data_proxy_get_n_new_rows(const_cast<GdaDataProxy*>(gobj()));
}

int DataProxy::get_n_modified_rows() const
{
  return gda_data_proxy_get_n_modified_rows(const_cast<GdaDataProxy*>(gobj()));
}

void DataProxy::set_sample_size(int sample_size)
{
gda_data_proxy_set_sample_size(gobj(), sample_size); 
}

int DataProxy::get_sample_size() const
{
  return gda_data_proxy_get_sample_size(const_cast<GdaDataProxy*>(gobj()));
}

void DataProxy::set_sample_start(int sample_start)
{
gda_data_proxy_set_sample_start(gobj(), sample_start); 
}

int DataProxy::get_sample_start() const
{
  return gda_data_proxy_get_sample_start(const_cast<GdaDataProxy*>(gobj()));
}

int DataProxy::get_sample_end() const
{
  return gda_data_proxy_get_sample_end(const_cast<GdaDataProxy*>(gobj()));
}

#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool DataProxy::apply_all_changes()
#else
bool DataProxy::apply_all_changes(std::auto_ptr<Glib::Error>& error)
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
  GError* gerror = 0;
  bool retvalue = gda_data_proxy_apply_all_changes(gobj(), &(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;

}

bool DataProxy::cancel_all_changes()
{
  return gda_data_proxy_cancel_all_changes(gobj());
}


Glib::SignalProxy2< void,int,bool > DataProxy::signal_row_delete_changed()
{
  return Glib::SignalProxy2< void,int,bool >(this, &DataProxy_signal_row_delete_changed_info);
}


Glib::SignalProxy2< void,int,int > DataProxy::signal_sample_changed()
{
  return Glib::SignalProxy2< void,int,int >(this, &DataProxy_signal_sample_changed_info);
}


Glib::SignalProxy1< void,int > DataProxy::signal_sample_size_changed()
{
  return Glib::SignalProxy1< void,int >(this, &DataProxy_signal_sample_size_changed_info);
}


Glib::SignalProxy2< bool,int,int > DataProxy::signal_pre_changes_applied()
{
  return Glib::SignalProxy2< bool,int,int >(this, &DataProxy_signal_pre_changes_applied_info);
}


Glib::SignalProxy2< void,int,int > DataProxy::signal_post_changes_applied()
{
  return Glib::SignalProxy2< void,int,int >(this, &DataProxy_signal_post_changes_applied_info);
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< Glib::RefPtr<DataModel> > DataProxy::property_model() 
{
  return Glib::PropertyProxy< Glib::RefPtr<DataModel> >(this, "model");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> > DataProxy::property_model() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> >(this, "model");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<bool> DataProxy::property_prepend_null_entry() 
{
  return Glib::PropertyProxy<bool>(this, "prepend-null-entry");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<bool> DataProxy::property_prepend_null_entry() const
{
  return Glib::PropertyProxy_ReadOnly<bool>(this, "prepend-null-entry");
}
#endif //GLIBMM_PROPERTIES_ENABLED


#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Gnome::Gda::DataProxy::on_row_delete_changed(int row, bool to_be_deleted)
{
  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->row_delete_changed)
    (*base->row_delete_changed)(gobj(),row,static_cast<int>(to_be_deleted));
}
void Gnome::Gda::DataProxy::on_sample_changed(int sample_start, int sample_end)
{
  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->sample_changed)
    (*base->sample_changed)(gobj(),sample_start,sample_end);
}
void Gnome::Gda::DataProxy::on_sample_size_changed(int sample_size)
{
  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->sample_size_changed)
    (*base->sample_size_changed)(gobj(),sample_size);
}
bool Gnome::Gda::DataProxy::on_pre_changes_applied(int row, int proxied_row)
{
  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->pre_changes_applied)
    return (*base->pre_changes_applied)(gobj(),row,proxied_row);

  typedef bool RType;
  return RType();
}
void Gnome::Gda::DataProxy::on_post_changes_applied(int row, int proxied_row)
{
  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->post_changes_applied)
    (*base->post_changes_applied)(gobj(),row,proxied_row);
}
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED


} // namespace Gda

} // namespace Gnome


