gtkmm 4.17.0
|
RecentManager provides a facility for adding, removing and looking up recently used files. More...
#include <gtkmm/recentmanager.h>
Classes | |
class | Data |
Meta-data passed to add_item(). More... | |
Public Member Functions | |
RecentManager (RecentManager &&src) noexcept | |
RecentManager & | operator= (RecentManager &&src) noexcept |
~RecentManager () noexcept override | |
GtkRecentManager * | gobj () |
Provides access to the underlying C GObject. | |
const GtkRecentManager * | gobj () const |
Provides access to the underlying C GObject. | |
GtkRecentManager * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
bool | add_item (const Glib::ustring &uri) |
Adds a new resource into the recently used resources list. | |
bool | add_item (const Glib::ustring &uri, const Data &recent_data) |
Adds a new resource into the recently used resources list, taking meta data from the given Data instead of guessing it from the URI. | |
bool | remove_item (const Glib::ustring &uri) |
Removes a resource pointed by uri from the recently used resources list handled by a recent manager. | |
Glib::RefPtr< RecentInfo > | lookup_item (const Glib::ustring &uri) |
Searches for a URI inside the recently used resources list, and returns a Gtk::RecentInfo containing information about the resource like its MIME type, or its display name. | |
Glib::RefPtr< const RecentInfo > | lookup_item (const Glib::ustring &uri) const |
Searches for a URI inside the recently used resources list, and returns a Gtk::RecentInfo containing information about the resource like its MIME type, or its display name. | |
bool | has_item (const Glib::ustring &uri) const |
Checks whether there is a recently used resource registered with uri inside the recent manager. | |
bool | move_item (const Glib::ustring &uri, const Glib::ustring &new_uri) |
Changes the location of a recently used resource from uri to new_uri. | |
std::vector< Glib::RefPtr< RecentInfo > > | get_items () const |
Gets the list of recently used resources. | |
int | purge_items () |
Purges every item from the recently used resources list. | |
Glib::SignalProxy< void()> | signal_changed () |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_filename () const |
The full path to the file to be used to store and read the recently used resources list. | |
Glib::PropertyProxy_ReadOnly< int > | property_size () const |
The size of the recently used resources list. | |
![]() | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
void * | get_data (const QueryQuark &key) |
void | set_data (const Quark &key, void *data) |
void | set_data_with_c_callback (const Quark &key, void *data, GDestroyNotify notify) |
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
![]() | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
PropertyType | get_property (const Glib::ustring &property_name) const |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
![]() | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) noexcept | |
~trackable () | |
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) noexcept |
void | remove_destroy_notify_callback (notifiable *data) const |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
static Glib::RefPtr< RecentManager > | create () |
static Glib::RefPtr< RecentManager > | get_default () |
Gets a unique instance of Gtk::RecentManager that you can share in your application without caring about memory management. | |
Protected Member Functions | |
RecentManager () | |
virtual void | on_changed () |
This is a default handler for the signal signal_changed(). | |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::RecentManager > | wrap (GtkRecentManager *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Additional Inherited Members | |
![]() | |
typedef void(*)(gpointer data | DestroyNotify) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
RecentManager provides a facility for adding, removing and looking up recently used files.
Each recently used file is identified by its URI, and has meta-data associated to it, like the names and command lines of the applications that have registered it, the number of time each application has registered the same file, the mime type of the file and whether the file should be displayed only by the applications that have registered it.
The RecentManager acts like a database of all the recently used files. You can create new RecentManager objects, but it is more efficient to use the default manager created by GTK+.
|
noexcept |
|
overridenoexcept |
|
protected |
bool Gtk::RecentManager::add_item | ( | const Glib::ustring & | uri | ) |
Adds a new resource into the recently used resources list.
This function will try and guess some of the meta-data associated to a URI. If you know some of meta-data about the document yourself, set the desired fields of a RecentManager::Data structure and pass it to add_item().
bool Gtk::RecentManager::add_item | ( | const Glib::ustring & | uri, |
const Data & | recent_data | ||
) |
Adds a new resource into the recently used resources list, taking meta data from the given Data instead of guessing it from the URI.
|
static |
|
static |
Gets a unique instance of Gtk::RecentManager
that you can share in your application without caring about memory management.
Gtk::RecentManager
. Do not ref or unref it. std::vector< Glib::RefPtr< RecentInfo > > Gtk::RecentManager::get_items | ( | ) | const |
Gets the list of recently used resources.
GtkRecentInfo objects
. Use [method Gtk.RecentInfo.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkRecentManager * Gtk::RecentManager::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool Gtk::RecentManager::has_item | ( | const Glib::ustring & | uri | ) | const |
Checks whether there is a recently used resource registered with uri inside the recent manager.
uri | A URI. |
true
if the resource was found, false
otherwise. Glib::RefPtr< RecentInfo > Gtk::RecentManager::lookup_item | ( | const Glib::ustring & | uri | ) |
Searches for a URI inside the recently used resources list, and returns a Gtk::RecentInfo
containing information about the resource like its MIME type, or its display name.
uri | A URI. |
Gtk::RecentInfo
containing information about the resource pointed by uri, or nullptr
if the URI was not registered in the recently used resources list. Free with Gtk::RecentInfo::unref().Glib::Error |
Glib::RefPtr< const RecentInfo > Gtk::RecentManager::lookup_item | ( | const Glib::ustring & | uri | ) | const |
Searches for a URI inside the recently used resources list, and returns a Gtk::RecentInfo
containing information about the resource like its MIME type, or its display name.
uri | A URI. |
Gtk::RecentInfo
containing information about the resource pointed by uri, or nullptr
if the URI was not registered in the recently used resources list. Free with Gtk::RecentInfo::unref().Glib::Error |
bool Gtk::RecentManager::move_item | ( | const Glib::ustring & | uri, |
const Glib::ustring & | new_uri | ||
) |
Changes the location of a recently used resource from uri to new_uri.
Please note that this function will not affect the resource pointed by the URIs, but only the URI used in the recently used resources list.
uri | The URI of a recently used resource. |
new_uri | The new URI of the recently used resource, or nullptr to remove the item pointed by uri in the list. |
true
on success.Glib::Error |
This is a default handler for the signal signal_changed().
|
noexcept |
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::RecentManager::property_filename | ( | ) | const |
The full path to the file to be used to store and read the recently used resources list.
Default value: ""
Glib::PropertyProxy_ReadOnly< int > Gtk::RecentManager::property_size | ( | ) | const |
The size of the recently used resources list.
Default value: 0
int Gtk::RecentManager::purge_items | ( | ) |
Purges every item from the recently used resources list.
Glib::Error |
bool Gtk::RecentManager::remove_item | ( | const Glib::ustring & | uri | ) |
Removes a resource pointed by uri from the recently used resources list handled by a recent manager.
uri | The URI of the item you wish to remove. |
true
if the item pointed by uri has been successfully removed by the recently used resources list, and false
otherwise.Glib::Error |
Glib::SignalProxy< void()> Gtk::RecentManager::signal_changed | ( | ) |
void on_my_changed()
Flags: Run First
Emitted when the current recently used resources manager changes its contents.
This can happen either by calling Gtk::RecentManager::add_item() or by another application.
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |