// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _LIBGDAMM_DATAMODELITER_H
#define _LIBGDAMM_DATAMODELITER_H


#include <glibmm.h>

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

/* datamodeliter.h
 *
 * 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 <glibmm/object.h>
#include <libgdamm/parameterlist.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GdaDataModelIter GdaDataModelIter;
typedef struct _GdaDataModelIterClass GdaDataModelIterClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{ class DataModelIter_Class; } // namespace Gda

} // namespace Gnome
namespace Gnome
{

namespace Gda
{

class DataModelIterError : public Glib::Error
{
public:
  enum Code
  {
    DATA_MODEL_ITER_WHAT_ERROR
  };

  DataModelIterError(Code error_code, const Glib::ustring& error_message);
  explicit DataModelIterError(GError* gobject);
  Code code() const;

#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:

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

  friend void wrap_init(); // uses throw_func()
#endif
};

} // namespace Gda

} // namespace Gnome

#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::Gda::DataModelIterError::Code> : public Glib::Value_Enum<Gnome::Gda::DataModelIterError::Code>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{


// TODO

class DataModelIter
 : public ParameterList
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef DataModelIter CppObjectType;
  typedef DataModelIter_Class CppClassType;
  typedef GdaDataModelIter BaseObjectType;
  typedef GdaDataModelIterClass BaseClassType;

private:  friend class DataModelIter_Class;
  static CppClassType datamodeliter_class_;

private:
  // noncopyable
  DataModelIter(const DataModelIter&);
  DataModelIter& operator=(const DataModelIter&);

protected:
  explicit DataModelIter(const Glib::ConstructParams& construct_params);
  explicit DataModelIter(GdaDataModelIter* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
  virtual ~DataModelIter();

#ifndef DOXYGEN_SHOULD_SKIP_THIS
  static GType get_type()      G_GNUC_CONST;
  static GType get_base_type() G_GNUC_CONST;
#endif

  ///Provides access to the underlying C GObject.
  GdaDataModelIter*       gobj()       { return reinterpret_cast<GdaDataModelIter*>(gobject_); }

  ///Provides access to the underlying C GObject.
  const GdaDataModelIter* gobj() const { return reinterpret_cast<GdaDataModelIter*>(gobject_); }

  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  GdaDataModelIter* gobj_copy();

private:

protected:
  explicit DataModelIter(const Glib::RefPtr<DataModel>& data_model);

public:
  
  static Glib::RefPtr<DataModelIter> create(const Glib::RefPtr<DataModel>& data_model);


  /** Tells if @a iter is a valid iterator (if it actually corresponds to a valid row in the model)
   * @return <tt>true</tt> if @a iter is valid.
   */
  bool is_valid() const;
  
  /** Synchronizes the values of the parameters in @a iter with the values at the @a row row
   * 
   * If @a row &lt; 0 then @a iter is not bound to any row of the data model it iters through.
   * @param row The row to set @a iter to.
   * @return <tt>true</tt> if no error occurred.
   */
  bool set_at_row(int row);
  
  /** Moves @a iter one row further than where it already is (synchronizes the values of the parameters in @a iter 
   * with the values at the new row).
   * @return <tt>true</tt> if no error occurred.
   */
  bool move_next();
  
  /** Moves @a iter one row before where it already is (synchronizes the values of the parameters in @a iter 
   * with the values at the new row).
   * @return <tt>true</tt> if no error occurred.
   */
  bool move_prev();
  
  /** Get the row which @a iter represents in the data model
   * @return The row number, or -1 if not available.
   */
  int get_row() const;
  
  /** Declare all the parameters in @a iter invalid, without modifying the
   * Gda::DataModel @a iter is for or changing the row it represents
   */
  void invalidate_contents();
  
  /** Get the column number in the Gda::DataModel for which @a iter is an iterator as
   * represented by the @a param parameter
   * @param param A Gda::Parameter object, listed in @a iter.
   * @return The column number, or @a param is not valid.
   */
  int get_column_for_param(const Glib::RefPtr<Parameter>& param);
  
  /** Fetch a pointer to the Gda::Parameter object which is synchronized with data at 
   * column @a col
   * @param col The requested column.
   * @return The Gda::Parameter, or <tt>0</tt> if an error occurred.
   */
  Glib::RefPtr<Parameter> get_param_for_column(int col);
  
  /** Fetch a pointer to the Gda::Parameter object which is synchronized with data at 
   * column @a col
   * @param col The requested column.
   * @return The Gda::Parameter, or <tt>0</tt> if an error occurred.
   */
  Glib::RefPtr<const Parameter> get_param_for_column(int col) const;

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** 
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy<int> property_current_row() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** 
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly<int> property_current_row() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** 
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> > property_data_model() const;
#endif //#GLIBMM_PROPERTIES_ENABLED


  #ifdef GLIBMM_PROPERTIES_ENABLED
/** 
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< Glib::RefPtr<DataModel> > property_forced_model() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** 
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> > property_forced_model() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** 
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy<bool> property_update_model() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** 
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly<bool> property_update_model() const;
#endif //#GLIBMM_PROPERTIES_ENABLED


  /**
   * @par Prototype:
   * <tt>void on_my_%end_of_data()</tt>
   */

  Glib::SignalProxy0< void > signal_end_of_data();

  
  /**
   * @par Prototype:
   * <tt>void on_my_%row_changed(int row)</tt>
   */

  Glib::SignalProxy1< void,int > signal_row_changed();


public:

public:
  //C++ methods used to invoke GTK+ virtual functions:
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

protected:
  //GTK+ Virtual Functions (override these to change behaviour):
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

  //Default Signal Handlers::
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
  virtual void on_end_of_data();
  virtual void on_row_changed(int row);
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


};

} // namespace Gda
} // namespace Gnome


namespace Glib
{
  /** A Glib::wrap() method for this object.
   * 
   * @param object The C instance.
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
   * @result A C++ instance that wraps this C instance.
   *
   * @relates Gnome::Gda::DataModelIter
   */
  Glib::RefPtr<Gnome::Gda::DataModelIter> wrap(GdaDataModelIter* object, bool take_copy = false);
}


#endif /* _LIBGDAMM_DATAMODELITER_H */

