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