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  * Conversion parameters:
26  * inFile  = GtkTreeSortable.html
27  * outPack = gtk
28  * outFile = TreeSortableIF
29  * strct   = GtkTreeSortable
30  * realStrct=
31  * ctorStrct=
32  * clss    = TreeSortableT
33  * interf  = TreeSortableIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_tree_sortable_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * structWrap:
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gtk.TreeSortableIF;
54 
55 public  import gtkc.gtktypes;
56 
57 private import gtkc.gtk;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 private import gobject.Signals;
62 public  import gtkc.gdktypes;
63 
64 
65 
66 
67 
68 /**
69  * Description
70  * GtkTreeSortable is an interface to be implemented by tree models which
71  * support sorting. The GtkTreeView uses the methods provided by this interface
72  * to sort the model.
73  */
74 public interface TreeSortableIF
75 {
76 	
77 	
78 	public GtkTreeSortable* getTreeSortableTStruct();
79 	
80 	/** the main Gtk struct as a void* */
81 	protected void* getStruct();
82 	
83 	
84 	/**
85 	 */
86 	
87 	void delegate(TreeSortableIF)[] onSortColumnChangedListeners();
88 	/**
89 	 * The ::sort-column-changed signal is emitted when the sort column
90 	 * or sort order of sortable is changed. The signal is emitted before
91 	 * the contents of sortable are resorted.
92 	 * See Also
93 	 * GtkTreeModel, GtkTreeView
94 	 */
95 	void addOnSortColumnChanged(void delegate(TreeSortableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
96 	
97 	/**
98 	 * Emits a "sort-column-changed" signal on sortable.
99 	 */
100 	public void sortColumnChanged();
101 	
102 	/**
103 	 * Fills in sort_column_id and order with the current sort column and the
104 	 * order. It returns TRUE unless the sort_column_id is
105 	 * GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
106 	 * GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
107 	 * Params:
108 	 * sortColumnId = The sort column id to be filled in
109 	 * order = The GtkSortType to be filled in
110 	 * Returns: TRUE if the sort column is not one of the special sort column ids.
111 	 */
112 	public int getSortColumnId(out int sortColumnId, out GtkSortType order);
113 	
114 	/**
115 	 * Sets the current sort column to be sort_column_id. The sortable will
116 	 * resort itself to reflect this change, after emitting a
117 	 * "sort-column-changed" signal. sort_column_id may either be
118 	 * Params:
119 	 * sortColumnId = the sort column id to set
120 	 * order = The sort order of the column
121 	 */
122 	public void setSortColumnId(int sortColumnId, GtkSortType order);
123 	
124 	/**
125 	 * Sets the comparison function used when sorting to be sort_func. If the
126 	 * current sort column id of sortable is the same as sort_column_id, then
127 	 * the model will sort using this function.
128 	 * Params:
129 	 * sortColumnId = the sort column id to set the function for
130 	 * sortFunc = The comparison function
131 	 * userData = User data to pass to sort_func, or NULL. [allow-none]
132 	 * destroy = Destroy notifier of user_data, or NULL. [allow-none]
133 	 */
134 	public void setSortFunc(int sortColumnId, GtkTreeIterCompareFunc sortFunc, void* userData, GDestroyNotify destroy);
135 	
136 	/**
137 	 * Sets the default comparison function used when sorting to be sort_func.
138 	 * If the current sort column id of sortable is
139 	 * GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
140 	 * this function.
141 	 * If sort_func is NULL, then there will be no default comparison function.
142 	 * This means that once the model has been sorted, it can't go back to the
143 	 * default state. In this case, when the current sort column id of sortable
144 	 * is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
145 	 * Params:
146 	 * sortFunc = The comparison function
147 	 * userData = User data to pass to sort_func, or NULL. [allow-none]
148 	 * destroy = Destroy notifier of user_data, or NULL. [allow-none]
149 	 */
150 	public void setDefaultSortFunc(GtkTreeIterCompareFunc sortFunc, void* userData, GDestroyNotify destroy);
151 	
152 	/**
153 	 * Returns TRUE if the model has a default sort function. This is used
154 	 * primarily by GtkTreeViewColumns in order to determine if a model can
155 	 * go back to the default state, or not.
156 	 * Returns: TRUE, if the model has a default sort function Signal Details The "sort-column-changed" signal void user_function (GtkTreeSortable *sortable, gpointer user_data) : Run Last The ::sort-column-changed signal is emitted when the sort column or sort order of sortable is changed. The signal is emitted before the contents of sortable are resorted.
157 	 */
158 	public int hasDefaultSortFunc();
159 }