icon-list.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGNOMEUIMM_ICON_LIST_H
00004 #define _LIBGNOMEUIMM_ICON_LIST_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in
00010 /* $Id: icon-list.hg,v 1.18 2004/06/06 21:13:08 murrayc Exp $ */
00011 
00012 /* icon-list.hg
00013  * 
00014  * Copyright (C) 1998 EMC Capital Management Inc.
00015  * Developed by Havoc Pennington <hp@pobox.com>
00016  *
00017  * Copyright (C) 1999 The Gtk-- Development Team
00018  *
00019  * This library is free software; you can redistribute it and/or
00020  * modify it under the terms of the GNU Library General Public
00021  * License as published by the Free Software Foundation; either
00022  * version 2 of the License, or (at your option) any later version.
00023  *
00024  * This library is distributed in the hope that it will be useful,
00025  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00026  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00027  * Library General Public License for more details.
00028  *
00029  * You should have received a copy of the GNU Library General Public
00030  * License along with this library; if not, write to the Free
00031  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00032  */
00033 
00034 #include <libgnomeuimm/icon-textitem.h>
00035 #include <libgnomecanvasmm/canvas.h>
00036 #include <libgnomecanvasmm/pixbuf.h>
00037 #include <gtkmm/container.h>
00038 #include <glibmm/helperlist.h>
00039 #include <libgnomeui/gnome-icon-list.h>
00040 
00041 
00042 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00043 typedef struct _GnomeIconList GnomeIconList;
00044 typedef struct _GnomeIconListClass GnomeIconListClass;
00045 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00046 
00047 
00048 namespace Gnome
00049 {
00050 
00051 namespace UI
00052 { class IconList_Class; } // namespace UI
00053 
00054 } // namespace Gnome
00055 namespace Gnome
00056 {
00057 
00058 namespace UI
00059 {
00060 
00061 namespace IconList_Helpers
00062 {
00063 
00064  
00065 class SelectionList : public Glib::HelperList< int, int, Glib::List_Iterator< int > >
00066 {
00067 public:
00068   SelectionList();
00069   explicit SelectionList(GnomeIconList* gparent);
00070   SelectionList(const SelectionList& src);
00071   virtual ~SelectionList() {}
00072 
00073   SelectionList& operator=(const SelectionList& src);
00074 
00075   typedef Glib::HelperList< int, int,  Glib::List_Iterator< int > > type_base;
00076 
00077   GnomeIconList* gparent();
00078   const GnomeIconList* gparent() const;
00079 
00080   virtual GList*& glist() const;      // front of list
00081 
00082   virtual void erase(iterator start, iterator stop);
00083   virtual iterator erase(iterator);  //Implented as custom or by LIST_CONTAINER_REMOVE
00084   virtual void remove(const_reference); //Implented as custom or by LIST_CONTAINER_REMOVE
00085 
00087   reference operator[](size_type l) const;
00088 
00089 public:
00090   iterator insert(iterator position, element_type& e); //custom-implemented.
00091 
00092   template <class InputIterator>
00093   inline void insert(iterator position, InputIterator first, InputIterator last)
00094   {
00095     for(;first != last; ++first)
00096       position = insert(position, *first);
00097   }
00098 
00099  inline void push_front(element_type& e)
00100     { insert(begin(), e); }
00101   inline void push_back(element_type& e)
00102     { insert(end(), e); }
00103 
00104 
00105 protected:
00106   mutable GList* glist_;
00107   };
00108 
00109 
00110 } /* namespace IconList_Helpers */
00111 
00112 
00113 class Group;
00114 
00115 
00116 class IconList : public Gnome::Canvas::Canvas
00117 {
00118   public:
00119 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00120   typedef IconList CppObjectType;
00121   typedef IconList_Class CppClassType;
00122   typedef GnomeIconList BaseObjectType;
00123   typedef GnomeIconListClass BaseClassType;
00124 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00125 
00126   virtual ~IconList();
00127 
00128 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00129 
00130 private:
00131   friend class IconList_Class;
00132   static CppClassType iconlist_class_;
00133 
00134   // noncopyable
00135   IconList(const IconList&);
00136   IconList& operator=(const IconList&);
00137 
00138 protected:
00139   explicit IconList(const Glib::ConstructParams& construct_params);
00140   explicit IconList(GnomeIconList* castitem);
00141 
00142 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00143 
00144 public:
00145 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00146   static GType get_type()      G_GNUC_CONST;
00147   static GType get_base_type() G_GNUC_CONST;
00148 #endif
00149 
00151   GnomeIconList*       gobj()       { return reinterpret_cast<GnomeIconList*>(gobject_); }
00152 
00154   const GnomeIconList* gobj() const { return reinterpret_cast<GnomeIconList*>(gobject_); }
00155 
00156 
00157 public:
00158   //C++ methods used to invoke GTK+ virtual functions:
00159 #ifdef GLIBMM_VFUNCS_ENABLED
00160 #endif //GLIBMM_VFUNCS_ENABLED
00161 
00162 protected:
00163   //GTK+ Virtual Functions (override these to change behaviour):
00164 #ifdef GLIBMM_VFUNCS_ENABLED
00165 #endif //GLIBMM_VFUNCS_ENABLED
00166 
00167   //Default Signal Handlers::
00168 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00169   virtual void on_select_icon(int num, GdkEvent* event);
00170   virtual void on_unselect_icon(int num, GdkEvent* event);
00171   virtual void on_focus_icon(int num);
00172   virtual bool on_text_changed(int num, const char* new_text);
00173   virtual void on_move_cursor(Gtk::DirectionType dir, bool clear_selection);
00174   virtual void on_toggle_cursor_selection();
00175 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00176 
00177 
00178 private:
00179 
00180   
00181 public:
00182   //TODO: add missing ctor args
00183   explicit IconList(guint icon_width = 80, bool is_editable = false);
00184 
00185   
00186   void set_hadjustment(Gtk::Adjustment& hadj);
00187   
00188   void set_vadjustment(Gtk::Adjustment& vadj);
00189   
00190   void freeze();
00191   
00192   void thaw();
00193   
00194   void insert(int pos, const Glib::ustring& icon_filename, const Glib::ustring& text);
00195   
00196   void insert(int idx, const Glib::RefPtr<Gdk::Pixbuf>& im, const Glib::ustring& icon_filename, const Glib::ustring& text);
00197   
00198   int append(const Glib::ustring& icon_filename, const Glib::ustring& text);
00199   
00200   int append(const Glib::RefPtr<Gdk::Pixbuf>& im, const Glib::ustring& icon_filename, const Glib::ustring& text);
00201   
00202   void clear();
00203   
00204   void remove(int pos);
00205   
00206   guint get_num_icons() const;
00207   
00208   Gtk::SelectionMode get_selection_mode() const;
00209   
00210   void set_selection_mode(Gtk::SelectionMode mode);
00211   
00212   void select_icon(int idx);
00213   
00214   void unselect_icon(int idx);
00215   
00216   int select_all();
00217   
00218   int unselect_all();
00219   
00220   void focus_icon(gint idx);
00221   
00222   void set_icon_width (int w);
00223   
00224   void set_row_spacing(int spacing);
00225   
00226   void set_col_spacing(int spacing);
00227   
00228   void set_text_spacing(int spacing);
00229   
00230   void set_icon_border(int spacing);
00231   
00232   void set_separators(const Glib::ustring& sep);
00233   
00234   Glib::ustring get_icon_filename(int idx) const;
00235   
00236   int find_icon_from_filename(const Glib::ustring& filename) const;
00237   
00238   void set_icon_data(int pos, gpointer data);
00239   
00240   
00241   int find_icon_from_data(gpointer data) const;
00242   
00243   gpointer get_icon_data(int pos);
00244   
00245   void moveto(int pos, double yalign);
00246   
00247   Gtk::Visibility icon_is_visible(int pos);
00248   
00249   int get_icon_at(int x, int y) const;
00250   
00251   int get_items_per_line() const;
00252 
00253   
00254   IconTextItem* get_icon_text_item(int idx);
00255   
00256   Gnome::Canvas::Pixbuf* get_icon_pixbuf_item(int idx);
00257 
00258   typedef IconList_Helpers::SelectionList SelectionList;
00259   SelectionList& selection();
00260   const SelectionList& selection() const;
00261   
00262 
00268   Glib::SignalProxy2< void,int,GdkEvent* > signal_select_icon();
00269 ;
00270   
00276   Glib::SignalProxy2< void,int,GdkEvent* > signal_unselect_icon();
00277 ;
00278 
00279   
00285   Glib::SignalProxy1< void,int > signal_focus_icon();
00286 ;
00287 
00288   
00294   Glib::SignalProxy2< bool,int,const char* > signal_text_changed();
00295 ;
00296 
00297         /* Key Binding signals */
00298         
00304   Glib::SignalProxy2< void,Gtk::DirectionType,bool > signal_move_cursor();
00305 
00306         
00312   Glib::SignalProxy0< void > signal_toggle_cursor_selection();
00313 
00314 
00315 protected:
00316 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00317   mutable SelectionList selection_proxy_;
00318 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00319 
00320 
00321 };
00322 
00323 } /* namespace UI */
00324 } /* namespace Gnome */
00325 
00326 
00327 namespace Glib
00328 {
00337   Gnome::UI::IconList* wrap(GnomeIconList* object, bool take_copy = false);
00338 } //namespace Glib
00339 
00340 
00341 #endif /* _LIBGNOMEUIMM_ICON_LIST_H */
00342 

Generated on Wed Sep 19 19:41:23 2007 for libgnomeuimm by  doxygen 1.5.3