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