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  = GtkRecentChooser.html
27  * outPack = gtk
28  * outFile = RecentChooserIF
29  * strct   = GtkRecentChooser
30  * realStrct=
31  * ctorStrct=
32  * clss    = RecentChooserT
33  * interf  = RecentChooserIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_recent_chooser_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- glib.ErrorG
48  * 	- glib.GException
49  * 	- glib.ListG
50  * 	- glib.ListSG
51  * 	- gtk.RecentInfo
52  * 	- gtk.RecentFilter
53  * structWrap:
54  * 	- GList* -> ListG
55  * 	- GSList* -> ListSG
56  * 	- GtkRecentFilter* -> RecentFilter
57  * 	- GtkRecentInfo* -> RecentInfo
58  * module aliases:
59  * local aliases:
60  * 	- getShowNumbers -> recentChooserGetShowNumbers
61  * 	- setShowNumbers -> recentChooserSetShowNumbers
62  * overrides:
63  */
64 
65 module gtk.RecentChooserIF;
66 
67 public  import gtkc.gtktypes;
68 
69 private import gtkc.gtk;
70 private import glib.ConstructionException;
71 private import gobject.ObjectG;
72 
73 private import gobject.Signals;
74 public  import gtkc.gdktypes;
75 
76 private import glib.Str;
77 private import glib.ErrorG;
78 private import glib.GException;
79 private import glib.ListG;
80 private import glib.ListSG;
81 private import gtk.RecentInfo;
82 private import gtk.RecentFilter;
83 
84 
85 
86 
87 /**
88  * GtkRecentChooser is an interface that can be implemented by widgets
89  * displaying the list of recently used files. In GTK+, the main objects
90  * that implement this interface are GtkRecentChooserWidget,
91  * GtkRecentChooserDialog and GtkRecentChooserMenu.
92  *
93  * Recently used files are supported since GTK+ 2.10.
94  */
95 public interface RecentChooserIF
96 {
97 	
98 	
99 	public GtkRecentChooser* getRecentChooserTStruct();
100 	
101 	/** the main Gtk struct as a void* */
102 	protected void* getStruct();
103 	
104 	
105 	/**
106 	 */
107 	
108 	@property void delegate(RecentChooserIF)[] onItemActivatedListeners();
109 	/**
110 	 * This signal is emitted when the user "activates" a recent item
111 	 * in the recent chooser. This can happen by double-clicking on an item
112 	 * in the recently used resources list, or by pressing
113 	 * Enter.
114 	 * Since 2.10
115 	 */
116 	void addOnItemActivated(void delegate(RecentChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
117 	@property void delegate(RecentChooserIF)[] onSelectionChangedListeners();
118 	/**
119 	 * This signal is emitted when there is a change in the set of
120 	 * selected recently used resources. This can happen when a user
121 	 * modifies the selection with the mouse or the keyboard, or when
122 	 * explicitely calling functions to change the selection.
123 	 * Since 2.10
124 	 * See Also
125 	 * GtkRecentManager, GtkRecentChooserDialog,
126 	 *  GtkRecentChooserWidget, GtkRecentChooserMenu
127 	 */
128 	void addOnSelectionChanged(void delegate(RecentChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
129 	
130 	/**
131 	 * Whether to show recently used resources marked registered as private.
132 	 * Since 2.10
133 	 * Params:
134 	 * showPrivate = TRUE to show private items, FALSE otherwise
135 	 */
136 	public void setShowPrivate(int showPrivate);
137 	
138 	/**
139 	 * Returns whether chooser should display recently used resources
140 	 * registered as private.
141 	 * Since 2.10
142 	 * Returns: TRUE if the recent chooser should show private items, FALSE otherwise.
143 	 */
144 	public int getShowPrivate();
145 	
146 	/**
147 	 * Sets whether chooser should display the recently used resources that
148 	 * it didn't find. This only applies to local resources.
149 	 * Since 2.10
150 	 * Params:
151 	 * showNotFound = whether to show the local items we didn't find
152 	 */
153 	public void setShowNotFound(int showNotFound);
154 	
155 	/**
156 	 * Retrieves whether chooser should show the recently used resources that
157 	 * were not found.
158 	 * Since 2.10
159 	 * Returns: TRUE if the resources not found should be displayed, and FALSE otheriwse.
160 	 */
161 	public int getShowNotFound();
162 	
163 	/**
164 	 * Sets whether chooser should show an icon near the resource when
165 	 * displaying it.
166 	 * Since 2.10
167 	 * Params:
168 	 * showIcons = whether to show an icon near the resource
169 	 */
170 	public void setShowIcons(int showIcons);
171 	
172 	/**
173 	 * Retrieves whether chooser should show an icon near the resource.
174 	 * Since 2.10
175 	 * Returns: TRUE if the icons should be displayed, FALSE otherwise.
176 	 */
177 	public int getShowIcons();
178 	
179 	/**
180 	 * Sets whether chooser can select multiple items.
181 	 * Since 2.10
182 	 * Params:
183 	 * selectMultiple = TRUE if chooser can select more than one item
184 	 */
185 	public void setSelectMultiple(int selectMultiple);
186 	
187 	/**
188 	 * Gets whether chooser can select multiple items.
189 	 * Since 2.10
190 	 * Returns: TRUE if chooser can select more than one item.
191 	 */
192 	public int getSelectMultiple();
193 	
194 	/**
195 	 * Sets whether only local resources, that is resources using the file:// URI
196 	 * scheme, should be shown in the recently used resources selector. If
197 	 * local_only is TRUE (the default) then the shown resources are guaranteed
198 	 * to be accessible through the operating system native file system.
199 	 * Since 2.10
200 	 * Params:
201 	 * localOnly = TRUE if only local files can be shown
202 	 */
203 	public void setLocalOnly(int localOnly);
204 	
205 	/**
206 	 * Gets whether only local resources should be shown in the recently used
207 	 * resources selector. See gtk_recent_chooser_set_local_only()
208 	 * Since 2.10
209 	 * Returns: TRUE if only local resources should be shown.
210 	 */
211 	public int getLocalOnly();
212 	
213 	/**
214 	 * Sets the number of items that should be returned by
215 	 * gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().
216 	 * Since 2.10
217 	 * Params:
218 	 * limit = a positive integer, or -1 for all items
219 	 */
220 	public void setLimit(int limit);
221 	
222 	/**
223 	 * Gets the number of items returned by gtk_recent_chooser_get_items()
224 	 * and gtk_recent_chooser_get_uris().
225 	 * Since 2.10
226 	 * Returns: A positive integer, or -1 meaning that all items are returned.
227 	 */
228 	public int getLimit();
229 	
230 	/**
231 	 * Sets whether to show a tooltips containing the full path of each
232 	 * recently used resource in a GtkRecentChooser widget.
233 	 * Since 2.10
234 	 * Params:
235 	 * showTips = TRUE if tooltips should be shown
236 	 */
237 	public void setShowTips(int showTips);
238 	
239 	/**
240 	 * Gets whether chooser should display tooltips containing the full path
241 	 * of a recently user resource.
242 	 * Since 2.10
243 	 * Returns: TRUE if the recent chooser should show tooltips, FALSE otherwise.
244 	 */
245 	public int getShowTips();
246 	
247 	/**
248 	 * Changes the sorting order of the recently used resources list displayed by
249 	 * chooser.
250 	 * Since 2.10
251 	 * Params:
252 	 * sortType = sort order that the chooser should use
253 	 */
254 	public void setSortType(GtkRecentSortType sortType);
255 	
256 	/**
257 	 * Gets the value set by gtk_recent_chooser_set_sort_type().
258 	 * Since 2.10
259 	 * Returns: the sorting order of the chooser.
260 	 */
261 	public GtkRecentSortType getSortType();
262 	
263 	/**
264 	 * Sets the comparison function used when sorting to be sort_func. If
265 	 * the chooser has the sort type set to GTK_RECENT_SORT_CUSTOM then
266 	 * the chooser will sort using this function.
267 	 * To the comparison function will be passed two GtkRecentInfo structs and
268 	 * sort_data; sort_func should return a positive integer if the first
269 	 * item comes before the second, zero if the two items are equal and
270 	 * a negative integer if the first item comes after the second.
271 	 * Since 2.10
272 	 * Params:
273 	 * sortFunc = the comparison function
274 	 * sortData = user data to pass to sort_func, or NULL. [allow-none]
275 	 * dataDestroy = destroy notifier for sort_data, or NULL. [allow-none]
276 	 */
277 	public void setSortFunc(GtkRecentSortFunc sortFunc, void* sortData, GDestroyNotify dataDestroy);
278 	
279 	/**
280 	 * Sets uri as the current URI for chooser.
281 	 * Since 2.10
282 	 * Params:
283 	 * uri = a URI
284 	 * Returns: TRUE if the URI was found.
285 	 * Throws: GException on failure.
286 	 */
287 	public int setCurrentUri(string uri);
288 	
289 	/**
290 	 * Gets the URI currently selected by chooser.
291 	 * Since 2.10
292 	 * Returns: a newly allocated string holding a URI.
293 	 */
294 	public string getCurrentUri();
295 	
296 	/**
297 	 * Gets the GtkRecentInfo currently selected by chooser.
298 	 * Since 2.10
299 	 * Returns: a GtkRecentInfo. Use gtk_recent_info_unref() when when you have finished using it.
300 	 */
301 	public RecentInfo getCurrentItem();
302 	
303 	/**
304 	 * Selects uri inside chooser.
305 	 * Since 2.10
306 	 * Params:
307 	 * uri = a URI
308 	 * Returns: TRUE if uri was found.
309 	 * Throws: GException on failure.
310 	 */
311 	public int selectUri(string uri);
312 	
313 	/**
314 	 * Unselects uri inside chooser.
315 	 * Since 2.10
316 	 * Params:
317 	 * uri = a URI
318 	 */
319 	public void unselectUri(string uri);
320 	
321 	/**
322 	 * Selects all the items inside chooser, if the chooser supports
323 	 * multiple selection.
324 	 * Since 2.10
325 	 */
326 	public void selectAll();
327 	
328 	/**
329 	 * Unselects all the items inside chooser.
330 	 * Since 2.10
331 	 */
332 	public void unselectAll();
333 	
334 	/**
335 	 * Gets the list of recently used resources in form of GtkRecentInfo objects.
336 	 * The return value of this function is affected by the "sort-type" and
337 	 * "limit" properties of chooser.
338 	 * Since 2.10
339 	 * Returns: A newly allocated list of GtkRecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free(). [element-type GtkRecentInfo][transfer full]
340 	 */
341 	public ListG getItems();
342 	
343 	/**
344 	 * Gets the URI of the recently used resources.
345 	 * The return value of this function is affected by the "sort-type" and "limit"
346 	 * properties of chooser.
347 	 * Since the returned array is NULL terminated, length may be NULL.
348 	 * Since 2.10
349 	 * Returns: A newly allocated, NULL-terminated array of strings. Use g_strfreev() to free it. [array length=length zero-terminated=1][transfer full]
350 	 */
351 	public string[] getUris();
352 	
353 	/**
354 	 * Adds filter to the list of GtkRecentFilter objects held by chooser.
355 	 * If no previous filter objects were defined, this function will call
356 	 * gtk_recent_chooser_set_filter().
357 	 * Since 2.10
358 	 * Params:
359 	 * filter = a GtkRecentFilter
360 	 */
361 	public void addFilter(RecentFilter filter);
362 	
363 	/**
364 	 * Removes filter from the list of GtkRecentFilter objects held by chooser.
365 	 * Since 2.10
366 	 * Params:
367 	 * filter = a GtkRecentFilter
368 	 */
369 	public void removeFilter(RecentFilter filter);
370 	
371 	/**
372 	 * Gets the GtkRecentFilter objects held by chooser.
373 	 * Since 2.10
374 	 * Returns: A singly linked list of GtkRecentFilter objects. You should just free the returned list using g_slist_free(). [element-type GtkRecentFilter][transfer container]
375 	 */
376 	public ListSG listFilters();
377 	
378 	/**
379 	 * Sets filter as the current GtkRecentFilter object used by chooser
380 	 * to affect the displayed recently used resources.
381 	 * Since 2.10
382 	 * Params:
383 	 * filter = a GtkRecentFilter. [allow-none]
384 	 */
385 	public void setFilter(RecentFilter filter);
386 	
387 	/**
388 	 * Gets the GtkRecentFilter object currently used by chooser to affect
389 	 * the display of the recently used resources.
390 	 * Since 2.10
391 	 * Returns: a GtkRecentFilter object. [transfer none]
392 	 */
393 	public RecentFilter getFilter();
394 }