gtkmm  3.4.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions
Gtk::RecentChooser Class Reference

RecentChooser is an interface that can be implemented by widgets displaying the list of recently used files. More...

Inheritance diagram for Gtk::RecentChooser:
Inheritance graph
[legend]

List of all members.

Public Types

typedef sigc::slot< int, const
Glib::RefPtr< RecentInfo >
&, const Glib::RefPtr
< RecentInfo >& > 
SlotCompare
 This callback should return -1 if b compares before a, 0 if they compare equal and 1 if a compares after b.

Public Member Functions

virtual ~RecentChooser ()
GtkRecentChooser* gobj ()
 Provides access to the underlying C GObject.
const GtkRecentChooser* gobj () const
 Provides access to the underlying C GObject.
void set_show_private (bool show_private=true)
 Whether to show recently used resources marked registered as private.
bool get_show_private () const
 Returns whether chooser should display recently used resources registered as private.
void set_show_not_found (bool show_not_found=true)
 Sets whether chooser should display the recently used resources that it didn't find.
bool get_show_not_found () const
 Retrieves whether chooser should show the recently used resources that were not found.
void set_select_multiple (bool select_multiple=true)
 Sets whether chooser can select multiple items.
bool get_select_multiple () const
 Gets whether chooser can select multiple items.
void set_limit (int limit)
 Sets the number of items that should be returned by get_items() and get_uris().
void unset_limit ()
int get_limit () const
 Gets the number of items returned by get_items() and get_uris().
void set_local_only (bool local_only=true)
 Sets whether only local resources, that is resources using the file:// URI scheme, should be shown in the recently used resources selector.
bool get_local_only () const
 Gets whether only local resources should be shown in the recently used resources selector.
void set_show_tips (bool show_tips=true)
 Sets whether to show a tooltips containing the full path of each recently used resource in a Gtk::RecentChooser widget.
bool get_show_tips () const
 Gets whether chooser should display tooltips containing the full path of a recently user resource.
void set_show_icons (bool show_icons=true)
 Sets whether chooser should show an icon near the resource when displaying it.
bool get_show_icons () const
 Retrieves whether chooser should show an icon near the resource.
void set_sort_type (RecentSortType sort_type)
 Changes the sorting order of the recently used resources list displayed by chooser.
RecentSortType get_sort_type () const
 Gets the value set by set_sort_type().
void set_sort_func (const SlotCompare& slot)
 Sets the comparison function used when sorting the list of recently used resources and the sort type is RECENT_SORT_CUSTOM.
bool set_current_uri (const Glib::ustring& uri)
 Sets uri as the current URI for chooser.
Glib::ustring get_current_uri () const
 Gets the URI currently selected by chooser.
Glib::RefPtr< RecentInfoget_current_item ()
 Gets the Gtk::RecentInfo currently selected by chooser.
Glib::RefPtr< const RecentInfoget_current_item () const
 Gets the Gtk::RecentInfo currently selected by chooser.
bool select_uri (const Glib::ustring& uri)
 Selects uri inside chooser.
void unselect_uri (const Glib::ustring& uri)
 Unselects uri inside chooser.
void select_all ()
 Selects all the items inside chooser, if the chooser supports multiple selection.
void unselect_all ()
 Unselects all the items inside chooser.
std::vector< Glib::RefPtr
< RecentInfo > > 
get_items () const
 Gets the list of recently used resources in form of Gtk::RecentInfo objects.
std::vector< Glib::ustringget_uris () const
 Gets the URI of the recently used resources.
void add_filter (const Glib::RefPtr< RecentFilter >& filter)
 Adds filter to the list of Gtk::RecentFilter objects held by chooser.
void remove_filter (const Glib::RefPtr< RecentFilter >& filter)
 Removes filter from the list of Gtk::RecentFilter objects held by chooser.
std::vector< Glib::RefPtr
< RecentFilter > > 
list_filters ()
 Gets the Gtk::RecentFilter objects held by chooser.
std::vector< Glib::RefPtr
< const RecentFilter > > 
list_filters () const
 Gets the Gtk::RecentFilter objects held by chooser.
void set_filter (const Glib::RefPtr< RecentFilter >& filter)
 Sets filter as the current Gtk::RecentFilter object used by chooser to affect the displayed recently used resources.
Glib::RefPtr< RecentFilterget_filter ()
 Gets the Gtk::RecentFilter object currently used by chooser to affect the display of the recently used resources.
Glib::RefPtr< const RecentFilterget_filter () const
 Gets the Gtk::RecentFilter object currently used by chooser to affect the display of the recently used resources.
Glib::SignalProxy0< void > signal_selection_changed ()
Glib::SignalProxy0< void > signal_item_activated ()
Glib::PropertyProxy< bool > property_show_private ()
 Whether the private items should be displayed.
Glib::PropertyProxy_ReadOnly
< bool > 
property_show_private () const
 Whether the private items should be displayed.
Glib::PropertyProxy< bool > property_show_tips ()
 Whether there should be a tooltip on the item.
Glib::PropertyProxy_ReadOnly
< bool > 
property_show_tips () const
 Whether there should be a tooltip on the item.
Glib::PropertyProxy< bool > property_show_icons ()
 Whether there should be an icon near the item.
Glib::PropertyProxy_ReadOnly
< bool > 
property_show_icons () const
 Whether there should be an icon near the item.
Glib::PropertyProxy< bool > property_show_not_found ()
 Whether the items pointing to unavailable resources should be displayed.
Glib::PropertyProxy_ReadOnly
< bool > 
property_show_not_found () const
 Whether the items pointing to unavailable resources should be displayed.
Glib::PropertyProxy< bool > property_select_multiple ()
 Whether to allow multiple items to be selected.
Glib::PropertyProxy_ReadOnly
< bool > 
property_select_multiple () const
 Whether to allow multiple items to be selected.
Glib::PropertyProxy< bool > property_local_only ()
 Whether the selected resource(s) should be limited to local file: URIs.
Glib::PropertyProxy_ReadOnly
< bool > 
property_local_only () const
 Whether the selected resource(s) should be limited to local file: URIs.
Glib::PropertyProxy< int > property_limit ()
 The maximum number of items to be displayed.
Glib::PropertyProxy_ReadOnly< int > property_limit () const
 The maximum number of items to be displayed.
Glib::PropertyProxy
< RecentSortType
property_sort_type ()
 The sorting order of the items displayed.
Glib::PropertyProxy_ReadOnly
< RecentSortType
property_sort_type () const
 The sorting order of the items displayed.
Glib::PropertyProxy
< Glib::RefPtr< RecentFilter > > 
property_filter ()
 The current filter for selecting which resources are displayed.
Glib::PropertyProxy_ReadOnly
< Glib::RefPtr< RecentFilter > > 
property_filter () const
 The current filter for selecting which resources are displayed.

Static Public Member Functions

static void add_interface (GType gtype_implementer)

Protected Member Functions

 RecentChooser ()
 You should derive from this class to use it.
virtual Glib::ustring get_current_uri_vfunc () const
virtual void unselect_uri_vfunc (const Glib::ustring& uri)
virtual void select_all_vfunc ()
virtual void unselect_all_vfunc ()
virtual Glib::RefPtr
< RecentManager
get_recent_manager_vfunc ()
virtual void add_filter_vfunc (const Glib::RefPtr< RecentFilter >& filter)
virtual void remove_filter_vfunc (const Glib::RefPtr< RecentFilter >& filter)
virtual void on_selection_changed ()
 This is a default handler for the signal signal_selection_changed().
virtual void on_item_activated ()
 This is a default handler for the signal signal_item_activated().

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::RecentChooserwrap (GtkRecentChooser* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

RecentChooser 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 RecentChooserWidget, RecentChooserDialog and RecentChooserMenu.

Since gtkmm 2.10:

Member Typedef Documentation

This callback should return -1 if b compares before a, 0 if they compare equal and 1 if a compares after b.

For instance, int on_sort_compare(const Glib::RefPtr<Gtk::RecentInfo>& a, const Gtk::RecentInfo& b);


Constructor & Destructor Documentation

You should derive from this class to use it.

virtual Gtk::RecentChooser::~RecentChooser ( ) [virtual]

Member Function Documentation

Adds filter to the list of Gtk::RecentFilter objects held by chooser.

If no previous filter objects were defined, this function will call set_filter().

Since gtkmm 2.10:
Parameters:
filterA Gtk::RecentFilter.
virtual void Gtk::RecentChooser::add_filter_vfunc ( const Glib::RefPtr< RecentFilter >&  filter) [protected, virtual]
static void Gtk::RecentChooser::add_interface ( GType  gtype_implementer) [static]

Gets the Gtk::RecentInfo currently selected by chooser.

Since gtkmm 2.10:
Returns:
A Gtk::RecentInfo. Use Gtk::RecentInfo::unref() when when you have finished using it.

Gets the Gtk::RecentInfo currently selected by chooser.

Since gtkmm 2.10:
Returns:
A Gtk::RecentInfo. Use Gtk::RecentInfo::unref() when when you have finished using it.

Gets the URI currently selected by chooser.

Since gtkmm 2.10:
Returns:
A newly allocated string holding a URI.
virtual Glib::ustring Gtk::RecentChooser::get_current_uri_vfunc ( ) const [protected, virtual]

Gets the Gtk::RecentFilter object currently used by chooser to affect the display of the recently used resources.

Since gtkmm 2.10:
Returns:
A Gtk::RecentFilter object.

Gets the Gtk::RecentFilter object currently used by chooser to affect the display of the recently used resources.

Since gtkmm 2.10:
Returns:
A Gtk::RecentFilter object.

Gets the list of recently used resources in form of Gtk::RecentInfo objects.

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

Since gtkmm 2.10:
Returns:
A newly allocated list of Gtk::RecentInfo objects. You should use Gtk::RecentInfo::unref() on every item of the list, and then free the list itself using Glib::list_free().

Gets the number of items returned by get_items() and get_uris().

Since gtkmm 2.10:
Returns:
A positive integer, or -1 meaning that all items are returned.

Gets whether only local resources should be shown in the recently used resources selector.

See set_local_only()

Since gtkmm 2.10:
Returns:
true if only local resources should be shown.

Gets whether chooser can select multiple items.

Since gtkmm 2.10:
Returns:
true if chooser can select more than one item.

Retrieves whether chooser should show an icon near the resource.

Since gtkmm 2.10:
Returns:
true if the icons should be displayed, false otherwise.

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

Since gtkmm 2.10:
Returns:
true if the resources not found should be displayed, and false otheriwse.

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

Since gtkmm 2.10:
Returns:
true if the recent chooser should show private items, false otherwise.

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

Since gtkmm 2.10:
Returns:
true if the recent chooser should show tooltips, false otherwise.

Gets the value set by set_sort_type().

Since gtkmm 2.10:
Returns:
The sorting order of the chooser.

Gets the URI of the recently used resources.

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

GtkRecentChooser* Gtk::RecentChooser::gobj ( ) [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

Reimplemented in Gtk::RecentAction, Gtk::RecentChooserDialog, Gtk::RecentChooserMenu, and Gtk::RecentChooserWidget.

const GtkRecentChooser* Gtk::RecentChooser::gobj ( ) const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

Reimplemented in Gtk::RecentAction, Gtk::RecentChooserDialog, Gtk::RecentChooserMenu, and Gtk::RecentChooserWidget.

Gets the Gtk::RecentFilter objects held by chooser.

Since gtkmm 2.10:
Returns:
A singly linked list of Gtk::RecentFilter objects. You should just free the returned list using Glib::slist_free().

Gets the Gtk::RecentFilter objects held by chooser.

Since gtkmm 2.10:
Returns:
A singly linked list of Gtk::RecentFilter objects. You should just free the returned list using Glib::slist_free().
virtual void Gtk::RecentChooser::on_item_activated ( ) [protected, virtual]

This is a default handler for the signal signal_item_activated().

virtual void Gtk::RecentChooser::on_selection_changed ( ) [protected, virtual]

This is a default handler for the signal signal_selection_changed().

The current filter for selecting which resources are displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The current filter for selecting which resources are displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The maximum number of items to be displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The maximum number of items to be displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the selected resource(s) should be limited to local file: URIs.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the selected resource(s) should be limited to local file: URIs.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether to allow multiple items to be selected.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether to allow multiple items to be selected.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether there should be an icon near the item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether there should be an icon near the item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the items pointing to unavailable resources should be displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the items pointing to unavailable resources should be displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the private items should be displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the private items should be displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether there should be a tooltip on the item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether there should be a tooltip on the item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The sorting order of the items displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The sorting order of the items displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Removes filter from the list of Gtk::RecentFilter objects held by chooser.

Since gtkmm 2.10:
Parameters:
filterA Gtk::RecentFilter.
virtual void Gtk::RecentChooser::remove_filter_vfunc ( const Glib::RefPtr< RecentFilter >&  filter) [protected, virtual]

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

Since gtkmm 2.10:
virtual void Gtk::RecentChooser::select_all_vfunc ( ) [protected, virtual]

Selects uri inside chooser.

Since gtkmm 2.10:
Parameters:
uriA URI.
Returns:
true if uri was found.

Sets uri as the current URI for chooser.

Since gtkmm 2.10:
Parameters:
uriA URI.
Returns:
true if the URI was found.

Sets filter as the current Gtk::RecentFilter object used by chooser to affect the displayed recently used resources.

Since gtkmm 2.10:
Parameters:
filterA Gtk::RecentFilter.
void Gtk::RecentChooser::set_limit ( int  limit)

Sets the number of items that should be returned by get_items() and get_uris().

Since gtkmm 2.10:
Parameters:
limitA positive integer, or -1 for all items.
void Gtk::RecentChooser::set_local_only ( bool  local_only = true)

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 gtkmm 2.10:
Parameters:
local_onlytrue if only local files can be shown.
void Gtk::RecentChooser::set_select_multiple ( bool  select_multiple = true)

Sets whether chooser can select multiple items.

Since gtkmm 2.10:
Parameters:
select_multipletrue if chooser can select more than one item.
void Gtk::RecentChooser::set_show_icons ( bool  show_icons = true)

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

Since gtkmm 2.10:
Parameters:
show_iconsWhether to show an icon near the resource.
void Gtk::RecentChooser::set_show_not_found ( bool  show_not_found = true)

Sets whether chooser should display the recently used resources that it didn't find.

This only applies to local resources.

Since gtkmm 2.10:
Parameters:
show_not_foundWhether to show the local items we didn't find.
void Gtk::RecentChooser::set_show_private ( bool  show_private = true)

Whether to show recently used resources marked registered as private.

Since gtkmm 2.10:
Parameters:
show_privatetrue to show private items, false otherwise.
void Gtk::RecentChooser::set_show_tips ( bool  show_tips = true)

Sets whether to show a tooltips containing the full path of each recently used resource in a Gtk::RecentChooser widget.

Since gtkmm 2.10:
Parameters:
show_tipstrue if tooltips should be shown.

Sets the comparison function used when sorting the list of recently used resources and the sort type is RECENT_SORT_CUSTOM.

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

Since gtkmm 2.10:
Parameters:
sort_typeSort order that the chooser should use.
Slot Prototype:
void on_my_item_activated()

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 <keycap>Enter</keycap>.

Since gtkmm 2.10:
Slot Prototype:
void on_my_selection_changed()

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 explicitely calling functions to change the selection.

Since gtkmm 2.10:

Unselects all the items inside chooser.

Since gtkmm 2.10:
virtual void Gtk::RecentChooser::unselect_all_vfunc ( ) [protected, virtual]

Unselects uri inside chooser.

Since gtkmm 2.10:
Parameters:
uriA URI.
virtual void Gtk::RecentChooser::unselect_uri_vfunc ( const Glib::ustring uri) [protected, virtual]

Friends And Related Function Documentation

Glib::RefPtr< Gtk::RecentChooser > wrap ( GtkRecentChooser *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: