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

#include <glibmm.h>

/* $Id: treestore.hg,v 1.30 2002/12/23 19:09:03 daniel Exp $ */

/* Copyright(C) 1998-2002 The gtkmm 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 <gtkmm/treeiter.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treesortable.h>
#include <gtkmm/treedragdest.h>
#include <gtkmm/treedragsource.h>
// We couldn't include it in treemodel.h, but doing it here makes it easier for people.
#include <gtkmm/treepath.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GtkTreeStore GtkTreeStore;
typedef struct _GtkTreeStoreClass GtkTreeStoreClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gtk
{ class TreeStore_Class; } // namespace Gtk
namespace Gtk
{

/**
 * @ingroup TreeView
 */

class TreeStore :
  public Glib::Object,
  public Gtk::TreeModel,
  public TreeSortable,
  public TreeDragSource,
  public TreeDragDest
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef TreeStore CppObjectType;
  typedef TreeStore_Class CppClassType;
  typedef GtkTreeStore BaseObjectType;
  typedef GtkTreeStoreClass BaseClassType;

private:  friend class TreeStore_Class;
  static CppClassType treestore_class_;

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

protected:
  explicit TreeStore(const Glib::ConstructParams& construct_params);
  explicit TreeStore(GtkTreeStore* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
  virtual ~TreeStore();

#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.
  GtkTreeStore*       gobj()       { return reinterpret_cast<GtkTreeStore*>(gobject_); }

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

  GtkTreeStore* gobj_copy();

private:

  
protected:
  explicit TreeStore(const TreeModelColumnRecord& columns);

public:
  
  static Glib::RefPtr<TreeStore> create(const TreeModelColumnRecord& columns);


  iterator erase(const iterator& iter);
  iterator insert(const iterator& iter);

  iterator prepend();
  iterator prepend(const TreeNodeChildren& node);

  iterator append();
  iterator append(const TreeNodeChildren& node);

  
  /** Swaps @a a  and @a b  in the same level of @a tree_store . Note that this function
   * only works with unsorted stores.
   * 
   * Since: 2.2
   * @param a A Gtk::TreeIter.
   * @param b Another Gtk::TreeIter.
   */
  void iter_swap(const iterator& a, const iterator& b);

  /** Moves @a source to the position at @a destination.
   * @a source and @a destination should be at the same level.
   * Note that this function only works with unsorted stores.
   * @param source The row that should be moved.
   * @param destination The position to move to.
   */
  void move(const iterator& source, const iterator& destination);

  /** Reorders the children of @a node to follow the order indicated by @a new_order.
   * Note that this function only works with unsorted stores.
   */
  void reorder(const TreeNodeChildren& node, const Glib::ArrayHandle<int>& new_order);

  
  /** Removes all rows from @a tree_store 
   */
  void clear();
  
  /** Returns <tt>true</tt> if @a iter  is an ancestor of @a descendant .  That is, @a iter  is the
   * parent (or grandparent or great-grandparent) of @a descendant .
   * @param iter A valid Gtk::TreeIter.
   * @param descendant A valid Gtk::TreeIter.
   * @return <tt>true</tt>, if @a iter  is an ancestor of @a descendant .
   */
  bool is_ancestor(const iterator& iter, const iterator& descendant) const;
  
  /** Returns the depth of @a iter .  This will be 0 for anything on the root level, 1
   * for anything down a level, etc.
   * @param iter A valid Gtk::TreeIter.
   * @return The depth of @a iter .
   */
  int iter_depth(const iterator& iter) const;

  
  /** WARNING: This function is slow. Only use it for debugging and/or testing
   * purposes.
   * 
   * Checks if the given iter is a valid iter for this Gtk::TreeStore.
   * @param iter A Gtk::TreeIter.
   * @return <tt>true</tt> if the iter is valid, <tt>false</tt> if the iter is invalid.
   * 
   * Since: 2.2.
   */
  bool iter_is_valid(const iterator& iter) const;

protected:
  virtual void set_value_impl(const iterator& row, int column, const Glib::ValueBase& value);
  

public:

public:
  //C++ methods used to invoke GTK+ virtual functions:

protected:
  //GTK+ Virtual Functions (override these to change behaviour):

  //Default Signal Handlers::


};

} // namespace Gtk


namespace Glib
{
  /** @relates Gtk::TreeStore */
  Glib::RefPtr<Gtk::TreeStore> wrap(GtkTreeStore* object, bool take_copy = false);
}


#endif /* _GTKMM_TREESTORE_H */

