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

treeviewcolumn.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 00023 00024 #ifndef GFC_GTK_TREE_VIEW_COLUMN_HH 00025 #define GFC_GTK_TREE_VIEW_COLUMN_HH 00026 00027 #ifndef GFC_GTK_OBJECT_HH 00028 #include <gfc/gtk/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GTK_CELL_LAYOUT_HH 00032 #include <gfc/gtk/celllayout.hh> 00033 #endif 00034 00035 #ifndef GFC_GTK_ENUMS_HH 00036 #include <gfc/gtk/enums.hh> 00037 #endif 00038 00039 #ifndef __GTK_TREE_VIEW_COLUMN_H__ 00040 #include <gtk/gtktreeviewcolumn.h> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace Gdk { 00046 class Rectangle; 00047 } 00048 00049 namespace Gtk { 00050 00051 class CellRenderer; 00052 class TreeIter; 00053 class TreeModel; 00054 class TreeViewColumn; 00055 class Widget; 00056 00061 00062 enum TreeViewColumnSizing 00063 { 00064 TREE_VIEW_COLUMN_GROW_ONLY = GTK_TREE_VIEW_COLUMN_GROW_ONLY, 00066 00067 TREE_VIEW_COLUMN_AUTOSIZE = GTK_TREE_VIEW_COLUMN_AUTOSIZE, 00069 00070 TREE_VIEW_COLUMN_FIXED = GTK_TREE_VIEW_COLUMN_FIXED 00072 }; 00073 00081 00082 class TreeViewColumn : public Object, public CellLayout 00083 { 00084 friend class G::Object; 00085 00086 TreeViewColumn(const TreeViewColumn&); 00087 TreeViewColumn& operator=(const TreeViewColumn&); 00088 00089 protected: 00092 00093 explicit TreeViewColumn(GtkTreeViewColumn *tree_column, bool owns_reference = false); 00100 00104 00105 typedef G::Signal<void> ClickedSignalType; 00106 typedef G::SignalProxy<TypeInstance, ClickedSignalType> ClickedSignalProxy; 00107 static const ClickedSignalType clicked_signal; 00112 00114 00115 public: 00118 00119 TreeViewColumn(); 00121 00122 TreeViewColumn(const char *title); 00123 TreeViewColumn(const String& title); 00126 00127 TreeViewColumn(const char *title, CellRenderer& cell, const char *attribute, int column); 00128 TreeViewColumn(const String& title, CellRenderer& cell, const String& attribute, int column); 00145 00146 TreeViewColumn(const char *title, CellRenderer& cell, const CellColumnAttributes& attributes); 00147 TreeViewColumn(const String& title, CellRenderer& cell, const CellColumnAttributes& attributes); 00167 00168 virtual ~TreeViewColumn(); 00170 00174 00175 GtkTreeViewColumn* gtk_tree_view_column() const; 00177 00178 operator GtkTreeViewColumn* () const; 00180 00181 int get_spacing() const; 00183 00184 bool get_visible() const; 00189 00190 bool get_resizable() const; 00192 00193 TreeViewColumnSizing get_sizing() const; 00195 00196 int get_width() const; 00198 00199 int get_fixed_width() const; 00202 00203 int get_min_width() const; 00205 00206 int get_max_width() const; 00208 00209 String get_title() const; 00211 00212 bool get_expand() const; 00215 00216 bool get_clickable() const; 00218 00219 Widget* get_widget() const; 00224 00225 float get_alignment() const; 00227 00228 bool get_reorderable() const; 00230 00231 int get_sort_column_id() const; 00236 00237 bool get_sort_indicator() const; 00240 00241 SortType get_sort_order() const; 00244 00245 bool get_cell_renderers(std::vector<CellRenderer*>& cell_list) const; 00249 00250 void cell_get_size(const Gdk::Rectangle *cell_area, int *x_offset, int *y_offset, int *width, int *height) const; 00259 00260 bool cell_is_visible() const; 00265 00269 00270 void pack_start(CellRenderer& cell, bool expand = true); 00277 00278 void pack_end(CellRenderer& cell, bool expand = true); 00285 00286 void clear(); 00288 00289 void add_attribute(CellRenderer& cell, const char *attribute, int column); 00290 void add_attribute(CellRenderer& cell, const String& attribute, int column); 00301 00302 void set_attributes(CellRenderer& cell, const CellColumnAttributes& attributes); 00306 00307 void set_cell_data_func(CellRenderer& cell, const CellDataSlot& slot); 00315 00316 void remove_cell_data_func(CellRenderer& cell); 00319 00320 void clear_attributes(CellRenderer& cell); 00323 00324 void set_spacing(int spacing); 00328 00329 void set_visible(bool visible); 00332 00333 void set_resizable(bool resizable); 00340 00341 void set_sizing(TreeViewColumnSizing type); 00344 00345 void set_fixed_width(int fixed_width); 00353 00354 void set_min_width(int min_width); 00359 00360 void set_max_width(int max_width); 00367 00368 void set_title(const char *title); 00369 void set_title(const String& title); 00374 00375 void set_expand(bool expand); 00382 00383 void clicked(); 00386 00387 void set_clickable(bool active); 00392 00393 void set_widget(Widget *widget); 00399 00400 void set_alignment(float xalign); 00406 00407 void set_reorderable(bool reorderable); 00410 00411 void set_sort_column_id(int sort_column_id); 00419 00420 void set_sort_indicator(bool setting); 00426 00427 void set_sort_order(SortType order); 00439 00440 void cell_set_cell_data(const TreeModel& model, const TreeIter& iter, bool is_expander, bool is_expanded); 00450 00451 void focus_cell(CellRenderer& cell); 00455 00459 00460 const ClickedSignalProxy sig_clicked(); 00462 00464 }; 00465 00466 } // namespace Gtk 00467 00468 } // namespace GFC 00469 00470 #include <gfc/gtk/inline/treeviewcolumn.inl> 00471 00472 #endif // GFC_GTK_TREE_VIEW_COLUMN_HH 00473

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