Connection PowerSaving interface

## Connection PowerSaving interface Connection PowerSaving interface — client-side wrappers for the PowerSaving interface |

## Synopsis

    #include <telepathy-glib/connection.h>

    TpProxyPendingCall * tp_cli_connection_interface_power_saving_call_set_power_saving
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             gboolean in_Activate,
                                                             tp_cli_connection_interface_power_saving_callback_for_set_power_saving callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);
    void                (*tp_cli_connection_interface_power_saving_callback_for_set_power_saving)
                                                            (TpConnection *proxy,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);
    TpProxySignalConnection * tp_cli_connection_interface_power_saving_connect_to_power_saving_changed
                                                            (TpConnection *proxy,
                                                             tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object,
                                                             GError **error);
    void                (*tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed)
                                                            (TpConnection *proxy,
                                                             gboolean arg_Active,
                                                             gpointer user_data,
                                                             GObject *weak_object);

## Description

Some connection manager implementations can be instructed to try to save power on mobile devices by suppressing non-essential traffic, such as presence notifications. This section documents auto-generated C wrappers for the PowerSaving D-Bus interface.

## Details

### tp_cli_connection_interface_power_saving_call_set_power_saving ()

    TpProxyPendingCall * tp_cli_connection_interface_power_saving_call_set_power_saving
                                                            (TpConnection *proxy,
                                                             gint timeout_ms,
                                                             gboolean in_Activate,
                                                             tp_cli_connection_interface_power_saving_callback_for_set_power_saving callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object);

Start a SetPowerSaving method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Turn power saving mode on or off.</p> <tp:rationale> <p>Depending on the device's activity level, the connection can have its power saving mode turned on or off.</p> </tp:rationale> <p>Errors raised by this method indicate that power saving could not be enabled, which SHOULD NOT generally be treated as fatal.</p> <tp:rationale> If the CM cannot switch modes, either because of the protocol (<code>NotImplemented</code>), or because of the service (<code>NotAvailable</code>), Mission Control (or whoever manages this) should be made aware. The error could be ignored or, in the extreme, be fascist and disconnect the account. </tp:rationale>

`proxy` : | the TpProxy
`timeout_ms` : | the timeout in milliseconds, or -1 to use the default
`in_Activate` : | Used to pass an 'in' argument: <code>True</code> if protocol-level power saving features should be activated; <code>False</code> if they should be de-activated.
`callback` : | called when the method call succeeds or fails; may be `NULL` to make a "fire and forget" call with no reply tracking
`user_data` : | user-supplied data passed to the callback; must be `NULL` if `callback` is `NULL`
`destroy` : | called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be `NULL` if `callback` is `NULL`
`weak_object` : | If not `NULL`, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be `NULL` if `callback` is `NULL`
Returns : | a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

### tp_cli_connection_interface_power_saving_callback_for_set_power_saving ()

    void                (*tp_cli_connection_interface_power_saving_callback_for_set_power_saving)
                                                            (TpConnection *proxy,
                                                             const GError *error,
                                                             gpointer user_data,
                                                             GObject *weak_object);

Signature of the callback called when a SetPowerSaving method call succeeds or fails.

`proxy` : | the proxy on which the call was made
`error` : | `NULL` on success, or an error on failure
`user_data` : | user-supplied data
`weak_object` : | user-supplied object

### tp_cli_connection_interface_power_saving_connect_to_power_saving_changed ()

    TpProxySignalConnection * tp_cli_connection_interface_power_saving_connect_to_power_saving_changed
                                                            (TpConnection *proxy,
                                                             tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed callback,
                                                             gpointer user_data,
                                                             GDestroyNotify destroy,
                                                             GObject *weak_object,
                                                             GError **error);

Connect a handler to the signal PowerSavingChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The <tp:member-ref>PowerSavingActive</tp:member-ref> property changed.

`proxy` : | A TpConnection or subclass
`callback` : | Callback to be called when the signal is received
`user_data` : | User-supplied data for the callback
`destroy` : | Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns `NULL`
`weak_object` : | A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected
`error` : | If not `NULL`, used to raise an error if `NULL` is returned
Returns : | a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or `NULL` if the proxy does not have the desired interface or has become invalid.

### tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed ()

    void                (*tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed)
                                                            (TpConnection *proxy,
                                                             gboolean arg_Active,
                                                             gpointer user_data,
                                                             GObject *weak_object);

Represents the signature of a callback for the signal PowerSavingChanged.

`proxy` : | The proxy on which `tp_cli_connection_interface_power_saving_connect_to_power_saving_changed()` was called
`arg_Active` : | The new state of the power saving feature.
`user_data` : | User-supplied data
`weak_object` : | User-supplied weakly referenced object