1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3
* Copyright (C) 2008 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-types.h>
36
#define UP_TYPE_DEVICE (up_device_get_type ())
37
#define UP_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_DEVICE, UpDevice))
38
#define UP_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_DEVICE, UpDeviceClass))
39
#define UP_IS_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_DEVICE))
40
#define UP_IS_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_DEVICE))
41
#define UP_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_DEVICE, UpDeviceClass))
42
#define UP_DEVICE_ERROR (up_device_error_quark ())
43
#define UP_DEVICE_TYPE_ERROR (up_device_error_get_type ())
45
typedef struct _UpDevicePrivate UpDevicePrivate;
50
UpDevicePrivate *priv;
55
GObjectClass parent_class;
56
void (*changed) (UpDevice *device,
59
/* Padding for future expansion */
60
void (*_up_device_reserved1) (void);
61
void (*_up_device_reserved2) (void);
62
void (*_up_device_reserved3) (void);
63
void (*_up_device_reserved4) (void);
64
void (*_up_device_reserved5) (void);
65
void (*_up_device_reserved6) (void);
66
void (*_up_device_reserved7) (void);
67
void (*_up_device_reserved8) (void);
71
GType up_device_get_type (void);
72
UpDevice *up_device_new (void);
73
gchar *up_device_to_text (UpDevice *device);
76
gboolean up_device_refresh_sync (UpDevice *device,
77
GCancellable *cancellable,
79
gboolean up_device_set_object_path_sync (UpDevice *device,
80
const gchar *object_path,
81
GCancellable *cancellable,
83
GPtrArray *up_device_get_history_sync (UpDevice *device,
87
GCancellable *cancellable,
89
GPtrArray *up_device_get_statistics_sync (UpDevice *device,
91
GCancellable *cancellable,
95
const gchar *up_device_get_object_path (UpDevice *device);
99
#endif /* __UP_DEVICE_H */