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


#include <glibmm.h>

/* $Id: datamodelindex.hg,v 1.1 2005/09/10 11:02:10 murrayc Exp $ */
// -*- C++ -*- // this is for the .hg, I realize gensig puts one in

/* datamodel.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/columnindex.h>
#include <libgda/gda-data-model-index.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" { typedef struct _GdaDataModelIndex GdaDataModelIndex; }
#endif

namespace Gnome
{

namespace Gda
{

class Row;

/** Management of DataModel indexes.
 */
class DataModelIndex
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  typedef DataModelIndex CppObjectType;
  typedef GdaDataModelIndex BaseObjectType;

  static GType get_type() G_GNUC_CONST;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

  DataModelIndex();

  explicit DataModelIndex(GdaDataModelIndex* gobject, bool make_a_copy = true);

  DataModelIndex(const DataModelIndex& other);
  DataModelIndex& operator=(const DataModelIndex& other);

  ~DataModelIndex();

  void swap(DataModelIndex& other);

  ///Provides access to the underlying C instance.
  GdaDataModelIndex*       gobj()       { return gobject_; }

  ///Provides access to the underlying C instance.
  const GdaDataModelIndex* gobj() const { return gobject_; }

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

protected:
  GdaDataModelIndex* gobject_;

private:

  
public:

  
   // hmm, seems like gmmproc doesn't know that we used it in _WRAP_EQUAL().

  
  /** 
   * @return The name of @a dmi.
   */
  Glib::ustring get_name() const;
  
  /** Sets the name of @a dmi to @a name.
   * @param name The new name of @a dmi.
   */
  void gda_data_set_name(const Glib::ustring& name);
  
  /** 
   * @return The table name of @a dmi.
   */
  Glib::ustring get_table_name() const;
  
  /** Sets the table name of @a dmi to @a table_name.
   * @param name The new name of @a dmi.
   */
  void set_table_name(const Glib::ustring& name);
  
  /** 
   * @return <tt>true</tt> if primary key.
   */
  bool get_primary_key() const;
  
  /** Sets if a Gda::DataModelIndex is a primary key.
   * @param pk The new primary key setting of @a dmi.
   */
  void set_primary_key(bool pk = true);
  
  /** 
   * @return <tt>true</tt> if unique key.
   */
  bool get_unique_key() const;
  
  /** Sets if a Gda::DataModelIndex is a unique key.
   * @param uk The new primary key setting of @a dmi.
   */
  void set_unique_key(bool uk = true);
  
  /** 
   * @return  @a dmi's references.
   */
  Glib::ustring get_references() const;
  
  /** Sets @a dmi's @a references.
   * @param ref References.
   */
  void set_references(const Glib::ustring& ref);

   
  /** 
   * @return  @a dmi's list of Gda::ColumnIndex.
   */
  Glib::ListHandle<Glib::RefPtr<ColumnIndex> > get_column_index_list();

   
  /** 
   * @return  @a dmi's list of Gda::ColumnIndex.
   */
  Glib::ListHandle<Glib::RefPtr<const ColumnIndex> > get_column_index_list() const;

   
  /** Sets @a dmi's list of column index attributes by
   * copying @a col_idx_list to its internal representation.
   * @param col_idx_list List of Gda::ColumnIndex.
   */
  void set_column_index_list(const Glib::ListHandle<Glib::RefPtr<ColumnIndex> >& col_idx_list);


};

} // namespace Gda
} // namespace Gnome


namespace Gnome
{

namespace Gda
{

/** @relates Gnome::Gda::DataModelIndex
 * @param lhs The left-hand side
 * @param rhs The right-hand side
 * @result The result
 */
bool operator==(const DataModelIndex& lhs, const DataModelIndex& rhs);

/** @relates Gnome::Gda::DataModelIndex
 * @param lhs The left-hand side
 * @param rhs The right-hand side
 * @result The result
 */
bool operator!=(const DataModelIndex& lhs, const DataModelIndex& rhs);


} // namespace Gda

} // namespace Gnome


namespace Gnome
{

namespace Gda
{

/** @relates Gnome::Gda::DataModelIndex
 * @param lhs The left-hand side
 * @param rhs The right-hand side
 */
inline void swap(DataModelIndex& lhs, DataModelIndex& rhs)
  { lhs.swap(rhs); }

} // 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::DataModelIndex
 */
Gnome::Gda::DataModelIndex wrap(GdaDataModelIndex* object, bool take_copy = false);

#ifndef DOXYGEN_SHOULD_SKIP_THIS
template <>
class Value<Gnome::Gda::DataModelIndex> : public Glib::Value_Boxed<Gnome::Gda::DataModelIndex>
{};
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

} // namespace Glib


#endif /* _LIBGDAMM_DATAMODELINDEX_H */

