Reference Manual

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

# treesortable.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_SORTABLE_H
    00026 #define INTI_GTK_TREE_SORTABLE_H
    00027
    00028 #ifndef INTI_G_TYPE_H
    00029 #include <inti/glib/type.h>
    00030 #endif
    00031
    00032 #ifndef INTI_GTK_ENUMS_H
    00033 #include <inti/gtk/enums.h>
    00034 #endif
    00035
    00036 #ifndef __GTK_TREE_SORTABLE_H__
    00037 #include <gtk/gtktreesortable.h>
    00038 #endif
    00039
    00040 #ifndef INTI_SLOT_H
    00041 #include <inti/slot.h>
    00042 #endif
    00043
    00044 namespace Inti {
    00045
    00046 namespace Gtk {
    00047
    00048 class TreeIter;
    00049 class TreeModel;
    00050 class TreeSortableIface;
    00051
    00060
    00061 class TreeSortable : public virtual G::TypeInterface
    00062 {
    00063         friend class TreeSortableIface;
    00064
    00065 protected:
    00068
    00069         virtual ~TreeSortable() = 0;
    00071
    00073 //  Override these do_ methods when you want to change the default behaviour of the GtkTreeSortable.
    00074
    00075         virtual bool do_get_sort_column_id(int *sort_column_id, GtkSortType *order);
    00076
    00077         virtual void do_set_sort_column_id(int sort_column_id, GtkSortType order);
    00078
    00079         virtual void do_set_sort_func(int sort_column_id, GtkTreeIterCompareFunc func, void *data, GtkDestroyNotify destroy);
    00080
    00081         virtual void do_set_default_sort_func(GtkTreeIterCompareFunc func, void *data, GtkDestroyNotify destroy);
    00082
    00083         virtual bool do_has_default_sort_func();
    00084
    00087
    00088         virtual void on_sort_column_changed();
    00090
    00092 //  Signals
    00093
    00094         typedef G::Signal0<void> SortColumnChangedSignalType;
    00095         typedef G::SignalProxy<TypeInstance, SortColumnChangedSignalType> SortColumnChangedSignalProxy;
    00096         static const SortColumnChangedSignalType sort_column_changed_signal;
    00097
    00098 public:
    00099         typedef Slot3<int, const TreeModel&, const TreeIter*, const TreeIter*> TreeIterCompareSlot;
    00111
    00114
    00115         GtkTreeSortable* gtk_tree_sortable() const { return (GtkTreeSortable*)instance; }
    00117
    00118         GtkTreeSortableIface* gtk_tree_sortable_iface() const;
    00120
    00121         operator GtkTreeSortable* () const;
    00123
    00124         bool get_sort_column_id(int *sort_column_id, SortType *order) const;
    00133
    00134         bool has_default_sort_func() const;
    00140
    00144
    00145         void sort_column_changed();
    00147
    00148         void set_sort_column_id(int sort_column_id, SortType order);
    00157
    00158         void set_sort_func(int sort_column_id, const TreeIterCompareSlot *compare);
    00165
    00166         void set_default_sort_func(const TreeIterCompareSlot *compare);
    00175
    00179
    00180         const SortColumnChangedSignalProxy sig_sort_column_changed()
    00181         {
    00182                 return SortColumnChangedSignalProxy(this, &sort_column_changed_signal);
    00183         }
    00185
    00187 };
    00188
    00189 } // namespace Gtk
    00190
    00191 } // namespace Inti
    00192
    00193 #endif // INTI_GTK_TREE_SORTABLE_H
    00194

Main Page - Footer