| Top |
| CtkRecentFilter * | filter | Read / Write |
| int | limit | Read / Write |
| gboolean | local-only | Read / Write |
| CtkRecentManager * | recent-manager | Write / Construct Only |
| gboolean | select-multiple | Read / Write |
| gboolean | show-icons | Read / Write |
| gboolean | show-not-found | Read / Write |
| gboolean | show-private | Read / Write |
| gboolean | show-tips | Read / Write |
| CtkRecentSortType | sort-type | Read / Write |
| CtkRecentChooser | |
| struct | CtkRecentChooserIface |
| #define | CTK_RECENT_CHOOSER_ERROR |
| enum | CtkRecentChooserError |
| enum | CtkRecentSortType |
CtkRecentChooser is implemented by CtkRecentAction, CtkRecentChooserDialog, CtkRecentChooserMenu and CtkRecentChooserWidget.
CtkRecentChooser is an interface that can be implemented by widgets displaying the list of recently used files. In CTK+, the main objects that implement this interface are CtkRecentChooserWidget, CtkRecentChooserDialog and CtkRecentChooserMenu.
Recently used files are supported since CTK+ 2.10.
void ctk_recent_chooser_set_show_private (CtkRecentChooser *chooser,gboolean show_private);
Whether to show recently used resources marked registered as private.
Since: 2.10
gboolean
ctk_recent_chooser_get_show_private (CtkRecentChooser *chooser);
Returns whether chooser
should display recently used resources
registered as private.
Since: 2.10
void ctk_recent_chooser_set_show_not_found (CtkRecentChooser *chooser,gboolean show_not_found);
Sets whether chooser
should display the recently used resources that
it didn’t find. This only applies to local resources.
Since: 2.10
gboolean
ctk_recent_chooser_get_show_not_found (CtkRecentChooser *chooser);
Retrieves whether chooser
should show the recently used resources that
were not found.
Since: 2.10
void ctk_recent_chooser_set_show_icons (CtkRecentChooser *chooser,gboolean show_icons);
Sets whether chooser
should show an icon near the resource when
displaying it.
Since: 2.10
gboolean
ctk_recent_chooser_get_show_icons (CtkRecentChooser *chooser);
Retrieves whether chooser
should show an icon near the resource.
Since: 2.10
void ctk_recent_chooser_set_select_multiple (CtkRecentChooser *chooser,gboolean select_multiple);
Sets whether chooser
can select multiple items.
Since: 2.10
gboolean
ctk_recent_chooser_get_select_multiple
(CtkRecentChooser *chooser);
Gets whether chooser
can select multiple items.
Since: 2.10
void ctk_recent_chooser_set_local_only (CtkRecentChooser *chooser,gboolean local_only);
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.
Since: 2.10
gboolean
ctk_recent_chooser_get_local_only (CtkRecentChooser *chooser);
Gets whether only local resources should be shown in the recently used
resources selector. See ctk_recent_chooser_set_local_only()
Since: 2.10
void ctk_recent_chooser_set_limit (CtkRecentChooser *chooser,gint limit);
Sets the number of items that should be returned by
ctk_recent_chooser_get_items() and ctk_recent_chooser_get_uris().
Since: 2.10
gint
ctk_recent_chooser_get_limit (CtkRecentChooser *chooser);
Gets the number of items returned by ctk_recent_chooser_get_items()
and ctk_recent_chooser_get_uris().
Since: 2.10
void ctk_recent_chooser_set_show_tips (CtkRecentChooser *chooser,gboolean show_tips);
Sets whether to show a tooltips containing the full path of each recently used resource in a CtkRecentChooser widget.
Since: 2.10
gboolean
ctk_recent_chooser_get_show_tips (CtkRecentChooser *chooser);
Gets whether chooser
should display tooltips containing the full path
of a recently user resource.
Since: 2.10
void ctk_recent_chooser_set_sort_type (CtkRecentChooser *chooser,CtkRecentSortType sort_type);
Changes the sorting order of the recently used resources list displayed by
chooser
.
Since: 2.10
CtkRecentSortType
ctk_recent_chooser_get_sort_type (CtkRecentChooser *chooser);
Gets the value set by ctk_recent_chooser_set_sort_type().
Since: 2.10
gint (*CtkRecentSortFunc) (CtkRecentInfo *a,CtkRecentInfo *b,gpointer user_data);
void ctk_recent_chooser_set_sort_func (CtkRecentChooser *chooser,CtkRecentSortFunc sort_func,gpointer sort_data,GDestroyNotify data_destroy);
Sets the comparison function used when sorting to be sort_func
. If
the chooser
has the sort type set to CTK_RECENT_SORT_CUSTOM then
the chooser will sort using this function.
To the comparison function will be passed two CtkRecentInfo 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.
chooser |
||
sort_func |
the comparison function |
|
sort_data |
user data to pass to |
[allow-none] |
data_destroy |
destroy notifier for |
[allow-none] |
Since: 2.10
gboolean ctk_recent_chooser_set_current_uri (CtkRecentChooser *chooser,const gchar *uri,GError **error);
Sets uri
as the current URI for chooser
.
Since: 2.10
gchar *
ctk_recent_chooser_get_current_uri (CtkRecentChooser *chooser);
Gets the URI currently selected by chooser
.
Since: 2.10
CtkRecentInfo *
ctk_recent_chooser_get_current_item (CtkRecentChooser *chooser);
Gets the CtkRecentInfo currently selected by chooser
.
Since: 2.10
gboolean ctk_recent_chooser_select_uri (CtkRecentChooser *chooser,const gchar *uri,GError **error);
Selects uri
inside chooser
.
Since: 2.10
void ctk_recent_chooser_unselect_uri (CtkRecentChooser *chooser,const gchar *uri);
Unselects uri
inside chooser
.
Since: 2.10
void
ctk_recent_chooser_select_all (CtkRecentChooser *chooser);
Selects all the items inside chooser
, if the chooser
supports
multiple selection.
Since: 2.10
void
ctk_recent_chooser_unselect_all (CtkRecentChooser *chooser);
Unselects all the items inside chooser
.
Since: 2.10
GList *
ctk_recent_chooser_get_items (CtkRecentChooser *chooser);
Gets the list of recently used resources in form of CtkRecentInfo objects.
The return value of this function is affected by the “sort-type” and
“limit” properties of chooser
.
A newly allocated
list of CtkRecentInfo objects. You should
use ctk_recent_info_unref() on every item of the list, and then free
the list itself using g_list_free().
[element-type CtkRecentInfo][transfer full]
Since: 2.10
gchar ** ctk_recent_chooser_get_uris (CtkRecentChooser *chooser,gsize *length);
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.
chooser |
||
length |
return location for a the length of the
URI list, or |
[out][allow-none] |
A newly allocated, NULL-terminated array of strings. Use
g_strfreev() to free it.
[array length=length zero-terminated=1][transfer full]
Since: 2.10
void ctk_recent_chooser_add_filter (CtkRecentChooser *chooser,CtkRecentFilter *filter);
Adds filter
to the list of CtkRecentFilter objects held by chooser
.
If no previous filter objects were defined, this function will call
ctk_recent_chooser_set_filter().
Since: 2.10
void ctk_recent_chooser_remove_filter (CtkRecentChooser *chooser,CtkRecentFilter *filter);
Removes filter
from the list of CtkRecentFilter objects held by chooser
.
Since: 2.10
GSList *
ctk_recent_chooser_list_filters (CtkRecentChooser *chooser);
Gets the CtkRecentFilter objects held by chooser
.
A singly linked list
of CtkRecentFilter objects. You
should just free the returned list using g_slist_free().
[element-type CtkRecentFilter][transfer container]
Since: 2.10
void ctk_recent_chooser_set_filter (CtkRecentChooser *chooser,CtkRecentFilter *filter);
Sets filter
as the current CtkRecentFilter object used by chooser
to affect the displayed recently used resources.
Since: 2.10
CtkRecentFilter *
ctk_recent_chooser_get_filter (CtkRecentChooser *chooser);
Gets the CtkRecentFilter object currently used by chooser
to affect
the display of the recently used resources.
Since: 2.10
struct CtkRecentChooserIface {
/*
* Methods
*/
gboolean (* set_current_uri) (CtkRecentChooser *chooser,
const gchar *uri,
GError **error);
gchar * (* get_current_uri) (CtkRecentChooser *chooser);
gboolean (* select_uri) (CtkRecentChooser *chooser,
const gchar *uri,
GError **error);
void (* unselect_uri) (CtkRecentChooser *chooser,
const gchar *uri);
void (* select_all) (CtkRecentChooser *chooser);
void (* unselect_all) (CtkRecentChooser *chooser);
GList * (* get_items) (CtkRecentChooser *chooser);
CtkRecentManager *(* get_recent_manager) (CtkRecentChooser *chooser);
void (* add_filter) (CtkRecentChooser *chooser,
CtkRecentFilter *filter);
void (* remove_filter) (CtkRecentChooser *chooser,
CtkRecentFilter *filter);
GSList * (* list_filters) (CtkRecentChooser *chooser);
void (* set_sort_func) (CtkRecentChooser *chooser,
CtkRecentSortFunc sort_func,
gpointer sort_data,
GDestroyNotify data_destroy);
/*
* Signals
*/
void (* item_activated) (CtkRecentChooser *chooser);
void (* selection_changed) (CtkRecentChooser *chooser);
};
Sets uri as the current URI for chooser. |
||
Gets the URI currently selected by chooser. |
||
Selects uri inside chooser. |
||
Unselects uri inside chooser. |
||
Selects all the items inside chooser, if the chooser supports multiple selection. |
||
Unselects all the items inside chooser. |
||
Gets the list of recently used resources in form of CtkRecentInfo objects. |
||
Gets the CtkRecentManager used by chooser. |
||
Adds filter to the list of CtkRecentFilter objects held by chooser. |
||
Removes filter from the list of CtkRecentFilter objects held by chooser. |
||
Gets the CtkRecentFilter objects held by chooser. |
||
Sets the comparison function used when sorting to be sort_func. |
||
Signal emitted when the user “activates” a recent item in the recent chooser. |
||
Signal emitted when there is a change in the set of selected recently used resources. |
#define CTK_RECENT_CHOOSER_ERROR (ctk_recent_chooser_error_quark ())
Used to get the GError quark for CtkRecentChooser errors.
Since: 2.10
These identify the various errors that can occur while calling CtkRecentChooser functions.
Since: 2.10
Used to specify the sorting method to be applyed to the recently used resource list.
|
Do not sort the returned list of recently used resources. |
||
|
Sort the returned list with the most recently used items first. |
||
|
Sort the returned list with the least recently used items first. |
||
|
Sort the returned list using a custom sorting
function passed using |
Since: 2.10
“filter” property“filter” CtkRecentFilter *
The CtkRecentFilter object to be used when displaying the recently used resources.
Owner: CtkRecentChooser
Flags: Read / Write
Since: 2.10
“limit” property “limit” int
The maximum number of recently used resources to be displayed, or -1 to display all items.
Owner: CtkRecentChooser
Flags: Read / Write
Allowed values: >= -1
Default value: 50
Since: 2.10
“local-only” property “local-only” gboolean
Whether this CtkRecentChooser should display only local (file:) resources.
Owner: CtkRecentChooser
Flags: Read / Write
Default value: TRUE
Since: 2.10
“recent-manager” property“recent-manager” CtkRecentManager *
The CtkRecentManager instance used by the CtkRecentChooser to display the list of recently used resources.
Owner: CtkRecentChooser
Flags: Write / Construct Only
Since: 2.10
“select-multiple” property “select-multiple” gboolean
Allow the user to select multiple resources.
Owner: CtkRecentChooser
Flags: Read / Write
Default value: FALSE
Since: 2.10
“show-icons” property “show-icons” gboolean
Whether this CtkRecentChooser should display an icon near the item.
Owner: CtkRecentChooser
Flags: Read / Write
Default value: TRUE
Since: 2.10
“show-not-found” property “show-not-found” gboolean
Whether this CtkRecentChooser 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).
Owner: CtkRecentChooser
Flags: Read / Write
Default value: TRUE
Since: 2.10
“show-private” property “show-private” gboolean
Whether the private items should be displayed.
Owner: CtkRecentChooser
Flags: Read / Write
Default value: FALSE
“show-tips” property “show-tips” gboolean
Whether this CtkRecentChooser should display a tooltip containing the full path of the recently used resources.
Owner: CtkRecentChooser
Flags: Read / Write
Default value: FALSE
Since: 2.10
“sort-type” property“sort-type” CtkRecentSortType
Sorting order to be used when displaying the recently used resources.
Owner: CtkRecentChooser
Flags: Read / Write
Default value: CTK_RECENT_SORT_NONE
Since: 2.10
“item-activated” signalvoid user_function (CtkRecentChooser *chooser, gpointer user_data)
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.
chooser |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10
“selection-changed” signalvoid user_function (CtkRecentChooser *chooser, gpointer user_data)
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.
chooser |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10