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

#include <glibmm.h>

// -*- C++ -*- // this is for the .hg, I realize gensig puts one in
/* $Id: icon-list.hg,v 1.18 2004/06/06 21:13:08 murrayc Exp $ */

/* icon-list.hg
 * 
 * Copyright (C) 1998 EMC Capital Management Inc.
 * Developed by Havoc Pennington <hp@pobox.com>
 *
 * Copyright (C) 1999 The Gtk-- 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 <libgnomeuimm/icon-textitem.h>
#include <libgnomecanvasmm/canvas.h>
#include <libgnomecanvasmm/pixbuf.h>
#include <gtkmm/container.h>
#include <glibmm/helperlist.h>
#include <libgnomeui/gnome-icon-list.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GnomeIconList GnomeIconList;
typedef struct _GnomeIconListClass GnomeIconListClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace UI
{ class IconList_Class; } // namespace UI

} // namespace Gnome
namespace Gnome
{

namespace UI
{

namespace IconList_Helpers
{

 
class SelectionList : public Glib::HelperList< int, int, Glib::List_Iterator< int > >
{
public:
  SelectionList();
  explicit SelectionList(GnomeIconList* gparent);
  SelectionList(const SelectionList& src);
  virtual ~SelectionList() {}

  SelectionList& operator=(const SelectionList& src);

  typedef Glib::HelperList< int, int,  Glib::List_Iterator< int > > type_base;

  GnomeIconList* gparent();
  const GnomeIconList* gparent() const;

  virtual GList*& glist() const;      // front of list

  virtual void erase(iterator start, iterator stop);
  virtual iterator erase(iterator);  //Implented as custom or by LIST_CONTAINER_REMOVE
  virtual void remove(const_reference); //Implented as custom or by LIST_CONTAINER_REMOVE

  /// This is order n. (use at own risk)
  reference operator[](size_type l) const;

public:
  iterator insert(iterator position, element_type& e); //custom-implemented.

  template <class InputIterator>
  inline void insert(iterator position, InputIterator first, InputIterator last)
  {
    for(;first != last; ++first)
      position = insert(position, *first);
  }

 inline void push_front(element_type& e)
    { insert(begin(), e); }
  inline void push_back(element_type& e)
    { insert(end(), e); }


protected:
  mutable GList* glist_;
  };


} /* namespace IconList_Helpers */


class Group;


class IconList : public Gnome::Canvas::Canvas
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  typedef IconList CppObjectType;
  typedef IconList_Class CppClassType;
  typedef GnomeIconList BaseObjectType;
  typedef GnomeIconListClass BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

  virtual ~IconList();

#ifndef DOXYGEN_SHOULD_SKIP_THIS

private:
  friend class IconList_Class;
  static CppClassType iconlist_class_;

  // noncopyable
  IconList(const IconList&);
  IconList& operator=(const IconList&);

protected:
  explicit IconList(const Glib::ConstructParams& construct_params);
  explicit IconList(GnomeIconList* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

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

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


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

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

  //Default Signal Handlers::
  virtual void on_select_icon(int num, GdkEvent* event);
  virtual void on_unselect_icon(int num, GdkEvent* event);
  virtual void on_focus_icon(int num);
  virtual bool on_text_changed(int num, const char* new_text);
  virtual void on_move_cursor(Gtk::DirectionType dir, bool clear_selection);
  virtual void on_toggle_cursor_selection();


private:

  
public:
  //TODO: add missing ctor args
  explicit IconList(guint icon_width = 80, bool is_editable = false);

  
  void set_hadjustment(Gtk::Adjustment& hadj);
  
  void set_vadjustment(Gtk::Adjustment& vadj);
  
  void freeze();
  
  void thaw();
  
  void insert(int pos, const Glib::ustring& icon_filename, const Glib::ustring& text);
  
  void insert(int idx, const Glib::RefPtr<Gdk::Pixbuf>& im, const Glib::ustring& icon_filename, const Glib::ustring& text);
  
  int append(const Glib::ustring& icon_filename, const Glib::ustring& text);
  
  int append(const Glib::RefPtr<Gdk::Pixbuf>& im, const Glib::ustring& icon_filename, const Glib::ustring& text);
  
  void clear();
  
  void remove(int pos);
  
  guint get_num_icons() const;
  
  Gtk::SelectionMode get_selection_mode() const;
  
  void set_selection_mode(Gtk::SelectionMode mode);
  
  void select_icon(int idx);
  
  void unselect_icon(int idx);
  
  int select_all();
  
  int unselect_all();
  
  void focus_icon(gint idx);
  
  void set_icon_width (int w);
  
  void set_row_spacing(int spacing);
  
  void set_col_spacing(int spacing);
  
  void set_text_spacing(int spacing);
  
  void set_icon_border(int spacing);
  
  void set_separators(const Glib::ustring& sep);
  
  Glib::ustring get_icon_filename(int idx) const;
  
  int find_icon_from_filename(const Glib::ustring& filename) const;
  
  void set_icon_data(int pos, gpointer data);
  
  
  int find_icon_from_data(gpointer data) const;
  
  gpointer get_icon_data(int pos);
  
  void moveto(int pos, double yalign);
  
  Gtk::Visibility icon_is_visible(int pos);
  
  int get_icon_at(int x, int y) const;
  
  int get_items_per_line() const;

  
  IconTextItem* get_icon_text_item(int idx);
  
  Gnome::Canvas::Pixbuf* get_icon_pixbuf_item(int idx);

  typedef IconList_Helpers::SelectionList SelectionList;
  SelectionList& selection();
  const SelectionList& selection() const;
  

  Glib::SignalProxy2< void,int,GdkEvent* > signal_select_icon();
;
  

  Glib::SignalProxy2< void,int,GdkEvent* > signal_unselect_icon();
;

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

  
  Glib::SignalProxy2< bool,int,const char* > signal_text_changed();
;

	/* Key Binding signals */
	

  Glib::SignalProxy2< void,Gtk::DirectionType,bool > signal_move_cursor();

	
  Glib::SignalProxy0< void > signal_toggle_cursor_selection();


protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  mutable SelectionList selection_proxy_;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


};

} /* namespace UI */
} /* namespace Gnome */

namespace Glib
{
  /** @relates Gnome::UI::IconList
   * @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.
   */
  Gnome::UI::IconList* wrap(GnomeIconList* object, bool take_copy = false);
}
#endif /* _LIBGNOMEUIMM_ICON_LIST_H */

