glibmm
2.33.12
|
DesktopAppInfo is an implementation of AppInfo based on desktop files. More...
#include <giomm/desktopappinfo.h>
Public Member Functions | |
virtual | ~DesktopAppInfo () |
GDesktopAppInfo* | gobj () |
Provides access to the underlying C GObject. | |
const GDesktopAppInfo* | gobj () const |
Provides access to the underlying C GObject. | |
GDesktopAppInfo* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
std::string | get_filename () const |
When info was created from a known filename, return it. | |
bool | is_hidden () const |
A desktop file is hidden if the Hidden key in it is set to True. | |
![]() | |
void* | get_data (const QueryQuark& key) |
void | set_data (const Quark& key, void* data) |
void | set_data (const Quark& key, void* data, DestroyNotify notify) |
void | remove_data (const QueryQuark& quark) |
void* | steal_data (const QueryQuark& quark) |
![]() | |
void | set_property_value (const Glib::ustring& property_name, const Glib::ValueBase&value) |
You probably want to use a specific property_*() accessor method instead. | |
void | get_property_value (const Glib::ustring& property_name, Glib::ValueBase&value) const |
You probably want to use a specific property_*() accessor method instead. | |
template<class PropertyType > | |
void | set_property (const Glib::ustring& property_name, const PropertyType&value) |
You probably want to use a specific property_*() accessor method instead. | |
template<class PropertyType > | |
void | get_property (const Glib::ustring& property_name, PropertyType&value) const |
You probably want to use a specific property_*() accessor method instead. | |
void | connect_property_changed (const Glib::ustring& property_name, const sigc::slot< void >& slot) |
You can use the signal_changed() signal of the property proxy instead, but this is necessary when using the reduced API. | |
sigc::connection | connect_property_changed_with_return (const Glib::ustring& property_name, const sigc::slot< void >& slot) |
You can use the signal_changed() signal of the property proxy instead, but this is necessary when using the reduced API. | |
void | freeze_notify () |
Increases the freeze count on object. | |
void | thaw_notify () |
Reverts the effect of a previous call to freeze_notify(). | |
virtual void | reference () const |
Increment the reference count for this object. | |
virtual void | unreference () const |
Decrement the reference count for this object. | |
GObject* | gobj_copy () const |
Give a ref-ed copy to someone. Use for direct struct access. | |
![]() | |
trackable (const trackable &src) | |
trackable & | operator= (const trackable &src) |
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const |
void | remove_destroy_notify_callback (void *data) const |
void | notify_callbacks () |
![]() | |
virtual | ~AppInfo () |
bool | equal (const Glib::RefPtr< AppInfo >& other) const |
Checks if two AppInfos are equal. | |
std::string | get_id () const |
Gets the ID of an application. | |
std::string | get_name () const |
Gets the installed name of the application. | |
std::string | get_display_name () const |
Gets the display name of the application. | |
std::string | get_description () const |
Gets a human-readable description of an installed application. | |
std::string | get_executable () const |
Gets the executable's name for the installed application. | |
std::string | get_commandline () const |
Gets the commandline with which the application will be started. | |
Glib::RefPtr< Icon > | get_icon () |
Gets the icon for the application. | |
const Glib::RefPtr< const Icon > | get_icon () const |
Gets the icon for the application. | |
bool | launch (const Glib::RefPtr< Gio::File >& file, const Glib::RefPtr< AppLaunchContext >& launch_context) |
Launches the application. | |
bool | launch (const Glib::RefPtr< Gio::File >& file) |
Launches the application. | |
bool | launch (const std::vector< Glib::RefPtr< Gio::File > >& files, const Glib::RefPtr< AppLaunchContext >& launch_context) |
Launches the application. | |
bool | launch (const std::vector< Glib::RefPtr< Gio::File > >& files) |
A launch() convenience overload. | |
bool | supports_uris () const |
Checks if the application supports reading files and directories from URIs. | |
bool | supports_files () const |
Checks if the application accepts files as arguments. | |
bool | launch_uris (const Glib::ListHandle< std::string >& uris, GAppLaunchContext* launch_context) |
Launches the application. | |
bool | launch_uris (const Glib::ListHandle< std::string >& uris, const Glib::RefPtr< AppLaunchContext >& launch_context) |
Launches the application. | |
bool | launch_uris (const Glib::ListHandle< std::string >& uris) |
A launch_uris() convenience overload. | |
bool | launch_uri (const std::string& uris, const Glib::RefPtr< AppLaunchContext >& launch_context) |
Launches the application. | |
bool | launch_uri (const std::string& uris) |
A launch_uri() convenience overload. | |
bool | should_show () const |
Checks if the application info should be shown in menus that list available applications. | |
bool | can_delete () const |
Obtains the information whether the AppInfo can be deleted. | |
bool | do_delete () |
Tries to delete a AppInfo. | |
bool | set_as_default_for_type (const std::string& content_type) |
Sets the application as the default handler for a given type. | |
bool | set_as_default_for_extension (const std::string& extension) |
Sets the application as the default handler for the given file extension. | |
bool | add_supports_type (const std::string& content_type) |
Adds a content type to the application information to indicate the application is capable of opening files with the given content type. | |
bool | can_remove_supports_type () const |
Checks if a supported content type can be removed from an application. | |
bool | remove_supports_type (const std::string& content_type) |
Removes a supported type from an application, if possible. | |
Glib::StringArrayHandle | get_supported_types () const |
Retrieves the list of content types that app_info claims to support. | |
bool | set_as_last_used_for_type (const std::string& content_type) |
Sets the application as the last used application for a given type. | |
![]() | |
Interface (const Glib::Interface_Class& interface_class) | |
Called by constructors of derived classes. | |
Interface (GObject* castitem) | |
Called by constructors of derived classes. | |
virtual | ~Interface () |
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 < DesktopAppInfo > | create (const std::string& desktop_id) |
Creates a new DesktopAppInfo based on a desktop file id. | |
static Glib::RefPtr < DesktopAppInfo > | create_from_keyfile (Glib::KeyFile& key_file) |
Creates a new DesktopAppInfo. | |
static Glib::RefPtr < DesktopAppInfo > | create_from_filename (const std::string& filename) |
Creates a new DesktopAppInfo. | |
static void | set_desktop_env (const std::string& desktop_env) |
Sets the name of the desktop that the application is running in. | |
![]() | |
static void | add_interface (GType gtype_implementer) |
static Glib::RefPtr< AppInfo > | create_from_commandline (const std::string& commandline, const std::string& application_name, AppInfoCreateFlags flags) |
static Glib::ListHandle < Glib::RefPtr< AppInfo > > | get_all () |
Gets a list of all of the applications currently registered on this system. | |
static Glib::ListHandle < Glib::RefPtr< AppInfo > > | get_all_for_type (const std::string& content_type) |
Gets a list of all AppInfos for a given content type, including the recommended and fallback AppInfos. | |
static Glib::RefPtr< AppInfo > | get_default_for_type (const std::string& content_type, bool must_support_uris=true) |
Gets the default AppInfo for a given content type. | |
static Glib::RefPtr< AppInfo > | get_default_for_uri_scheme (const std::string& uri_scheme) |
Gets the default application for handling URIs with the given URI scheme. | |
static void | reset_type_associations (const std::string& content_type) |
Removes all changes to the type associations done by g_app_info_set_as_default_for_type(), g_app_info_set_as_default_for_extension(), g_app_info_add_supports_type() or g_app_info_remove_supports_type(). | |
static bool | launch_default_for_uri (const std::string& uri, const Glib::RefPtr< AppLaunchContext >& context) |
Utility function that launches the default application registered to handle the specified uri. | |
static bool | launch_default_for_uri (const std::string& uri) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gio::DesktopAppInfo > | wrap (GDesktopAppInfo* object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
![]() | |
Glib::RefPtr< Glib::Object > | wrap (GObject* object, bool take_copy=false) |
![]() | |
Glib::RefPtr< Gio::AppInfo > | wrap (GAppInfo* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
Additional Inherited Members | |
![]() | |
typedef void(* | DestroyNotify )(gpointer data) |
![]() | |
Object () | |
Object (const Glib::ConstructParams& construct_params) | |
Object (GObject* castitem) | |
virtual | ~Object () |
![]() | |
ObjectBase () | |
This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. | |
ObjectBase (const char* custom_type_name) | |
A derived constructor always overrides this choice. | |
ObjectBase (const std::type_info& custom_type_info) | |
This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. | |
virtual | ~ObjectBase ()=0 |
void | initialize (GObject* castitem) |
![]() | |
AppInfo () | |
You should derive from this class to use it. |
DesktopAppInfo is an implementation of AppInfo based on desktop files.
|
virtual |
|
static |
Creates a new DesktopAppInfo based on a desktop file id.
A desktop file id is the basename of the desktop file, including the .desktop extension. GIO is looking for a desktop file with this name in the <filename>applications</filename> subdirectories of the XDG data directories (i.e. the directories specified in the <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment variables). GIO also supports the prefix-to-subdirectory mapping that is described in the Menu Spec (i.e. a desktop id of kde-foo.desktop will match <filename>/usr/share/applications/kde/foo.desktop</filename>).
desktop_id | The desktop file id. |
0
if no desktop file with that id.
|
static |
Creates a new DesktopAppInfo.
filename | The path of a desktop file, in the GLib filename encoding. |
0
on error.
|
static |
Creates a new DesktopAppInfo.
key_file | An opened KeyFile. |
0
on error. std::string Gio::DesktopAppInfo::get_filename | ( | ) | const |
When info was created from a known filename, return it.
In some situations such as the DesktopAppInfo returned from g_desktop_app_info_new_from_keyfile(), this function will return 0
.
0
if not known.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
Reimplemented from Gio::AppInfo.
|
inline |
Provides access to the underlying C GObject.
Reimplemented from Gio::AppInfo.
|
inline |
Provides access to the underlying C GObject.
Reimplemented from Gio::AppInfo.
GDesktopAppInfo* Gio::DesktopAppInfo::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool Gio::DesktopAppInfo::is_hidden | ( | ) | const |
A desktop file is hidden if the Hidden key in it is set to True.
true
if hidden, false
otherwise.
|
static |
Sets the name of the desktop that the application is running in.
This is used by g_app_info_should_show() and g_desktop_app_info_get_show_in() to evaluate the OnlyShowIn
and NotShowIn
desktop entry fields.
The Desktop Menu specification recognizes the following: <simplelist> <member>GNOME</member> <member>KDE</member> <member>ROX</member> <member>XFCE</member> <member>LXDE</member> <member>Unity</member> <member>Old</member> </simplelist>
Should be called only once; subsequent calls are ignored.
desktop_env | A string specifying what desktop this is. |
|
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. |