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