Ardour  9.0-pre0-582-g084a23a80d
Gtk::RecentInfo Class Reference

#include <recentinfo.h>

Public Member Functions

void reference () const
 
void unreference () const
 
GtkRecentInfogobj ()
 Provides access to the underlying C instance. More...
 
const GtkRecentInfogobj () const
 Provides access to the underlying C instance. More...
 
GtkRecentInfogobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
 operator bool () const
 Tests whether the RecentInfo is valid. More...
 
Glib::ustring get_uri () const
 
Glib::ustring get_display_name () const
 
Glib::ustring get_description () const
 
Glib::ustring get_mime_type () const
 
time_t get_added () const
 
time_t get_modified () const
 
time_t get_visited () const
 
bool get_private_hint () const
 
bool get_application_info (const Glib::ustring &app_name, std::string &app_exec, guint &count, time_t &time) const
 
Glib::StringArrayHandle get_applications () const
 
Glib::ustring last_application () const
 
bool has_application (const Glib::ustring &app_name) const
 
Glib::StringArrayHandle get_groups () const
 
bool has_group (const Glib::ustring &group) const
 
Glib::RefPtr< Gdk::Pixbufget_icon (int size)
 
Glib::RefPtr< const Gdk::Pixbufget_icon (int size) const
 
Glib::ustring get_short_name () const
 
Glib::ustring get_uri_display () const
 
int get_age () const
 
bool is_local () const
 
bool exists () const
 
bool equal (const RecentInfo &b) const
 

Protected Member Functions

 RecentInfo ()
 
void operator delete (void *, std::size_t)
 

Private Member Functions

 RecentInfo (const RecentInfo &)
 
RecentInfooperator= (const RecentInfo &)
 

Related Functions

(Note that these are not member functions.)

bool operator== (const RecentInfo &lhs, const RecentInfo &rhs)
 
bool operator!= (const RecentInfo &lhs, const RecentInfo &rhs)
 
Glib::RefPtr< Gtk::RecentInfowrap (GtkRecentInfo *object, bool take_copy=false)
 

Detailed Description

Contains informations found when looking up an entry of the recently used files list.

Definition at line 47 of file recentinfo.h.

Constructor & Destructor Documentation

◆ RecentInfo() [1/2]

Gtk::RecentInfo::RecentInfo ( )
protected

◆ RecentInfo() [2/2]

Gtk::RecentInfo::RecentInfo ( const RecentInfo )
private

Member Function Documentation

◆ equal()

bool Gtk::RecentInfo::equal ( const RecentInfo b) const

Checks whether two Gtk::RecentInfo structures point to the same resource.

Parameters
bA Gtk::RecentInfo.
Returns
true if both Gtk::RecentInfo structures point to se same resource, false otherwise.

◆ exists()

bool Gtk::RecentInfo::exists ( ) const

Checks whether the resource pointed by info still exists. At the moment this check is done only on resources pointing to local files.

Returns
true if the resource exists.

◆ get_added()

time_t Gtk::RecentInfo::get_added ( ) const

Gets the timestamp (seconds from system's Epoch) when the resource was added to the recently used resources list.

Returns
The number of seconds elapsed from system's Epoch when the resource was added to the list, or -1 on failure.

◆ get_age()

int Gtk::RecentInfo::get_age ( ) const

Gets the number of days elapsed since the last update of the resource pointed by info.

Returns
A positive integer containing the number of days elapsed since the time this resource was last modified.

◆ get_application_info()

bool Gtk::RecentInfo::get_application_info ( const Glib::ustring &  app_name,
std::string &  app_exec,
guint &  count,
time_t &  time 
) const

Gets the data regarding the application that has registered the resource pointed by info.

If the command line contains any escape characters defined inside the storage specification, they will be expanded.

Parameters
app_nameThe name of the application that has registered this item.
app_execReturn location for the string containing the command line.
countReturn location for the number of times this item was registered.
timeReturn location for the timestamp this item was last registered for this application.
Returns
true if an application with app_name has registered this resource inside the recently used list, or false otherwise. The app_exec string is owned by the Gtk::RecentInfo and should not be modified or freed.

◆ get_applications()

Glib::StringArrayHandle Gtk::RecentInfo::get_applications ( ) const

Retrieves the list of applications that have registered this resource.

Parameters
lengthReturn location for the length of the returned list.
Returns
A newly allocated 0-terminated array of strings. Use Glib::strfreev() to free it.

◆ get_description()

Glib::ustring Gtk::RecentInfo::get_description ( ) const

Gets the (short) description of the resource.

Returns
The description of the resource. The returned string is owned by the recent manager, and should not be freed.

◆ get_display_name()

Glib::ustring Gtk::RecentInfo::get_display_name ( ) const

Gets the name of the resource. If none has been defined, the basename of the resource is obtained.

Returns
The display name of the resource. The returned string is owned by the recent manager, and should not be freed.

◆ get_groups()

Glib::StringArrayHandle Gtk::RecentInfo::get_groups ( ) const

Returns all groups registered for the recently used item info. The array of returned group names will be 0 terminated, so length might optionally be 0.

Parameters
lengthReturn location for the number of groups returned.
Returns
A newly allocated 0 terminated array of strings. Use Glib::strfreev() to free it.

◆ get_icon() [1/2]

Glib::RefPtr<Gdk::Pixbuf> Gtk::RecentInfo::get_icon ( int  size)

Retrieves the icon of size size associated to the resource MIME type.

Parameters
sizeThe size of the icon in pixels.
Returns
A Gdk::Pixbuf containing the icon, or 0. Use Glib::object_unref() when finished using the icon.

◆ get_icon() [2/2]

Glib::RefPtr<const Gdk::Pixbuf> Gtk::RecentInfo::get_icon ( int  size) const

Retrieves the icon of size size associated to the resource MIME type.

Parameters
sizeThe size of the icon in pixels.
Returns
A Gdk::Pixbuf containing the icon, or 0. Use Glib::object_unref() when finished using the icon.

◆ get_mime_type()

Glib::ustring Gtk::RecentInfo::get_mime_type ( ) const

Gets the MIME type of the resource.

Returns
The MIME type of the resource. The returned string is owned by the recent manager, and should not be freed.

◆ get_modified()

time_t Gtk::RecentInfo::get_modified ( ) const

Gets the timestamp (seconds from system's Epoch) when the resource was last modified.

Returns
The number of seconds elapsed from system's Epoch when the resource was last modified, or -1 on failure.

◆ get_private_hint()

bool Gtk::RecentInfo::get_private_hint ( ) const

Gets the value of the "private" flag. Resources in the recently used list that have this flag set to true should only be displayed by the applications that have registered them.

Returns
true if the private flag was found, false otherwise.

◆ get_short_name()

Glib::ustring Gtk::RecentInfo::get_short_name ( ) const

Computes a valid UTF-8 string that can be used as the name of the item in a menu or list. For example, calling this function on an item that refers to "file:///foo/bar.txt" will yield "bar.txt".

Returns
A newly-allocated string in UTF-8 encoding; free it with Glib::free().

◆ get_uri()

Glib::ustring Gtk::RecentInfo::get_uri ( ) const

Gets the URI of the resource.

Returns
The URI of the resource. The returned string is owned by the recent manager, and should not be freed.

◆ get_uri_display()

Glib::ustring Gtk::RecentInfo::get_uri_display ( ) const

Gets a displayable version of the resource's URI. If the resource is local, it returns a local path; if the resource is not local, it returns the UTF-8 encoded content of get_uri().

Returns
A newly allocated UTF-8 string containing the resource's URI or 0. Use Glib::free() when done using it.

◆ get_visited()

time_t Gtk::RecentInfo::get_visited ( ) const

Gets the timestamp (seconds from system's Epoch) when the resource was last visited.

Returns
The number of seconds elapsed from system's Epoch when the resource was last visited, or -1 on failure.

◆ gobj() [1/2]

GtkRecentInfo* Gtk::RecentInfo::gobj ( )

Provides access to the underlying C instance.

◆ gobj() [2/2]

const GtkRecentInfo* Gtk::RecentInfo::gobj ( ) const

Provides access to the underlying C instance.

◆ gobj_copy()

GtkRecentInfo* Gtk::RecentInfo::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ has_application()

bool Gtk::RecentInfo::has_application ( const Glib::ustring &  app_name) const

Checks whether an application registered this resource using app_name.

Parameters
app_nameA string containing an application name.
Returns
true if an application with name app_name was found, false otherwise.

◆ has_group()

bool Gtk::RecentInfo::has_group ( const Glib::ustring &  group) const

Checks whether group_name appears inside the groups registered for the recently used item info.

Parameters
groupName of a group.
Returns
true if the group was found.

◆ is_local()

bool Gtk::RecentInfo::is_local ( ) const

Checks whether the resource is local or not by looking at the scheme of its URI.

Returns
true if the resource is local.

◆ last_application()

Glib::ustring Gtk::RecentInfo::last_application ( ) const

Gets the name of the last application that have registered the recently used resource represented by info.

Returns
An application name. Use Glib::free() to free it.

◆ operator bool()

Gtk::RecentInfo::operator bool ( ) const

Tests whether the RecentInfo is valid.

◆ operator delete()

void Gtk::RecentInfo::operator delete ( void *  ,
std::size_t   
)
protected

◆ operator=()

RecentInfo& Gtk::RecentInfo::operator= ( const RecentInfo )
private

◆ reference()

void Gtk::RecentInfo::reference ( ) const

Increment the reference count for this object. You should never need to do this manually - use the object via a RefPtr instead.

◆ unreference()

void Gtk::RecentInfo::unreference ( ) const

Decrement the reference count for this object. You should never need to do this manually - use the object via a RefPtr instead.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const RecentInfo lhs,
const RecentInfo rhs 
)
related

Definition at line 324 of file recentinfo.h.

◆ operator==()

bool operator== ( const RecentInfo lhs,
const RecentInfo rhs 
)
related

Definition at line 320 of file recentinfo.h.

◆ wrap()

Glib::RefPtr< Gtk::RecentInfo > wrap ( GtkRecentInfo 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: