GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

celllayout.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00024 00025 #ifndef GFC_GTK_CELL_LAYOUT_HH 00026 #define GFC_GTK_CELL_LAYOUT_HH 00027 00028 #ifndef GFC_STACK_OBJECT_HH 00029 #include <gfc/stackobject.hh> 00030 #endif 00031 00032 #ifndef GFC_G_TYPE_HH 00033 #include <gfc/glib/type.hh> 00034 #endif 00035 00036 #ifndef __GTK_CELL_LAYOUT_H__ 00037 #include <gtk/gtkcelllayout.h> 00038 #endif 00039 00040 #ifndef _CPP_VECTOR 00041 #include <vector> 00042 #endif 00043 00044 namespace GFC { 00045 00046 namespace Gdk { 00047 class Event; 00048 } 00049 00050 namespace Gtk { 00051 00052 class CellRenderer; 00053 class TreeIter; 00054 class TreeModel; 00055 00082 00083 class CellColumnAttributes : public StackObject 00084 { 00085 std::vector<String> attributes_; 00086 std::vector<int> columns_; 00087 00088 public: 00091 00092 CellColumnAttributes(); 00094 00095 CellColumnAttributes(const char *attribute, int column); 00096 CellColumnAttributes(const String& attribute, int column); 00100 00101 ~CellColumnAttributes(); 00103 00107 00108 const std::vector<String>& get_attributes() const; 00111 00112 const std::vector<int>& get_columns() const; 00115 00116 bool empty() const; 00119 00120 int size() const; 00123 00127 00128 void add(const char *attribute, int column); 00129 void add(const String& attribute, int column); 00133 00134 void clear(); 00136 00138 }; 00139 00148 00149 class CellLayout : public virtual G::TypeInterface 00150 { 00151 protected: 00154 00155 CellLayout(); 00157 00158 virtual ~CellLayout() = 0; 00160 00162 00163 public: 00164 typedef sigc::slot<void, CellRenderer&, const TreeModel&, const TreeIter&> CellDataSlot; 00179 00182 00183 GtkCellLayout* gtk_cell_layout() const; 00185 00186 operator GtkCellLayout* () const; 00188 00192 00193 void pack_start(CellRenderer& cell, bool expand = true); 00201 00202 void pack_end(CellRenderer& cell, bool expand = true); 00210 00211 void add_attribute(CellRenderer& cell, const char *attribute, int column); 00212 void add_attribute(CellRenderer& cell, const String& attribute, int column); 00223 00224 void set_attributes(CellRenderer& cell, const CellColumnAttributes& attributes); 00242 00243 void set_cell_data_func(CellRenderer& cell, const CellDataSlot& slot); 00251 00252 void remove_cell_data_func(CellRenderer& cell); 00255 00256 void reorder(CellRenderer& cell, int position); 00263 00264 void clear_attributes(CellRenderer& cell); 00267 00268 void clear(); 00270 00272 }; 00273 00274 } // namespace Gtk 00275 00276 } // namespace GFC 00277 00278 #include <gfc/gtk/inline/celllayout.inl> 00279 00280 #endif // GFC_GTK_CELL_LAYOUT_HH 00281

Generated on Tue Aug 24 00:34:30 2004 for GFC-UI by doxygen 1.3.8