// Generated by gtkmmproc -- DO NOT MODIFY!


#include <libgda-uimm/basicform.h>
#include <libgda-uimm/private/basicform_p.h>

/* libgda-uimm - a C++ wrapper for libgda-ui
 * 
 * Copyright (c) 2010 libgda-uimm 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-ui/gdaui-basic-form.h>
#include <libgdamm/set.h>
#include <gtkmm/window.h>

namespace Gnome
{

namespace GdaUI
{

} /* namespace GdaUI */

} /* namespace Gnome */

namespace
{


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


static void BasicForm_signal_holder_changed_callback(GdauiBasicForm* self, GdaHolder* p0,gboolean p1,void* data)
{
  using namespace Gnome::GdaUI;
  typedef sigc::slot< void,const Glib::RefPtr<Gnome::Gda::Holder>&,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))(Glib::wrap(p0, true)
, p1
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo BasicForm_signal_holder_changed_info =
{
  "holder-changed",
  (GCallback) &BasicForm_signal_holder_changed_callback,
  (GCallback) &BasicForm_signal_holder_changed_callback
};


static const Glib::SignalProxyInfo BasicForm_signal_layout_changed_info =
{
  "layout-changed",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


} // anonymous namespace


namespace Glib
{

Gnome::GdaUI::BasicForm* wrap(GdauiBasicForm* object, bool take_copy)
{
  return dynamic_cast<Gnome::GdaUI::BasicForm *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}

} /* namespace Glib */

namespace Gnome
{

namespace GdaUI
{


/* The *_Class implementation: */

const Glib::Class& BasicForm_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_ = &BasicForm_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(gdaui_basic_form_get_type());

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

  }

  return *this;
}


void BasicForm_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->activated = &activated_callback;
  klass->holder_changed = &holder_changed_callback;
  klass->layout_changed = &layout_changed_callback;
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
}

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void BasicForm_Class::activated_callback(GdauiBasicForm* 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_activated();
        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->activated)
    (*base->activated)(self);
}
void BasicForm_Class::holder_changed_callback(GdauiBasicForm* self, GdaHolder* 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_holder_changed(Glib::wrap(p0, true)
, 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->holder_changed)
    (*base->holder_changed)(self, p0, p1);
}
void BasicForm_Class::layout_changed_callback(GdauiBasicForm* 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_layout_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->layout_changed)
    (*base->layout_changed)(self);
}
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


Glib::ObjectBase* BasicForm_Class::wrap_new(GObject* o)
{
  return manage(new BasicForm((GdauiBasicForm*)(o)));

}


/* The implementation: */

BasicForm::BasicForm(const Glib::ConstructParams& construct_params)
:
  Gtk::VBox(construct_params)
{
  }

BasicForm::BasicForm(GdauiBasicForm* castitem)
:
  Gtk::VBox((GtkVBox*)(castitem))
{
  }

BasicForm::~BasicForm()
{
  destroy_();
}

BasicForm::CppClassType BasicForm::basicform_class_; // initialize static member

GType BasicForm::get_type()
{
  return basicform_class_.init().get_type();
}


GType BasicForm::get_base_type()
{
  return gdaui_basic_form_get_type();
}


BasicForm::BasicForm(const Glib::RefPtr<Gnome::Gda::Set>& data_set)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Gtk::VBox(Glib::ConstructParams(basicform_class_.init(), "data_set", Glib::unwrap(data_set), static_cast<char*>(0)))
{
  

}

BasicForm::BasicForm(const Glib::RefPtr<Gnome::Gda::Set>& data_set, Gtk::Window* parent, const Glib::ustring& title, const Glib::ustring& header)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Gtk::VBox(Glib::ConstructParams(basicform_class_.init(), "data_set", Glib::unwrap(data_set), "parent", Glib::unwrap(parent), "title", title.c_str(), "header", header.c_str(), static_cast<char*>(0)))
{
  

}

Glib::RefPtr<Gnome::Gda::Set> BasicForm::get_data_set()
{
  return Glib::wrap(gdaui_basic_form_get_data_set(gobj()));
}

Glib::RefPtr<const Gnome::Gda::Set> BasicForm::get_data_set() const
{
  return const_cast<BasicForm*>(this)->get_data_set();
}

bool BasicForm::is_valid() const
{
  return gdaui_basic_form_is_valid(const_cast<GdauiBasicForm*>(gobj()));
}

bool BasicForm::has_changed() const
{
  return gdaui_basic_form_has_changed(const_cast<GdauiBasicForm*>(gobj()));
}

void BasicForm::reset()
{
gdaui_basic_form_reset(gobj()); 
}

void BasicForm::set_as_reference()
{
gdaui_basic_form_set_as_reference(gobj()); 
}

void BasicForm::entry_set_visible(const Glib::RefPtr<Gnome::Gda::Holder>& holder, bool show)
{
gdaui_basic_form_entry_set_visible(gobj(), Glib::unwrap(holder), static_cast<int>(show)); 
}

void BasicForm::entry_grab_focus(const Glib::RefPtr<Gnome::Gda::Holder>& holder)
{
gdaui_basic_form_entry_grab_focus(gobj(), Glib::unwrap(holder)); 
}

void BasicForm::entry_set_editable(const Glib::RefPtr<Gnome::Gda::Holder>& holder, bool editable)
{
gdaui_basic_form_entry_set_editable(gobj(), Glib::unwrap(holder), static_cast<int>(editable)); 
}

void BasicForm::set_entries_to_default()
{
gdaui_basic_form_set_entries_to_default(gobj()); 
}

Gtk::Widget* BasicForm::get_entry_widget(const Glib::RefPtr<Gnome::Gda::Holder>& holder)
{
  return Glib::wrap(gdaui_basic_form_get_entry_widget(gobj(), Glib::unwrap(holder)));
}

const Gtk::Widget* BasicForm::get_entry_widget(const Glib::RefPtr<Gnome::Gda::Holder>& holder) const
{
  return const_cast<BasicForm*>(this)->get_entry_widget(holder);
}

Gtk::Widget* BasicForm::get_label_widget(const Glib::RefPtr<Gnome::Gda::Holder>& holder)
{
  return Glib::wrap(gdaui_basic_form_get_label_widget(gobj(), Glib::unwrap(holder)));
}

const Gtk::Widget* BasicForm::get_label_widget(const Glib::RefPtr<Gnome::Gda::Holder>& holder) const
{
  return const_cast<BasicForm*>(this)->get_label_widget(holder);
}

void BasicForm::set_layout_from_file(const std::string& file_name, const Glib::ustring& form_name)
{
gdaui_basic_form_set_layout_from_file(gobj(), file_name.c_str(), form_name.c_str()); 
}

Gtk::Widget* BasicForm::get_place_holder(const Glib::ustring& placeholder_id)
{
  return Glib::wrap(gdaui_basic_form_get_place_holder(gobj(), placeholder_id.c_str()));
}

const Gtk::Widget* BasicForm::get_place_holder(const Glib::ustring& placeholder_id) const
{
  return Glib::wrap(gdaui_basic_form_get_place_holder(const_cast<GdauiBasicForm*>(gobj()), placeholder_id.c_str()));
}


Glib::SignalProxy0< void > BasicForm::signal_activated()
{
  return Glib::SignalProxy0< void >(this, &BasicForm_signal_activated_info);
}


Glib::SignalProxy2< void,const Glib::RefPtr<Gnome::Gda::Holder>&,bool > BasicForm::signal_holder_changed()
{
  return Glib::SignalProxy2< void,const Glib::RefPtr<Gnome::Gda::Holder>&,bool >(this, &BasicForm_signal_holder_changed_info);
}


Glib::SignalProxy0< void > BasicForm::signal_layout_changed()
{
  return Glib::SignalProxy0< void >(this, &BasicForm_signal_layout_changed_info);
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<bool> BasicForm::property_can_expand() const
{
  return Glib::PropertyProxy_ReadOnly<bool>(this, "can-expand");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<bool> BasicForm::property_entries_auto_default() 
{
  return Glib::PropertyProxy<bool>(this, "entries-auto-default");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<bool> BasicForm::property_entries_auto_default() const
{
  return Glib::PropertyProxy_ReadOnly<bool>(this, "entries-auto-default");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<bool> BasicForm::property_headers_sensitive() 
{
  return Glib::PropertyProxy<bool>(this, "headers-sensitive");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<bool> BasicForm::property_headers_sensitive() const
{
  return Glib::PropertyProxy_ReadOnly<bool>(this, "headers-sensitive");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy<bool> BasicForm::property_show_actions() 
{
  return Glib::PropertyProxy<bool>(this, "show-actions");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly<bool> BasicForm::property_show_actions() const
{
  return Glib::PropertyProxy_ReadOnly<bool>(this, "show-actions");
}
#endif //GLIBMM_PROPERTIES_ENABLED


#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
void Gnome::GdaUI::BasicForm::on_activated()
{
  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->activated)
    (*base->activated)(gobj());
}
void Gnome::GdaUI::BasicForm::on_holder_changed(const Glib::RefPtr<Gnome::Gda::Holder>& holder, bool is_user_modified)
{
  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->holder_changed)
    (*base->holder_changed)(gobj(),Glib::unwrap(holder),static_cast<int>(is_user_modified));
}
void Gnome::GdaUI::BasicForm::on_layout_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->layout_changed)
    (*base->layout_changed)(gobj());
}
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED

#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED


} // namespace GdaUI

} // namespace Gnome


