Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# treeviewcolumn.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti Development Team.
    00003  *  Copyright (C) 2000 Red Hat, Inc.
    00004  *
    00005  *  This program is free software; you can redistribute it and/or modify
    00006  *  it under the terms of the GNU General Public License as published by
    00007  *  the Free Software Foundation; either version 2 of the License, or
    00008  *  (at your option) any later version.
    00009  *
    00010  *  This program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00013  *  GNU Library General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU Library General Public License
    00016  *  along with this program; if not, write to the Free Software
    00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018  */
    00019
    00024
    00025 #ifndef INTI_GTK_TREE_VIEW_COLUMN_H
    00026 #define INTI_GTK_TREE_VIEW_COLUMN_H
    00027
    00028 #ifndef INTI_GTK_OBJECT_H
    00029 #include <inti/gtk/object.h>
    00030 #endif
    00031
    00032 #ifndef INTI_GTK_ENUMS_H
    00033 #include <inti/gtk/enums.h>
    00034 #endif
    00035
    00036 #ifndef __GTK_TREE_VIEW_COLUMN_H__
    00037 #include <gtk/gtktreeviewcolumn.h>
    00038 #endif
    00039
    00040 #ifndef _CPP_MAP
    00041 #include <map>
    00042 #endif
    00043
    00044 #ifndef _CPP_VECTOR
    00045 #include <vector>
    00046 #endif
    00047
    00048 namespace Inti {
    00049
    00050 namespace Gtk {
    00051
    00052 class CellRenderer;
    00053 class TreeIter;
    00054 class TreeModel;
    00055 class TreeViewColumnClass;
    00056 class Widget;
    00057
    00062
    00063 enum TreeViewColumnSizing
    00064 {
    00065         TREE_VIEW_COLUMN_GROW_ONLY = GTK_TREE_VIEW_COLUMN_GROW_ONLY,
    00067
    00068         TREE_VIEW_COLUMN_AUTOSIZE = GTK_TREE_VIEW_COLUMN_AUTOSIZE,
    00070
    00071         TREE_VIEW_COLUMN_FIXED = GTK_TREE_VIEW_COLUMN_FIXED
    00073 };
    00074
    00082
    00083 class TreeViewColumn : public Object
    00084 {
    00085         friend class G::Object;
    00086         friend class TreeViewColumnClass;
    00087
    00088         TreeViewColumn(const TreeViewColumn&);
    00089         TreeViewColumn& operator=(const TreeViewColumn&);
    00090
    00091 protected:
    00094
    00095         explicit TreeViewColumn(GtkTreeViewColumn *tree_column, bool reference = false);
    00102
    00106
    00107         virtual void on_clicked();
    00109
    00111 //  Properties
    00112
    00113         typedef G::Property<bool> VisiblePropertyType;
    00114         typedef G::PropertyProxy<G::Object, VisiblePropertyType> VisiblePropertyProxy;
    00115         static const VisiblePropertyType visible_property;
    00116
    00117         typedef G::Property<bool> ResizablePropertyType;
    00118         typedef G::PropertyProxy<G::Object, ResizablePropertyType> ResizablePropertyProxy;
    00119         static const ResizablePropertyType resizable_property;
    00120
    00121         typedef G::ReadableProperty<int> WidthPropertyType;
    00122         typedef G::PropertyProxy<G::Object, WidthPropertyType> WidthPropertyProxy;
    00123         static const WidthPropertyType width_property;
    00124
    00125         typedef G::Property<TreeViewColumnSizing, int> SizingPropertyType;
    00126         typedef G::PropertyProxy<G::Object, SizingPropertyType> SizingPropertyProxy;
    00127         static const SizingPropertyType sizing_property;
    00128
    00129         typedef G::Property<int> FixedWidthPropertyType;
    00130         typedef G::PropertyProxy<G::Object, FixedWidthPropertyType> FixedWidthPropertyProxy;
    00131         static const FixedWidthPropertyType fixed_width_property;
    00132
    00133         typedef G::Property<int> MinWidthPropertyType;
    00134         typedef G::PropertyProxy<G::Object, MinWidthPropertyType> MinWidthPropertyProxy;
    00135         static const MinWidthPropertyType min_width_property;
    00136
    00137         typedef G::Property<int> MaxWidthPropertyType;
    00138         typedef G::PropertyProxy<G::Object, MaxWidthPropertyType> MaxWidthPropertyProxy;
    00139         static const MaxWidthPropertyType max_width_property;
    00140
    00141         typedef G::Property<String> TitlePropertyType;
    00142         typedef G::PropertyProxy<G::Object, TitlePropertyType> TitlePropertyProxy;
    00143         static const TitlePropertyType title_property;
    00144
    00145         typedef G::Property<bool> ClickablePropertyType;
    00146         typedef G::PropertyProxy<G::Object, ClickablePropertyType> ClickablePropertyProxy;
    00147         static const ClickablePropertyType clickable_property;
    00148
    00149         typedef G::Property<Widget*, G::Object*> WidgetPropertyType;
    00150         typedef G::PropertyProxy<G::Object, WidgetPropertyType> WidgetPropertyProxy;
    00151         static const WidgetPropertyType widget_property;
    00152
    00153         typedef G::Property<float> AlignmentPropertyType;
    00154         typedef G::PropertyProxy<G::Object, AlignmentPropertyType> AlignmentPropertyProxy;
    00155         static const AlignmentPropertyType alignment_property;
    00156
    00157         typedef G::Property<bool> ReorderablePropertyType;
    00158         typedef G::PropertyProxy<G::Object, ReorderablePropertyType> ReorderablePropertyProxy;
    00159         static const ReorderablePropertyType reorderable_property;
    00160
    00161         typedef G::Property<bool> SortIndicatorPropertyType;
    00162         typedef G::PropertyProxy<G::Object, SortIndicatorPropertyType> SortIndicatorPropertyProxy;
    00163         static const SortIndicatorPropertyType sort_indicator_property;
    00164
    00165         typedef G::Property<SortType, int> SortOrderPropertyType;
    00166         typedef G::PropertyProxy<G::Object, SortOrderPropertyType> SortOrderPropertyProxy;
    00167         static const SortOrderPropertyType sort_order_property;
    00168
    00169 //  Signals
    00170
    00171         typedef G::Signal0<void> ClickedSignalType;
    00172         typedef G::SignalProxy<TypeInstance, ClickedSignalType> ClickedSignalProxy;
    00173         static const ClickedSignalType clicked_signal;
    00174
    00175 public:
    00176
    00177         typedef Slot3<void, CellRenderer&, TreeModel*, const TreeIter&> CellDataSlot;
    00192
    00195
    00196         TreeViewColumn();
    00198
    00199         TreeViewColumn(const String& title, CellRenderer *cell, ...);
    00215
    00216         TreeViewColumn(const String& title, CellRenderer& cell, const std::map<int, String>& attributes);
    00237
    00238         virtual ~TreeViewColumn();
    00240
    00244
    00245         GtkTreeViewColumn* gtk_tree_view_column() const { return (GtkTreeViewColumn*)instance; }
    00247
    00248         GtkTreeViewColumnClass* gtk_tree_view_column_class() const;
    00250
    00251         operator GtkTreeViewColumn* () const;
    00253
    00254         int get_spacing() const;
    00256
    00257         bool get_visible() const;
    00262
    00263         bool get_resizable() const;
    00265
    00266         TreeViewColumnSizing get_sizing() const;
    00268
    00269         int get_width() const;
    00271
    00272         int get_fixed_width() const;
    00275
    00276         int get_min_width() const;
    00278
    00279         int get_max_width() const;
    00281
    00282         String get_title() const;
    00284
    00285         bool get_clickable() const;
    00287
    00288         Widget* get_widget() const;
    00293
    00294         float get_alignment() const;
    00296
    00297         bool get_reorderable() const;
    00299
    00300         int get_sort_column_id() const;
    00305
    00306         bool get_sort_indicator() const;
    00309
    00310         SortType get_sort_order() const;
    00313
    00314         bool get_cell_renderers(std::vector<CellRenderer*>& cell_list) const;
    00318
    00319         void cell_get_size(const Gdk::Rectangle *cell_area, int *x_offset, int *y_offset, int *width, int *height) const;
    00328
    00329         bool cell_is_visible() const;
    00334
    00338
    00339         void pack_start(CellRenderer& cell, bool expand = true);
    00346
    00347         void pack_end(CellRenderer& cell, bool expand = true);
    00354
    00355         void clear();
    00357
    00358         void add_attribute(CellRenderer& cell, const String& attribute, int column);
    00369
    00370         void set_attributes(CellRenderer *cell, ...);
    00377
    00378         void set_attributes(CellRenderer& cell, const std::map<int, String>& attributes);
    00385
    00386         void set_cell_data_slot(CellRenderer& cell, const CellDataSlot *slot);
    00394
    00395         void clear_attributes(CellRenderer& cell);
    00398
    00399         void set_spacing(int spacing);
    00403
    00404         void set_visible(bool visible);
    00407
    00408         void set_resizable(bool resizable);
    00415
    00416         void set_sizing(TreeViewColumnSizing type);
    00419
    00420         void set_fixed_width(int fixed_width);
    00428
    00429         void set_min_width(int min_width);
    00434
    00435         void set_max_width(int max_width);
    00442
    00443         void set_title(const String& title);
    00448
    00449         void clicked();
    00452
    00453         void set_clickable(bool active);
    00458
    00459         void set_widget(Widget *widget);
    00465
    00466         void set_alignment(float xalign);
    00472
    00473         void set_reorderable(bool reorderable);
    00476
    00477         void set_sort_column_id(int sort_column_id);
    00485
    00486         void set_sort_indicator(bool setting);
    00492
    00493         void set_sort_order(SortType order);
    00505
    00506         void cell_set_cell_data(const TreeModel& model, const TreeIter& iter, bool is_expander, bool is_expanded);
    00516
    00517         void focus_cell(CellRenderer& cell);
    00521
    00525
    00526         const VisiblePropertyProxy prop_visible()
    00527         {
    00528                 return VisiblePropertyProxy(this, &visible_property);
    00529         }
    00531
    00532         const ResizablePropertyProxy prop_resizable()
    00533         {
    00534                 return ResizablePropertyProxy(this, &resizable_property);
    00535         }
    00537
    00538         const WidthPropertyProxy prop_width()
    00539         {
    00540                 return WidthPropertyProxy(this, &width_property);
    00541         }
    00543
    00544         const SizingPropertyProxy prop_sizing()
    00545         {
    00546                 return SizingPropertyProxy(this, &sizing_property);
    00547         }
    00549
    00550         const FixedWidthPropertyProxy prop_fixed_width()
    00551         {
    00552                 return FixedWidthPropertyProxy(this, &fixed_width_property);
    00553         }
    00555
    00556         const MinWidthPropertyProxy prop_min_width()
    00557         {
    00558                 return MinWidthPropertyProxy(this, &min_width_property);
    00559         }
    00561
    00562         const MaxWidthPropertyProxy prop_max_width()
    00563         {
    00564                 return MaxWidthPropertyProxy(this, &max_width_property);
    00565         }
    00567
    00568         const TitlePropertyProxy prop_title()
    00569         {
    00570                 return TitlePropertyProxy(this, &title_property);
    00571         }
    00573
    00574         const ClickablePropertyProxy prop_clickable()
    00575         {
    00576                 return ClickablePropertyProxy(this, &clickable_property);
    00577         }
    00579
    00580         const WidgetPropertyProxy prop_widget()
    00581         {
    00582                 return WidgetPropertyProxy(this, &widget_property);
    00583         }
    00585
    00586         const AlignmentPropertyProxy prop_alignment()
    00587         {
    00588                 return AlignmentPropertyProxy(this, &alignment_property);
    00589         }
    00591
    00592         const ReorderablePropertyProxy prop_reorderable()
    00593         {
    00594                 return ReorderablePropertyProxy(this, &reorderable_property);
    00595         }
    00597
    00598         const SortIndicatorPropertyProxy prop_sort_indicator()
    00599         {
    00600                 return SortIndicatorPropertyProxy(this, &sort_indicator_property);
    00601         }
    00603
    00604         const SortOrderPropertyProxy prop_sort_order()
    00605         {
    00606                 return SortOrderPropertyProxy(this, &sort_order_property);
    00607         }
    00609
    00613
    00614         const ClickedSignalProxy sig_clicked()
    00615         {
    00616                 return ClickedSignalProxy(this, &clicked_signal);
    00617         }
    00619
    00621 };
    00622
    00623 } // namespace Gtk
    00624
    00625 } // namespace Inti
    00626
    00627 #endif // INTI_GTK_TREE_VIEW_COLUMN_H
    00628

Main Page - Footer