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 	 * Return: A newly allocated, %NULL-terminated array of strings. Use
206 	 *     g_strfreev() to free it.
207 	 *
208 	 * Since: 2.10
209 	 */
210 	public string[] getUris();
211 
212 	/**
213 	 * Gets the #GtkRecentFilter objects held by @chooser.
214 	 *
215 	 * Return: A singly linked list
216 	 *     of #GtkRecentFilter objects.  You
217 	 *     should just free the returned list using g_slist_free().
218 	 *
219 	 * Since: 2.10
220 	 */
221 	public ListSG listFilters();
222 
223 	/**
224 	 * Removes @filter from the list of #GtkRecentFilter objects held by @chooser.
225 	 *
226 	 * Params:
227 	 *     filter = a #GtkRecentFilter
228 	 *
229 	 * Since: 2.10
230 	 */
231 	public void removeFilter(RecentFilter filter);
232 
233 	/**
234 	 * Selects all the items inside @chooser, if the @chooser supports
235 	 * multiple selection.
236 	 *
237 	 * Since: 2.10
238 	 */
239 	public void selectAll();
240 
241 	/**
242 	 * Selects @uri inside @chooser.
243 	 *
244 	 * Params:
245 	 *     uri = a URI
246 	 *
247 	 * Return: %TRUE if @uri was found.
248 	 *
249 	 * Since: 2.10
250 	 *
251 	 * Throws: GException on failure.
252 	 */
253 	public bool selectUri(string uri);
254 
255 	/**
256 	 * Sets @uri as the current URI for @chooser.
257 	 *
258 	 * Params:
259 	 *     uri = a URI
260 	 *
261 	 * Return: %TRUE if the URI was found.
262 	 *
263 	 * Since: 2.10
264 	 *
265 	 * Throws: GException on failure.
266 	 */
267 	public bool setCurrentUri(string uri);
268 
269 	/**
270 	 * Sets @filter as the current #GtkRecentFilter object used by @chooser
271 	 * to affect the displayed recently used resources.
272 	 *
273 	 * Params:
274 	 *     filter = a #GtkRecentFilter
275 	 *
276 	 * Since: 2.10
277 	 */
278 	public void setFilter(RecentFilter filter);
279 
280 	/**
281 	 * Sets the number of items that should be returned by
282 	 * gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().
283 	 *
284 	 * Params:
285 	 *     limit = a positive integer, or -1 for all items
286 	 *
287 	 * Since: 2.10
288 	 */
289 	public void setLimit(int limit);
290 
291 	/**
292 	 * Sets whether only local resources, that is resources using the file:// URI
293 	 * scheme, should be shown in the recently used resources selector.  If
294 	 * @local_only is %TRUE (the default) then the shown resources are guaranteed
295 	 * to be accessible through the operating system native file system.
296 	 *
297 	 * Params:
298 	 *     localOnly = %TRUE if only local files can be shown
299 	 *
300 	 * Since: 2.10
301 	 */
302 	public void setLocalOnly(bool localOnly);
303 
304 	/**
305 	 * Sets whether @chooser can select multiple items.
306 	 *
307 	 * Params:
308 	 *     selectMultiple = %TRUE if @chooser can select more than one item
309 	 *
310 	 * Since: 2.10
311 	 */
312 	public void setSelectMultiple(bool selectMultiple);
313 
314 	/**
315 	 * Sets whether @chooser should show an icon near the resource when
316 	 * displaying it.
317 	 *
318 	 * Params:
319 	 *     showIcons = whether to show an icon near the resource
320 	 *
321 	 * Since: 2.10
322 	 */
323 	public void setShowIcons(bool showIcons);
324 
325 	/**
326 	 * Sets whether @chooser should display the recently used resources that
327 	 * it didn’t find.  This only applies to local resources.
328 	 *
329 	 * Params:
330 	 *     showNotFound = whether to show the local items we didn’t find
331 	 *
332 	 * Since: 2.10
333 	 */
334 	public void setShowNotFound(bool showNotFound);
335 
336 	/**
337 	 * Whether to show recently used resources marked registered as private.
338 	 *
339 	 * Params:
340 	 *     showPrivate = %TRUE to show private items, %FALSE otherwise
341 	 *
342 	 * Since: 2.10
343 	 */
344 	public void setShowPrivate(bool showPrivate);
345 
346 	/**
347 	 * Sets whether to show a tooltips containing the full path of each
348 	 * recently used resource in a #GtkRecentChooser widget.
349 	 *
350 	 * Params:
351 	 *     showTips = %TRUE if tooltips should be shown
352 	 *
353 	 * Since: 2.10
354 	 */
355 	public void setShowTips(bool showTips);
356 
357 	/**
358 	 * Sets the comparison function used when sorting to be @sort_func.  If
359 	 * the @chooser has the sort type set to #GTK_RECENT_SORT_CUSTOM then
360 	 * the chooser will sort using this function.
361 	 *
362 	 * To the comparison function will be passed two #GtkRecentInfo structs and
363 	 * @sort_data;  @sort_func should return a positive integer if the first
364 	 * item comes before the second, zero if the two items are equal and
365 	 * a negative integer if the first item comes after the second.
366 	 *
367 	 * Params:
368 	 *     sortFunc = the comparison function
369 	 *     sortData = user data to pass to @sort_func, or %NULL
370 	 *     dataDestroy = destroy notifier for @sort_data, or %NULL
371 	 *
372 	 * Since: 2.10
373 	 */
374 	public void setSortFunc(GtkRecentSortFunc sortFunc, void* sortData, GDestroyNotify dataDestroy);
375 
376 	/**
377 	 * Changes the sorting order of the recently used resources list displayed by
378 	 * @chooser.
379 	 *
380 	 * Params:
381 	 *     sortType = sort order that the chooser should use
382 	 *
383 	 * Since: 2.10
384 	 */
385 	public void setSortType(GtkRecentSortType sortType);
386 
387 	/**
388 	 * Unselects all the items inside @chooser.
389 	 *
390 	 * Since: 2.10
391 	 */
392 	public void unselectAll();
393 
394 	/**
395 	 * Unselects @uri inside @chooser.
396 	 *
397 	 * Params:
398 	 *     uri = a URI
399 	 *
400 	 * Since: 2.10
401 	 */
402 	public void unselectUri(string uri);
403 	@property void delegate(RecentChooserIF)[] onItemActivatedListeners();
404 	/**
405 	 * This signal is emitted when the user "activates" a recent item
406 	 * in the recent chooser.  This can happen by double-clicking on an item
407 	 * in the recently used resources list, or by pressing
408 	 * `Enter`.
409 	 *
410 	 * Since: 2.10
411 	 */
412 	void addOnItemActivated(void delegate(RecentChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
413 
414 	@property void delegate(RecentChooserIF)[] onSelectionChangedListeners();
415 	/**
416 	 * This signal is emitted when there is a change in the set of
417 	 * selected recently used resources.  This can happen when a user
418 	 * modifies the selection with the mouse or the keyboard, or when
419 	 * explicitly calling functions to change the selection.
420 	 *
421 	 * Since: 2.10
422 	 */
423 	void addOnSelectionChanged(void delegate(RecentChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
424 
425 }