// -*- c++ -*-
/*  Generated by gensig from tree.gen_h. DO NOT MODIFY!!! */
#ifndef GTKMM_TREE_HEADER
#define GTKMM_TREE_HEADER
/* $Id: tree.gen_h,v 1.33.2.1 1999/03/20 05:00:15 terop Exp $ */

/* tree.h
 * 
 * Copyright (C) 1998-1999 
 *
 * 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 <gtk--/container.h>
#include <gtk/gtktree.h>
class Gtk_TreeItem;
class Gtk_Tree_Class;
#line 25 "tree.gen_h"

class Gtk_Tree : public Gtk_Container {
public:
  // selectioniterator could be bi-directional iterator, but I think it
  // currently only does traversing on one direction. (FIXME)
  typedef G_List_Cpp_Iterator<GtkWidget,Gtk_Widget> selectioniterator;
protected:
  typedef Gtk_Tree_Class    CppClassType;
  typedef GtkTree           BaseObjectType;
  typedef GtkTreeClass      BaseClassType;

  virtual void *get_parent_class();

private:
  friend CppClassType;
  static CppClassType tree_class; 
  GtkType get_type(); 

public:


  Gtk_Tree();
  Gtk_Tree(GtkTree *castitem);

  void append (const Gtk_Widget &widget);

  void prepend(const Gtk_Widget &widget);

  void insert (const Gtk_Widget &widget, gint position);


  void append (const Gtk_ObjectHandle<Gtk_Widget> &widget);

  void prepend(const Gtk_ObjectHandle<Gtk_Widget> &widget);

  void insert (const Gtk_ObjectHandle<Gtk_Widget> &widget, gint position);


  //: beginselection() and endselection() is for traversing
  //: a list of selected items in a tree. STL algorithms should
  //: work with the iterator it returns.
  // you can use the following code to get all widgets
  // from a tree:
  // <pre>
  //   Gtk_Tree *tree = ...
  //   Gtk_Tree::selectioniterator i;
  //   for (i=tree->beginselection();i!=endselection();i++) {
  //      (*i)->show();
  //   }
  // </pre>
  // Here *i is of type Gtk_Widget*.
  // Note! with these routines, you can only see widgets that
  // have a c++ wrapper!
  // CList, CTree and all containers can be browsed with similar
  // loop.
  selectioniterator beginselection() const;
  selectioniterator endselection  () const;

  // This is for getting the first selection.
  // if nothing is selected, it'll return 0.
  Gtk_Widget *getselection() const;

  void clear_items  (gint start, gint end);
  void select_item  (gint item);
  void unselect_item(gint item);

  // How to implement this ?? The underlying GList will contain
  // Gtk_Widgets, not GtkWidgets.
  // a tree can only contain Gtk_TreeItems
  //  void remove_items ( G_List < Gtk_TreeItem > &items );

  // deprecated
  // void remove_item(const Gtk_Widget &child);
  

//   void select_child(Gtk_Widget *child); // signals
//   void unselect_child(Gtk_Widget *child);

  gint child_position(const Gtk_Widget &child) const;
  void set_selection_mode(GtkSelectionMode mode);
  void set_view_mode(GtkTreeViewMode mode);
  void set_view_lines(bool flag);
  
  Signal_proxy0<BaseObjectType> selection_changed;
  Signal_proxy1<BaseObjectType,GtkWidget*> select_child_c;
  Signal_proxy1<BaseObjectType,GtkWidget*> unselect_child_c;
  Signal1<Gtk_Widget*> select_child;
  Signal1<Gtk_Widget*> unselect_child;

protected:
  /* impl functions */
  virtual void selection_changed_impl();
  virtual void select_child_c_impl(GtkWidget* p1);
  virtual void unselect_child_c_impl(GtkWidget* p1);
public:
  GtkTree* gtkobj() { return GTK_TREE(gtkobject); }
  const GtkTree* gtkobj() const { return GTK_TREE(gtkobject); }
  static bool isGtkTree(Gtk_Object *checkcast);
#line 101 "tree.gen_h"

};

#endif
