gtk.recent_chooser_mixin

Module for [RecentChooser] interface mixin

Templates 2

tmplRecentChooserT()

#GtkRecentChooser is an interface that can be implemented by widgets displaying the list of recently used files. In GTK+, the main objects that implement this interface are #GtkRecentChooserWidget, #GtkRecentChooserDialog and #GtkRecentChooserMenu.

Recently used files are supported since GTK+ 2.10.

Functions

Get filter property.

Returns

The #GtkRecentFilter object to be used when displaying

the recently used resources.

void filter(gtk.recent_filter.RecentFilter propval)

Set filter property.

Parameters

propvalThe #GtkRecentFilter object to be used when displaying the recently used resources.
int limit()

Get limit property.

Returns

The maximum number of recently used resources to be displayed,

or -1 to display all items.

void limit(int propval)

Set limit property.

Parameters

propvalThe maximum number of recently used resources to be displayed, or -1 to display all items.
bool localOnly()

Get localOnly property.

Returns

Whether this #GtkRecentChooser should display only local (file:)

resources.

void localOnly(bool propval)

Set localOnly property.

Parameters

propvalWhether this #GtkRecentChooser should display only local (file:) resources.
bool selectMultiple()

Get selectMultiple property.

Returns

Allow the user to select multiple resources.
void selectMultiple(bool propval)

Set selectMultiple property.

Parameters

propvalAllow the user to select multiple resources.
bool showIcons()

Get showIcons property.

Returns

Whether this #GtkRecentChooser should display an icon near the item.
void showIcons(bool propval)

Set showIcons property.

Parameters

propvalWhether this #GtkRecentChooser should display an icon near the item.
bool showNotFound()

Get showNotFound property.

Returns

Whether this #GtkRecentChooser should display the recently used resources

even if not present anymore. Setting this to false will perform a potentially expensive check on every local resource (every remote resource will always be displayed).

void showNotFound(bool propval)

Set showNotFound property.

Parameters

propvalWhether this #GtkRecentChooser should display the recently used resources even if not present anymore. Setting this to false will perform a potentially expensive check on every local resource (every remote resource will always be displayed).
bool showPrivate()
void showPrivate(bool propval)
bool showTips()

Get showTips property.

Returns

Whether this #GtkRecentChooser should display a tooltip containing the

full path of the recently used resources.

void showTips(bool propval)

Set showTips property.

Parameters

propvalWhether this #GtkRecentChooser should display a tooltip containing the full path of the recently used resources.

Get sortType property.

Returns

Sorting order to be used when displaying the recently used resources.
void sortType(gtk.types.RecentSortType propval)

Set sortType property.

Parameters

propvalSorting order to be used when displaying the recently used resources.
void addFilter(gtk.recent_filter.RecentFilter filter)

Adds filter to the list of #GtkRecentFilter objects held by chooser.

If no previous filter objects were defined, this function will call [gtk.recent_chooser.RecentChooser.setFilter].

Parameters

filtera #GtkRecentFilter

Gets the #GtkRecentInfo currently selected by chooser.

Returns

a #GtkRecentInfo. Use [gtk.recent_info.RecentInfo.unref] when

when you have finished using it.

string getCurrentUri()

Gets the URI currently selected by chooser.

Returns

a newly allocated string holding a URI.

Gets the #GtkRecentFilter object currently used by chooser to affect the display of the recently used resources.

Returns

a #GtkRecentFilter object.

Gets the list of recently used resources in form of #GtkRecentInfo objects.

The return value of this function is affected by the “sort-type” and “limit” properties of chooser.

Returns

A newly allocated

list of #GtkRecentInfo objects. You should use [gtk.recent_info.RecentInfo.unref] on every item of the list, and then free the list itself using [glib.list.List.free].

int getLimit()

Gets the number of items returned by [gtk.recent_chooser.RecentChooser.getItems] and [gtk.recent_chooser.RecentChooser.getUris].

Returns

A positive integer, or -1 meaning that all items are

returned.

bool getLocalOnly()

Gets whether only local resources should be shown in the recently used resources selector. See [gtk.recent_chooser.RecentChooser.setLocalOnly]

Returns

true if only local resources should be shown.
bool getSelectMultiple()

Gets whether chooser can select multiple items.

Returns

true if chooser can select more than one item.
bool getShowIcons()

Retrieves whether chooser should show an icon near the resource.

Returns

true if the icons should be displayed, false otherwise.
bool getShowNotFound()

Retrieves whether chooser should show the recently used resources that were not found.

Returns

true if the resources not found should be displayed, and

false otheriwse.

bool getShowPrivate()

Returns whether chooser should display recently used resources registered as private.

Returns

true if the recent chooser should show private items,

false otherwise.

bool getShowTips()

Gets whether chooser should display tooltips containing the full path of a recently user resource.

Returns

true if the recent chooser should show tooltips,

false otherwise.

Gets the value set by [gtk.recent_chooser.RecentChooser.setSortType].

Returns

the sorting order of the chooser.
string[] getUris()

Gets the URI of the recently used resources.

The return value of this function is affected by the “sort-type” and “limit” properties of chooser.

Since the returned array is null terminated, length may be null.

Returns

A newly allocated, null-terminated array of strings. Use

[glib.global.strfreev] to free it.

Gets the #GtkRecentFilter objects held by chooser.

Returns

A singly linked list

of #GtkRecentFilter objects. You should just free the returned list using [glib.slist.SList.free].

void removeFilter(gtk.recent_filter.RecentFilter filter)

Removes filter from the list of #GtkRecentFilter objects held by chooser.

Parameters

filtera #GtkRecentFilter
void selectAll()

Selects all the items inside chooser, if the chooser supports multiple selection.

bool selectUri(string uri)

Selects uri inside chooser.

Parameters

uria URI

Returns

true if uri was found.

Throws

[ErrorWrap]
bool setCurrentUri(string uri)

Sets uri as the current URI for chooser.

Parameters

uria URI

Returns

true if the URI was found.

Throws

[ErrorWrap]
void setFilter(gtk.recent_filter.RecentFilter filter = null)

Sets filter as the current #GtkRecentFilter object used by chooser to affect the displayed recently used resources.

Parameters

filtera #GtkRecentFilter
void setLimit(int limit)

Sets the number of items that should be returned by [gtk.recent_chooser.RecentChooser.getItems] and [gtk.recent_chooser.RecentChooser.getUris].

Parameters

limita positive integer, or -1 for all items
void setLocalOnly(bool localOnly)

Sets whether only local resources, that is resources using the file:// URI scheme, should be shown in the recently used resources selector. If local_only is true (the default) then the shown resources are guaranteed to be accessible through the operating system native file system.

Parameters

localOnlytrue if only local files can be shown
void setSelectMultiple(bool selectMultiple)

Sets whether chooser can select multiple items.

Parameters

selectMultipletrue if chooser can select more than one item
void setShowIcons(bool showIcons)

Sets whether chooser should show an icon near the resource when displaying it.

Parameters

showIconswhether to show an icon near the resource
void setShowNotFound(bool showNotFound)

Sets whether chooser should display the recently used resources that it didn’t find. This only applies to local resources.

Parameters

showNotFoundwhether to show the local items we didn’t find
void setShowPrivate(bool showPrivate)

Whether to show recently used resources marked registered as private.

Parameters

showPrivatetrue to show private items, false otherwise
void setShowTips(bool showTips)

Sets whether to show a tooltips containing the full path of each recently used resource in a #GtkRecentChooser widget.

Parameters

showTipstrue if tooltips should be shown
void setSortFunc(gtk.types.RecentSortFunc sortFunc)

Sets the comparison function used when sorting to be sort_func. If the chooser has the sort type set to #GTK_RECENT_SORT_CUSTOM then the chooser will sort using this function.

To the comparison function will be passed two #GtkRecentInfo structs and sort_data; sort_func should return a positive integer if the first item comes before the second, zero if the two items are equal and a negative integer if the first item comes after the second.

Parameters

sortFuncthe comparison function
void setSortType(gtk.types.RecentSortType sortType)

Changes the sorting order of the recently used resources list displayed by chooser.

Parameters

sortTypesort order that the chooser should use
void unselectAll()

Unselects all the items inside chooser.

void unselectUri(string uri)

Unselects uri inside chooser.

Parameters

uria URI
gulong connectItemActivated(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.recent_chooser.RecentChooser))) && Parameters!T.length < 2)

Connect to ItemActivated signal.

This signal is emitted when the user "activates" a recent item in the recent chooser. This can happen by double-clicking on an item in the recently used resources list, or by pressing Enter.

Parameters

callbacksignal callback delegate or function to connect void callback(gtk.recent_chooser.RecentChooser recentChooser) recentChooser the instance the signal is connected to (optional)
afterYes.After to execute callback after default handler, No.After to execute before (default)

Returns

Signal ID
gulong connectSelectionChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.recent_chooser.RecentChooser))) && Parameters!T.length < 2)

Connect to SelectionChanged signal.

This signal is emitted when there is a change in the set of selected recently used resources. This can happen when a user modifies the selection with the mouse or the keyboard, or when explicitly calling functions to change the selection.

Parameters

callbacksignal callback delegate or function to connect void callback(gtk.recent_chooser.RecentChooser recentChooser) recentChooser the instance the signal is connected to (optional)
afterYes.After to execute callback after default handler, No.After to execute before (default)

Returns

Signal ID
tmplRecentChooserGidBuilderT()
Functions

Set filter property.

Parameters

propvalThe #GtkRecentFilter object to be used when displaying the recently used resources.

Returns

Builder instance for fluent chaining
T limit(int propval)

Set limit property.

Parameters

propvalThe maximum number of recently used resources to be displayed, or -1 to display all items.

Returns

Builder instance for fluent chaining
T localOnly(bool propval)

Set localOnly property.

Parameters

propvalWhether this #GtkRecentChooser should display only local (file:) resources.

Returns

Builder instance for fluent chaining
T recentManager(gtk.recent_manager.RecentManager propval)

Set recentManager property.

Parameters

propvalThe #GtkRecentManager instance used by the #GtkRecentChooser to display the list of recently used resources.

Returns

Builder instance for fluent chaining
T selectMultiple(bool propval)

Set selectMultiple property.

Parameters

propvalAllow the user to select multiple resources.

Returns

Builder instance for fluent chaining
T showIcons(bool propval)

Set showIcons property.

Parameters

propvalWhether this #GtkRecentChooser should display an icon near the item.

Returns

Builder instance for fluent chaining
T showNotFound(bool propval)

Set showNotFound property.

Parameters

propvalWhether this #GtkRecentChooser should display the recently used resources even if not present anymore. Setting this to false will perform a potentially expensive check on every local resource (every remote resource will always be displayed).

Returns

Builder instance for fluent chaining
T showPrivate(bool propval)
T showTips(bool propval)

Set showTips property.

Parameters

propvalWhether this #GtkRecentChooser should display a tooltip containing the full path of the recently used resources.

Returns

Builder instance for fluent chaining
T sortType(gtk.types.RecentSortType propval)

Set sortType property.

Parameters

propvalSorting order to be used when displaying the recently used resources.

Returns

Builder instance for fluent chaining