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