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