## XfceConsolekit

XfceConsolekit — Session management via ConsoleKit

## Functions

XfceConsolekit * | xfce_consolekit_get ()
gboolean | xfce_consolekit_reboot ()
gboolean | xfce_consolekit_power_off ()
gboolean | xfce_consolekit_suspend ()
gboolean | xfce_consolekit_hibernate ()
gboolean | xfce_consolekit_hybrid_sleep ()
gboolean | xfce_consolekit_can_reboot ()
gboolean | xfce_consolekit_can_power_off ()
gboolean | xfce_consolekit_can_suspend ()
gboolean | xfce_consolekit_can_hibernate ()
gboolean | xfce_consolekit_can_hybrid_sleep ()

## Types and Values

| XfceConsolekit

## Object Hierarchy

        GObject
        ╰── XfceConsolekit

## Includes

    #include <libxfce4util/libxfce4util.h>

## Description

## Functions

### xfce_consolekit_get ()

    XfceConsolekit *
    xfce_consolekit_get (void);

Create a new XfceConsolekit instance or increase reference count.

#### Returns

A reference to the singleton object, to be released with `g_object_unref()`.

[transfer full]

Since: 4.19.1

### xfce_consolekit_reboot ()

    gboolean
    xfce_consolekit_reboot (XfceConsolekit *consolekit,
                            gboolean polkit_interactive,
                            GError **error);

Ask ConsoleKit to trigger Reboot.

#### Parameters

consolekit | the XfceConsolekit object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_power_off ()

    gboolean
    xfce_consolekit_power_off (XfceConsolekit *consolekit,
                               gboolean polkit_interactive,
                               GError **error);

Ask ConsoleKit to trigger PowerOff.

#### Parameters

consolekit | the XfceConsolekit object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_suspend ()

    gboolean
    xfce_consolekit_suspend (XfceConsolekit *consolekit,
                             gboolean polkit_interactive,
                             GError **error);

Ask ConsoleKit to trigger Suspend.

#### Parameters

consolekit | the XfceConsolekit object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_hibernate ()

    gboolean
    xfce_consolekit_hibernate (XfceConsolekit *consolekit,
                               gboolean polkit_interactive,
                               GError **error);

Ask ConsoleKit to trigger Hibernate.

#### Parameters

consolekit | the XfceConsolekit object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_hybrid_sleep ()

    gboolean
    xfce_consolekit_hybrid_sleep (XfceConsolekit *consolekit,
                                  gboolean polkit_interactive,
                                  GError **error);

Ask ConsoleKit to trigger HybridSleep.

#### Parameters

consolekit | the XfceConsolekit object |
polkit_interactive | whether PolicyKit should ask the user to authenticate if needed |
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_can_reboot ()

    gboolean
    xfce_consolekit_can_reboot (XfceConsolekit *consolekit,
                                gboolean *can_reboot,
                                gboolean *auth_reboot,
                                GError **error);

Check whether ConsoleKit can trigger Reboot.

#### Parameters

consolekit | the XfceConsolekit object |
can_reboot | location to store capacity or `NULL`. | [out][nullable]
auth_reboot | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_can_power_off ()

    gboolean
    xfce_consolekit_can_power_off (XfceConsolekit *consolekit,
                                   gboolean *can_power_off,
                                   gboolean *auth_power_off,
                                   GError **error);

Check whether ConsoleKit can trigger PowerOff.

#### Parameters

consolekit | the XfceConsolekit object |
can_power_off | location to store capacity or `NULL`. | [out][nullable]
auth_power_off | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_can_suspend ()

    gboolean
    xfce_consolekit_can_suspend (XfceConsolekit *consolekit,
                                 gboolean *can_suspend,
                                 gboolean *auth_suspend,
                                 GError **error);

Check whether ConsoleKit can trigger and has authorization for Suspend.

#### Parameters

consolekit | the XfceConsolekit object |
can_suspend | location to store capacity or `NULL`. | [out][nullable]
auth_suspend | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_can_hibernate ()

    gboolean
    xfce_consolekit_can_hibernate (XfceConsolekit *consolekit,
                                   gboolean *can_hibernate,
                                   gboolean *auth_hibernate,
                                   GError **error);

Check whether ConsoleKit can trigger and has authorization for Hibernate.

#### Parameters

consolekit | the XfceConsolekit object |
can_hibernate | location to store capacity or `NULL`. | [out][nullable]
auth_hibernate | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

### xfce_consolekit_can_hybrid_sleep ()

    gboolean
    xfce_consolekit_can_hybrid_sleep (XfceConsolekit *consolekit,
                                      gboolean *can_hybrid_sleep,
                                      gboolean *auth_hybrid_sleep,
                                      GError **error);

Check whether ConsoleKit can trigger and has authorization for HybridSleep.

#### Parameters

consolekit | the XfceConsolekit object |
can_hybrid_sleep | location to store capacity or `NULL`. | [out][nullable]
auth_hybrid_sleep | location to store authorization or `NULL`. | [out][nullable]
error | location to store error on failure or `NULL`. | [out][nullable]

#### Returns

`TRUE` if the D-Bus request was successful, `FALSE` otherwise and `error` is set.

Since: 4.19.1

## Types and Values

### XfceConsolekit

    typedef struct _XfceConsolekit XfceConsolekit;