logo top
Main Page   Widgets   glibmm Namespaces   Book  

Gio::AppInfo Class Reference

Application information, to describe applications installed on the system, and launch them. More...

Inheritance diagram for Gio::AppInfo:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~AppInfo ()
GAppInfo* gobj ()
 Provides access to the underlying C GObject.
const GAppInfo* gobj () const
 Provides access to the underlying C GObject.
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_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.
Glib::RefPtr<Iconget_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::ListHandle<std::string>& files, const Glib::RefPtr<AppLaunchContext>& launch_context)
 Launches the application.
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 should_show () const
 Checks if the application info should be shown in menus that list available applications.
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 extention.
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.

Static Public Member Functions

static void add_interface (GType gtype_implementer)
static Glib::RefPtr<AppInfocreate_from_commandline (const std::string& commandline, const std::string& application_name, AppInfoCreateFlags flags)
static Glib::ListHandle< Glib::RefPtr<
AppInfo > > 
get_all ()
static Glib::ListHandle< Glib::RefPtr<
AppInfo > > 
get_all_for_type (const std::string& content_type)
static Glib::RefPtr<AppInfoget_default_for_type (const std::string& content_type, bool must_support_uris=true)
static Glib::RefPtr<AppInfoget_default_for_uri_scheme (const std::string& uri_scheme)

Protected Member Functions

virtual Glib::RefPtr<AppInfodup_vfunc ()
virtual bool equal_vfunc (const Glib::RefPtr<AppInfo>& appinfo2)
virtual std::string get_id_vfunc () const
virtual std::string get_name_vfunc () const
virtual std::string get_description_vfunc () const
virtual std::string get_executable_vfunc () const
virtual Glib::RefPtr<Iconget_icon_vfunc () const
virtual bool launch_vfunc (const Glib::ListHandle<std::string>& filenames, const Glib::RefPtr<AppLaunchContext>& launch_context, GError** error)
virtual bool supports_uris_vfunc () const
virtual bool supports_files_vfunc () const
virtual bool launch_uris_vfunc (const Glib::ListHandle<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& launch_context, GError** error)
virtual bool should_show_vfunc () const
virtual bool set_as_default_for_type_vfunc (const std::string& content_type, GError** error)
virtual bool set_as_default_for_extension_vfunc (const std::string& extension, GError** error)
virtual bool add_supports_type_vfunc (const std::string& content_type, GError** error)
virtual bool can_remove_supports_type_vfunc () const
virtual bool remove_supports_type_vfunc (const std::string& content_type, GError** error)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Gio::AppInfowrap (GAppInfo* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

Application information, to describe applications installed on the system, and launch them.

See also AppLaunchContext.

Since glibmm 2.16:


Constructor & Destructor Documentation

virtual Gio::AppInfo::~AppInfo (  )  [virtual]


Member Function Documentation

static void Gio::AppInfo::add_interface ( GType  gtype_implementer  )  [static]

GAppInfo* Gio::AppInfo::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

Reimplemented in Gio::DesktopAppInfo.

const GAppInfo* Gio::AppInfo::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

Reimplemented in Gio::DesktopAppInfo.

static Glib::RefPtr<AppInfo> Gio::AppInfo::create_from_commandline ( const std::string commandline,
const std::string application_name,
AppInfoCreateFlags  flags 
) [static]

bool Gio::AppInfo::equal ( const Glib::RefPtr<AppInfo>&  other  )  const

Checks if two AppInfos are equal.

Parameters:
appinfo2 The second AppInfo.
Returns:
true if appinfo1 is equal to appinfo2. false otherwise.

std::string Gio::AppInfo::get_id (  )  const

Gets the ID of an application.

An id is a string that identifies the application. The exact format of the id is platform dependent. For instance on Unix this is the desktop file id from the xdg menu specification.

Note that the returned ID may be 0, depending on how the appinfo has been constructed.

Returns:
A string containing the application's ID.

std::string Gio::AppInfo::get_name (  )  const

Gets the installed name of the application.

Returns:
The name of the application for appinfo.

std::string Gio::AppInfo::get_description (  )  const

Gets a human-readable description of an installed application.

Returns:
A string containing a description of the application appinfo, or 0 if none.

std::string Gio::AppInfo::get_executable (  )  const

Gets the executable's name for the installed application.

Returns:
A string containing the appinfo's application binary's name.

Glib::RefPtr<Icon> Gio::AppInfo::get_icon (  ) 

Gets the icon for the application.

Returns:
The default Icon for appinfo.

const Glib::RefPtr<const Icon> Gio::AppInfo::get_icon (  )  const

Gets the icon for the application.

Returns:
The default Icon for appinfo.

bool Gio::AppInfo::launch ( const Glib::ListHandle<std::string>&  files,
const Glib::RefPtr<AppLaunchContext>&  launch_context 
)

Launches the application.

Passes files to the launched application as arguments, using the optional launch_context to get information about the details of the launcher (like what screen its is on). On error, error will be set accordingly.

To lauch the application without arguments pass a 0 files list.

Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this.

Parameters:
files A List of File objects.
launch_context A AppLaunchContext.
Returns:
true on successful launch, false otherwise.

bool Gio::AppInfo::supports_uris (  )  const

Checks if the application supports reading files and directories from URIs.

Returns:
true if the appinfo supports URIs.

bool Gio::AppInfo::supports_files (  )  const

Checks if the application accepts files as arguments.

Returns:
true if the appinfo supports files.

bool Gio::AppInfo::launch_uris ( const Glib::ListHandle<std::string>&  uris,
GAppLaunchContext *  launch_context 
)

Launches the application.

Passes uris to the launched application as arguments, using the optional launch_context to get information about the details of the launcher (like what screen its is on). On error, error will be set accordingly.

To lauch the application without arguments pass a 0 uris list.

Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this.

Parameters:
uris A List containing URIs to launch.
launch_context A AppLaunchContext.
Returns:
true on successful launch, false otherwise.

bool Gio::AppInfo::should_show (  )  const

Checks if the application info should be shown in menus that list available applications.

Returns:
true if the appinfo should be shown, false otherwise.

bool Gio::AppInfo::set_as_default_for_type ( const std::string content_type  ) 

Sets the application as the default handler for a given type.

Parameters:
content_type The content type.
Returns:
true on success, false on error.

bool Gio::AppInfo::set_as_default_for_extension ( const std::string extension  ) 

Sets the application as the default handler for the given file extention.

Parameters:
extension A string containing the file extension (without the dot).
Returns:
true on success, false on error.

bool Gio::AppInfo::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.

Parameters:
content_type A string.
Returns:
true on success, false on error.

bool Gio::AppInfo::can_remove_supports_type (  )  const

Checks if a supported content type can be removed from an application.

Returns:
true if it is possible to remove supported content types from a given appinfo, false if not.

bool Gio::AppInfo::remove_supports_type ( const std::string content_type  ) 

Removes a supported type from an application, if possible.

Parameters:
content_type A string.
Returns:
true on success, false on error.

static Glib::ListHandle<Glib::RefPtr<AppInfo>> Gio::AppInfo::get_all (  )  [static]

static Glib::ListHandle<Glib::RefPtr<AppInfo>> Gio::AppInfo::get_all_for_type ( const std::string content_type  )  [static]

static Glib::RefPtr<AppInfo> Gio::AppInfo::get_default_for_type ( const std::string content_type,
bool  must_support_uris = true 
) [static]

static Glib::RefPtr<AppInfo> Gio::AppInfo::get_default_for_uri_scheme ( const std::string uri_scheme  )  [static]

virtual Glib::RefPtr<AppInfo> Gio::AppInfo::dup_vfunc (  )  [protected, virtual]

virtual bool Gio::AppInfo::equal_vfunc ( const Glib::RefPtr<AppInfo>&  appinfo2  )  [protected, virtual]

virtual std::string Gio::AppInfo::get_id_vfunc (  )  const [protected, virtual]

virtual std::string Gio::AppInfo::get_name_vfunc (  )  const [protected, virtual]

virtual std::string Gio::AppInfo::get_description_vfunc (  )  const [protected, virtual]

virtual std::string Gio::AppInfo::get_executable_vfunc (  )  const [protected, virtual]

virtual Glib::RefPtr<Icon> Gio::AppInfo::get_icon_vfunc (  )  const [protected, virtual]

virtual bool Gio::AppInfo::launch_vfunc ( const Glib::ListHandle<std::string>&  filenames,
const Glib::RefPtr<AppLaunchContext>&  launch_context,
GError **  error 
) [protected, virtual]

virtual bool Gio::AppInfo::supports_uris_vfunc (  )  const [protected, virtual]

virtual bool Gio::AppInfo::supports_files_vfunc (  )  const [protected, virtual]

virtual bool Gio::AppInfo::launch_uris_vfunc ( const Glib::ListHandle<std::string>&  uris,
const Glib::RefPtr<AppLaunchContext>&  launch_context,
GError **  error 
) [protected, virtual]

virtual bool Gio::AppInfo::should_show_vfunc (  )  const [protected, virtual]

virtual bool Gio::AppInfo::set_as_default_for_type_vfunc ( const std::string content_type,
GError **  error 
) [protected, virtual]

virtual bool Gio::AppInfo::set_as_default_for_extension_vfunc ( const std::string extension,
GError **  error 
) [protected, virtual]

virtual bool Gio::AppInfo::add_supports_type_vfunc ( const std::string content_type,
GError **  error 
) [protected, virtual]

virtual bool Gio::AppInfo::can_remove_supports_type_vfunc (  )  const [protected, virtual]

virtual bool Gio::AppInfo::remove_supports_type_vfunc ( const std::string content_type,
GError **  error 
) [protected, virtual]


Friends And Related Function Documentation

Glib::RefPtr<Gio::AppInfo> wrap ( GAppInfo *  object,
bool  take_copy = false 
) [related]

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

Parameters:
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.
Returns:
A C++ instance that wraps this C instance.


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

Generated for glibmm 2.4 by Doxygen 1.5.1 © 1997-2001