1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.TreeSortableIF;
26 
27 private import gobject.Signals;
28 public  import gtkc.gdktypes;
29 private import gtkc.gtk;
30 public  import gtkc.gtktypes;
31 
32 
33 /**
34  * #GtkTreeSortable is an interface to be implemented by tree models which
35  * support sorting. The #GtkTreeView uses the methods provided by this interface
36  * to sort the model.
37  */
38 public interface TreeSortableIF{
39 	/** Get the main Gtk struct */
40 	public GtkTreeSortable* getTreeSortableStruct();
41 
42 	/** the main Gtk struct as a void* */
43 	protected void* getStruct();
44 
45 	/**
46 	 */
47 
48 	/**
49 	 * Fills in @sort_column_id and @order with the current sort column and the
50 	 * order. It returns %TRUE unless the @sort_column_id is
51 	 * %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
52 	 * %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
53 	 *
54 	 * Params:
55 	 *     sortColumnId = The sort column id to be filled in
56 	 *     order = The #GtkSortType to be filled in
57 	 *
58 	 * Return: %TRUE if the sort column is not one of the special sort
59 	 *     column ids.
60 	 */
61 	public bool getSortColumnId(out int sortColumnId, out GtkSortType order);
62 
63 	/**
64 	 * Returns %TRUE if the model has a default sort function. This is used
65 	 * primarily by GtkTreeViewColumns in order to determine if a model can
66 	 * go back to the default state, or not.
67 	 *
68 	 * Return: %TRUE, if the model has a default sort function
69 	 */
70 	public bool hasDefaultSortFunc();
71 
72 	/**
73 	 * Sets the default comparison function used when sorting to be @sort_func.
74 	 * If the current sort column id of @sortable is
75 	 * %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
76 	 * this function.
77 	 *
78 	 * If @sort_func is %NULL, then there will be no default comparison function.
79 	 * This means that once the model  has been sorted, it can’t go back to the
80 	 * default state. In this case, when the current sort column id of @sortable
81 	 * is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
82 	 *
83 	 * Params:
84 	 *     sortFunc = The comparison function
85 	 *     userData = User data to pass to @sort_func, or %NULL
86 	 *     destroy = Destroy notifier of @user_data, or %NULL
87 	 */
88 	public void setDefaultSortFunc(GtkTreeIterCompareFunc sortFunc, void* userData, GDestroyNotify destroy);
89 
90 	/**
91 	 * Sets the current sort column to be @sort_column_id. The @sortable will
92 	 * resort itself to reflect this change, after emitting a
93 	 * #GtkTreeSortable::sort-column-changed signal. @sort_column_id may either be
94 	 * a regular column id, or one of the following special values:
95 	 *
96 	 * - %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function
97 	 * will be used, if it is set
98 	 *
99 	 * - %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
100 	 *
101 	 * Params:
102 	 *     sortColumnId = the sort column id to set
103 	 *     order = The sort order of the column
104 	 */
105 	public void setSortColumnId(int sortColumnId, GtkSortType order);
106 
107 	/**
108 	 * Sets the comparison function used when sorting to be @sort_func. If the
109 	 * current sort column id of @sortable is the same as @sort_column_id, then
110 	 * the model will sort using this function.
111 	 *
112 	 * Params:
113 	 *     sortColumnId = the sort column id to set the function for
114 	 *     sortFunc = The comparison function
115 	 *     userData = User data to pass to @sort_func, or %NULL
116 	 *     destroy = Destroy notifier of @user_data, or %NULL
117 	 */
118 	public void setSortFunc(int sortColumnId, GtkTreeIterCompareFunc sortFunc, void* userData, GDestroyNotify destroy);
119 
120 	/**
121 	 * Emits a #GtkTreeSortable::sort-column-changed signal on @sortable.
122 	 */
123 	public void sortColumnChanged();
124 	@property void delegate(TreeSortableIF)[] onSortColumnChangedListeners();
125 	/**
126 	 * The ::sort-column-changed signal is emitted when the sort column
127 	 * or sort order of @sortable is changed. The signal is emitted before
128 	 * the contents of @sortable are resorted.
129 	 */
130 	void addOnSortColumnChanged(void delegate(TreeSortableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
131 
132 }