// -*- c++ -*-
/*  Generated by gensig from clist.gen_h. DO NOT MODIFY!!! */
#ifndef GTKMM_CLIST_HEADER
#define GTKMM_CLIST_HEADER
/* $Id: clist.gen_h,v 1.71.2.6 1999/09/09 17:49:57 tdukes Exp $ */

/* clist.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--/scrollbar.h>
#include <gtk/gtkclist.h>
class Gtk_CList_Class;
#line 25 "clist.gen_h"


//: Multi-column list widget designed to handle very much data without 
//: performance problems
class Gtk_CList : public Gtk_Container
{
public:
  //: iterator for traversing over the rows
  typedef G_List_Iterator<GtkCListRow> iterator;
  //: iterator for traversing through selected items
  typedef G_IntList_Iterator seliterator;

protected:
  typedef Gtk_CList_Class    CppClassType;
  typedef GtkCList           BaseObjectType;
  typedef GtkCListClass      BaseClassType;

  virtual void *get_parent_class();

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

public:

  
  Gtk_CList(int columns, const gchar * titles[] = 0);
#line 41 "clist.gen_h"
  Gtk_CList ( const vector<string> &titles );
#line 43 "clist.gen_h"
  Gtk_CList(GtkCList *castitem);

  //: set the clist's selection mode
  void set_selection_mode(GtkSelectionMode mode);

#line 66 "clist.gen_h"

  //: freeze all visual updates of the list
  //- and then thaw the list after you
  //- have made a number of changes and the updates wil occure in a more
  //- efficent manner than if you made them on a unfrozen list
  void freeze();
  //: thaw the list (see <A HREF="#freeze">freeze</A>)
  void thaw();

  //: show the column title buttons
  void column_titles_show();
  //: hide the column title buttons
  void column_titles_hide();
  //: activate title 
  //- (responds to button presses, prelights, and grabs keyboard focus)
  void column_title_active(gint column);
  //: set the column title to be passive where it acts as just a title
  void column_title_passive(gint column);
  //: set all column titles to be a active 
  //- (respond to button presses, prelight, and grab keyboard focus)
  void column_titles_active();
  //: set all column titles to be passive where they act as just a title
  void column_titles_passive();

  //: set the title in the column title button
  void set_column_title(gint column, const string &title);
  //: set a widget instead of a title for the column title button
  void set_column_widget(gint column, Gtk_Widget &widget);
  //: set a widget instead of a title for the column title button
  void set_column_widget(gint column, const Gtk_ObjectHandle<Gtk_Widget> &widget);

  //: set the justification on a column
  //- valid choices are:
  //- GTK_JUSTIFY_LEFT, GTK_JUSTIFY_RIGHT, GTK_JUSTIFY_CENTER,
  //- GTK_JUSTIFY_FILL
  void set_column_justification(gint column, GtkJustification justification);

  //: set the pixel width of a column
  //- this is a necessary step in
  //- creating a CList because otherwise the column width is chozen from
  //- the width of the column title, which will never be right
  void set_column_width(gint column, gint width);

  //: change the height of one row
  //- the default is the hight of the current font
  void set_row_height(gint height);

  //: scroll the viewing area of the list
  //- to the given column
  //- and row; row_align and col_align are between 0-1 representing the
  //- location the row should appear on the screnn, 0.0 being top or left,
  //- 1.0 being bottom or right; if row or column is -1 then then there
  //- is no change
  void moveto(gint row, gint column,
	      gfloat row_align, gfloat col_align);

  //: whether the row is visible
  bool row_is_visible(gint row) const;

  //: returns the cell type
  //- which is one of
  //- GTK_CELL_EMPTY, GTK_CELL_TEXT, GTK_CELL_PIXMAP, GTK_CELL_PIXTEXT, 
  //- GTK_CELL_WIDGET
  GtkCellType get_cell_type(gint row, gint column) const;

  //: sets a given cell's text, replacing it's current contents
  void set_text(gint row, gint column, const string &text);
  //: get cell's text
  //- returns true on success
  bool get_text(gint row, gint column, _gtk_string *text) const;
  bool get_text(gint row, gint column, string& text) const;
  _gtk_string  get_text(gint row, gint column) const;

  //: sets a given cell's pixmap, replacing it's current contents
  void set_pixmap(gint row, gint column,
		  const Gdk_Pixmap &pixmap, const Gdk_Bitmap &mask);
  //: get cell's pixmap
  //- returns 1 on success
  //- any of the return pointer can be NULL if you are not interested
  gint get_pixmap(gint row, gint column,
		  Gdk_Pixmap &pixmap, Gdk_Bitmap &mask) const;

  //: sets a given cell's pixmap and text, replacing it's current contents
  void set_pixtext(gint row, gint column, const string &text,
		   guint8 spacing,
		   const Gdk_Pixmap &pixmap, const Gdk_Bitmap &mask);
  // any of the return pointer can be NULL if you are not interested
  bool get_pixtext(gint row, gint column, _gtk_string *text,
		   guint8 *spacing,
		   Gdk_Pixmap &pixmap, Gdk_Bitmap &mask) const;

  bool get_pixtext(gint row, gint column, string &text,
		   guint8 *spacing,
		   Gdk_Pixmap &pixmap, Gdk_Bitmap &mask) const;

  // sets the foreground color of a row, the color must already
  // be allocated
  void set_foreground(gint row, const Gdk_Color &color);

  // sets the background color of a row, the color must already
  // be allocated
  void set_background(gint row, const Gdk_Color &color);

  // this sets a horizontal and vertical shift for drawing
  // the contents of a cell; it can be positive or negitive; this is
  // partuculary useful for indenting items in a column
  void set_shift(gint row, gint column,
		 gint vertical, gint horizontal);

  // prepend/append returns the index of the row you just added, making
  // it easier to append and modify a row<p>
  // Example:
  // <pre>
  // gchar **row = new gchar*[num_of_columns];
  // row[0]="cell1";
  // row[1]="cell2";
  // ...
  // row[num_of_columns-1]="cellN-1";
  // clist->append(row);
  // </pre>
  gint append(const gchar* text[]);
  gint append(const vector<string> text);
#line 189 "clist.gen_h"
  gint prepend (const gchar *text[]);
  gint prepend (const vector<string> text);
#line 192 "clist.gen_h"

  // inserts a row at index row
  // Note: this is gtk_clist_insert() in gtk, but renamed here to
  //       insert_row()
  gint insert_row(gint row, const gchar* text[]);
  gint insert_row(gint row, const vector<string> &text);

  // removes row at index row
  // Note: this is gtk_clist_remove() in gtk, but renamed here to
  //       remove_row()
  void remove_row(gint row);
  // begining of row_list
  iterator begin();
  // end of row_list
  iterator end();
  // beginning of selection (STL style iterators)
  seliterator selbegin() const;
  // end of selection (STL style iterators)
  seliterator selend() const;
  // this returns the coordiates of the point in the list
  // given the coordinate from a drop signal.
  gint drop_calibrate ( gint y_in ) const;
private:
  virtual bool check_seliterator_type() const;
public:

  // sets a arbitrary data pointer for a given row
  void set_row_data(gint row, gpointer data);
  // returns the data set for a row
  gpointer get_row_data(gint row) const;

  
  // sets a data pointer for a given row with destroy notification
  void set_row_data_full(gint row,
                         gpointer data,
			 GtkDestroyNotify destroy);
  // given a data pointer, find the first (and hopefully only!)
  // row that points to that data, or -1 if none do
  gint find_row_from_data(gpointer data) const;

  // force selection of a row
  void cause_select_row(gint row, gint column);
  // force unselection of a row
  void cause_unselect_row(gint row, gint column);

  // clear the entire list -- this is much faster than removing each item
  // with remove.
//   void clear();

  
  // return the row column corresponding to the x and y coordinates
  // <P> reference and pointer style available
  gint get_selection_info(gint x, gint y, gint *row, gint *column) const;

 
#line 248 "clist.gen_h"

  const Gtk_Adjustment* get_hadjustment() const { return hadjustment_; } 
  const Gtk_Adjustment* get_vadjustment() const { return vadjustment_; }
  Gtk_Adjustment*       get_hadjustment() { return hadjustment_; }
  Gtk_Adjustment*       get_vadjustment() { return vadjustment_; }

  void set_hadjustment(Gtk_Adjustment &adjustment);
  void set_vadjustment(Gtk_Adjustment &adjustment);

  // set the border style of the clist
  // <P>
  // valid choices are:
  // GTK_SHADOW_NONE, GTK_SHADOW_IN, GTK_SHADOW_OUT, GTK_SHADOW_ETCHED_IN,
  // GTK_SHADOW_ETCHED_OUT
  void set_shadow_type          (GtkShadowType type);

  void set_reorderable          (bool reorderable);
  void set_use_drag_icons       (bool use_icons);
  void set_button_actions       (guint     button,
				 guint8    button_actions);

  // set visibility of a column
  void set_column_visibility    (gint column,
				 bool  visible);

  // enable/disable column resize operations by mouse
  void set_column_resizeable    (gint column,
				 bool resizeable);

  // resize column automatically to its optimal width
  void set_column_auto_resize   (gint column,
				 bool  auto_resize);

  // returns the title of column. Returns an empty string if title is not set
  string get_column_title       (gint column) const;

  // returns the width in pixels of the column, returns -1 if the column doens't exist
  // column is 0 based.
  gint get_column_width ( gint column ) const;
 
  // returns the column widget
  const Gtk_Widget* get_column_widget (gint column) const;

  gint optimal_column_width (gint column) const;

  void clist_set_column_width (gint      column,
			       gint      width);

  // set column minimum/maximum width. min/max_width < 0 => no restriction
  void set_column_min_width (gint      column,
			     gint      min_width);
  void set_column_max_width (gint      column,
			     gint      max_width);

  void set_cell_style (gint            row,
		       gint            column,
		       const Gtk_Style &style);

  Gtk_ObjectHandle<Gtk_Style> get_cell_style (gint      row,
					      gint      column) const;

  void set_row_style (gint            row,
		      const Gtk_Style &style);

  Gtk_ObjectHandle<Gtk_Style> get_row_style (gint      row) const;

  // set/get selectable flag of a single row
  void set_selectable (gint      row,
		       bool  selectable);

  bool get_selectable (gint      row) const;

  // undo the last select/unselect operation
  void undo_selection ();
  // in multiple or extended mode, select all rows
//   void select_all ();

  // in all modes except browse mode, deselect all rows
//   void unselect_all ();

  // swap the position of two rows
  void swap_rows (gint      row1,
		  gint      row2);

  // sets a compare function different to the default
  void set_compare_func (GtkCListCompareFunc  cmp_func);

  // the column to sort by
  void set_sort_column (gint      column);

  // how to sort : ascending or descending
  void set_sort_type (GtkSortType  sort_type);

  // sort the list with the current compare function
  void sort ();

  // Automatically sort upon insertion
  void set_auto_sort (bool auto_sort);

  gint columns_autosize();
  
  //A couple of convenience accessors
  gint rows()    { return gtkobj()->rows; }
  gint columns() { return gtkobj()->columns; }

  Signal_proxy0<BaseObjectType> refresh;
  Signal_proxy2<BaseObjectType,gint, gint> resize_column;
  Signal_proxy0<BaseObjectType> toggle_focus_row;
  Signal_proxy0<BaseObjectType> select_all;
  Signal_proxy0<BaseObjectType> unselect_all;
  Signal_proxy0<BaseObjectType> start_selection;
  Signal_proxy0<BaseObjectType> end_selection;
  Signal_proxy3<BaseObjectType,GtkScrollType, gfloat, gboolean> extend_selection;
  Signal_proxy2<BaseObjectType,GtkScrollType, gfloat> scroll_horizontal;
  Signal_proxy2<BaseObjectType,GtkScrollType, gfloat> scroll_vertical;
  Signal_proxy0<BaseObjectType> toggle_add_mode;
  Signal_proxy0<BaseObjectType> abort_column_resize;
  Signal_proxy1<BaseObjectType,GdkEvent*> resync_selection;
  // SIGNAL_UNIMPLEMENTED_YET_SPEC(void draw_row(GdkRectangle,gint,GtkCListRow));
  // SIGNAL_UNIMPLEMENTED_YET_SPEC(GList selection_find(? ? ?));
  // SIGNAL_UNIMPLEMENTED_YET_SPEC(GList set_cell_contents(? ? ?));
  // SIGNAL_UNIMPLEMENTED_YET_SPEC(GList cell_size_request(? ? ?));
  // SIGNAL_UNIMPLEMENTED_YET_SPEC(GList set_scroll_adjustments(? ? ?));
  Signal_proxy0<BaseObjectType> clear;
  Signal_proxy1<BaseObjectType,gint> fake_unselect_all;
  Signal_proxy0<BaseObjectType> sort_list;
//   SIGNAL_UNIMPLEMENTED_YET_SPEC(void insert_row(gint,gchar**)); // FIXME: string ??

  Signal_proxy2<BaseObjectType,gint, gint> row_move;
  
  // signal emitted on row selection
  // (row, column, event)
  Signal_proxy3<BaseObjectType,gint, gint, GdkEvent*> select_row;
  // signal emitted on row unselection
  // (row, column, event)
  Signal_proxy3<BaseObjectType,gint, gint, GdkEvent*> unselect_row;

#line 393 "clist.gen_h"
  // signal emitted by clicking on a title ?
  // (column)
  Signal_proxy1<BaseObjectType,gint> click_column;

protected:
  /* impl functions */
  virtual void refresh_impl();
  virtual void resize_column_impl(gint p1, gint p2);
  virtual void toggle_focus_row_impl();
  virtual void select_all_impl();
  virtual void unselect_all_impl();
  virtual void start_selection_impl();
  virtual void end_selection_impl();
  virtual void extend_selection_impl(GtkScrollType p1, gfloat p2, gboolean p3);
  virtual void scroll_horizontal_impl(GtkScrollType p1, gfloat p2);
  virtual void scroll_vertical_impl(GtkScrollType p1, gfloat p2);
  virtual void toggle_add_mode_impl();
  virtual void abort_column_resize_impl();
  virtual void resync_selection_impl(GdkEvent* p1);
  virtual void clear_impl();
  virtual void fake_unselect_all_impl(gint p1);
  virtual void sort_list_impl();
  virtual void remove_row_impl(gint p1);
  virtual void row_move_impl(gint p1, gint p2);
  virtual void select_row_impl(gint p1, gint p2, GdkEvent* p3);
  virtual void unselect_row_impl(gint p1, gint p2, GdkEvent* p3);
  virtual void click_column_impl(gint p1);
public:
  GtkCList* gtkobj() { return GTK_CLIST(gtkobject); }
  const GtkCList* gtkobj() const { return GTK_CLIST(gtkobject); }
  static bool isGtkCList(Gtk_Object *checkcast);
#line 397 "clist.gen_h"


#line 400 "clist.gen_h"
protected:
  // no need to use objecthandle here, they'll be owned only if we
  // dont have object available
  Gtk_Adjustment *vadjustment_, *hadjustment_;
#line 408 "clist.gen_h"
};


#endif
