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