1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3
* Copyright (C) 2008-2010 Richard Hughes <richard@hughsie.com>
5
* Licensed under the GNU General Public License Version 2
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
#if !defined (__UPOWER_H_INSIDE__) && !defined (UP_COMPILATION)
23
#error "Only <upower.h> can be included directly."
29
#include <glib-object.h>
32
#include <libupower-glib/up-device.h>
36
#define UP_TYPE_CLIENT (up_client_get_type ())
37
#define UP_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_CLIENT, UpClient))
38
#define UP_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_CLIENT, UpClientClass))
39
#define UP_IS_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_CLIENT))
40
#define UP_IS_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_CLIENT))
41
#define UP_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_CLIENT, UpClientClass))
42
#define UP_CLIENT_ERROR (up_client_error_quark ())
43
#define UP_CLIENT_TYPE_ERROR (up_client_error_get_type ())
45
typedef struct _UpClientPrivate UpClientPrivate;
50
UpClientPrivate *priv;
55
GObjectClass parent_class;
56
void (*device_added) (UpClient *client,
58
void (*device_changed) (UpClient *client,
60
void (*device_removed) (UpClient *client,
62
void (*changed) (UpClient *client);
63
/* FIXME: remove when we next break API */
64
void (*notify_sleep) (UpClient *client,
65
UpSleepKind sleep_kind);
66
/* FIXME: remove when we next break API */
67
void (*notify_resume) (UpClient *client,
68
UpSleepKind sleep_kind);
70
/* Padding for future expansion */
71
void (*_up_client_reserved1) (void);
72
void (*_up_client_reserved2) (void);
73
void (*_up_client_reserved3) (void);
74
void (*_up_client_reserved4) (void);
75
void (*_up_client_reserved5) (void);
76
void (*_up_client_reserved6) (void);
77
void (*_up_client_reserved7) (void);
78
void (*_up_client_reserved8) (void);
82
GType up_client_get_type (void);
83
UpClient *up_client_new (void);
86
gboolean up_client_get_properties_sync (UpClient *client,
87
GCancellable *cancellable,
89
gboolean up_client_enumerate_devices_sync (UpClient *client,
90
GCancellable *cancellable,
92
#ifdef UPOWER_ENABLE_DEPRECATED
93
gboolean up_client_suspend_sync (UpClient *client,
94
GCancellable *cancellable,
96
gboolean up_client_about_to_sleep_sync (UpClient *client,
97
UpSleepKind sleep_kind,
98
GCancellable *cancellable,
100
gboolean up_client_hibernate_sync (UpClient *client,
101
GCancellable *cancellable,
106
GPtrArray *up_client_get_devices (UpClient *client);
107
const gchar *up_client_get_daemon_version (UpClient *client);
108
#ifdef UPOWER_ENABLE_DEPRECATED
109
gboolean up_client_get_can_hibernate (UpClient *client);
111
gboolean up_client_get_lid_is_closed (UpClient *client);
112
gboolean up_client_get_lid_is_present (UpClient *client);
113
gboolean up_client_get_lid_force_sleep (UpClient *client);
114
gboolean up_client_get_is_docked (UpClient *client);
115
#ifdef UPOWER_ENABLE_DEPRECATED
116
gboolean up_client_get_can_suspend (UpClient *client);
118
gboolean up_client_get_on_battery (UpClient *client);
119
gboolean up_client_get_on_low_battery (UpClient *client);
123
#endif /* __UP_CLIENT_H */