glibmm: Gio::AppLaunchContext Class Reference

# Gio::AppLaunchContext Class Reference

This is used to handle, for instance, startup notification and launching of the new application on the same screen as the launching window. More...

Inherits Glib::Object.

Collaboration diagram for Gio::AppLaunchContext:
[legend]

List of all members.

## Public Member Functions
virtual | ~AppLaunchContext ()
GAppLaunchContext* | gobj ()
| Provides access to the underlying C GObject.
const GAppLaunchContext* | gobj () const
| Provides access to the underlying C GObject.
GAppLaunchContext* | 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_display (const Glib::RefPtr< AppInfo >& info, const Glib::ListHandle< Glib::RefPtr< Gio::File > >& files)
| Gets the display string for the display.
std::string | get_startup_notify_id (const Glib::RefPtr< AppInfo >& info, const Glib::ListHandle< Glib::RefPtr< Gio::File > >& files)
| Initiates startup notification for the application and returns the DESKTOP_STARTUP_ID for the launched operation, if supported.
void | launch_failed (const std::string& startup_notify_id)
| Called when an application has failed to launch, so that it can cancel the application startup notification started in g_app_launch_context_get_startup_notify_id().
## Static Public Member Functions
static Glib::RefPtr < AppLaunchContext > | create ()
## Protected Member Functions
| AppLaunchContext ()
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr < Gio::AppLaunchContext > | wrap (GAppLaunchContext* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

This is used to handle, for instance, startup notification and launching of the new application on the same screen as the launching window.

See also AppInfo.

Since glibmm 2.16:

## Constructor & Destructor Documentation

virtual Gio::AppLaunchContext::~AppLaunchContext | ( |  | ) | `[virtual]`

Gio::AppLaunchContext::AppLaunchContext | ( |  | ) | `[protected]`

## Member Function Documentation

static Glib::RefPtr<AppLaunchContext> Gio::AppLaunchContext::create | ( |  | ) | `[static]`

std::string Gio::AppLaunchContext::get_display | ( | const Glib::RefPtr< AppInfo >& | info,
|  | const Glib::ListHandle< Glib::RefPtr< Gio::File > >& | files |
| ) |  |  |

Gets the display string for the display.

This is used to ensure new applications are started on the same display as the launching application.

Parameters:

  | info | A AppInfo.
  | files | A List of File objects.

Returns:
  A display string for the display.

std::string Gio::AppLaunchContext::get_startup_notify_id | ( | const Glib::RefPtr< AppInfo >& | info,
|  | const Glib::ListHandle< Glib::RefPtr< Gio::File > >& | files |
| ) |  |  |

Initiates startup notification for the application and returns the DESKTOP_STARTUP_ID for the launched operation, if supported.

Startup notification IDs are defined in the <ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt"> FreeDesktop.Org Startup Notifications standard</ulink>.

Parameters:

  | info | A AppInfo.
  | files | A List of of File objects.

Returns:
  A startup notification ID for the application, or `0` if not supported.

const GAppLaunchContext* Gio::AppLaunchContext::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GAppLaunchContext* Gio::AppLaunchContext::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GAppLaunchContext* Gio::AppLaunchContext::gobj_copy | ( |  | ) |

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

void Gio::AppLaunchContext::launch_failed | ( | const std::string & | startup_notify_id | ) |

Called when an application has failed to launch, so that it can cancel the application startup notification started in g_app_launch_context_get_startup_notify_id().

Parameters:

  | startup_notify_id | The startup notification id that was returned by g_app_launch_context_get_startup_notify_id().

## Friends And Related Function Documentation

Glib::RefPtr< Gio::AppLaunchContext > wrap | ( | GAppLaunchContext * | 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:

- giomm/appinfo.h