~xavi-garcia-mena/ubuntu/vivid/upower/percentages-power-off

« back to all changes in this revision

Viewing changes to libupower-glib/up-device.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-02-16 10:16:24 UTC
  • Revision ID: james.westby@ubuntu.com-20100216101624-2cmwqsr1ndftdd87
Tags: upstream-0.9.0+git20100216.72bb2
ImportĀ upstreamĀ versionĀ 0.9.0+git20100216.72bb2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2008 Richard Hughes <richard@hughsie.com>
 
4
 *
 
5
 * Licensed under the GNU General Public License Version 2
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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.
 
20
 */
 
21
 
 
22
#if !defined (__UPOWER_H_INSIDE__) && !defined (UP_COMPILATION)
 
23
#error "Only <upower.h> can be included directly."
 
24
#endif
 
25
 
 
26
#ifndef __UP_DEVICE_H
 
27
#define __UP_DEVICE_H
 
28
 
 
29
#include <glib-object.h>
 
30
#include <gio/gio.h>
 
31
 
 
32
#include <libupower-glib/up-types.h>
 
33
 
 
34
G_BEGIN_DECLS
 
35
 
 
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 ())
 
44
 
 
45
typedef struct _UpDevicePrivate UpDevicePrivate;
 
46
 
 
47
typedef struct
 
48
{
 
49
         GObject                 parent;
 
50
         UpDevicePrivate        *priv;
 
51
} UpDevice;
 
52
 
 
53
typedef struct
 
54
{
 
55
        GObjectClass             parent_class;
 
56
        void                    (*changed)              (UpDevice               *device,
 
57
                                                         gpointer               *obj);
 
58
        /*< private >*/
 
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);
 
68
} UpDeviceClass;
 
69
 
 
70
/* general */
 
71
GType            up_device_get_type                     (void);
 
72
UpDevice        *up_device_new                          (void);
 
73
gchar           *up_device_to_text                      (UpDevice               *device);
 
74
 
 
75
/* sync versions */
 
76
gboolean         up_device_refresh_sync                 (UpDevice               *device,
 
77
                                                         GCancellable           *cancellable,
 
78
                                                         GError                 **error);
 
79
gboolean         up_device_set_object_path_sync         (UpDevice               *device,
 
80
                                                         const gchar            *object_path,
 
81
                                                         GCancellable           *cancellable,
 
82
                                                         GError                 **error);
 
83
GPtrArray       *up_device_get_history_sync             (UpDevice               *device,
 
84
                                                         const gchar            *type,
 
85
                                                         guint                   timespec,
 
86
                                                         guint                   resolution,
 
87
                                                         GCancellable           *cancellable,
 
88
                                                         GError                 **error);
 
89
GPtrArray       *up_device_get_statistics_sync          (UpDevice               *device,
 
90
                                                         const gchar            *type,
 
91
                                                         GCancellable           *cancellable,
 
92
                                                         GError                 **error);
 
93
 
 
94
/* accessors */
 
95
const gchar     *up_device_get_object_path              (UpDevice               *device);
 
96
 
 
97
G_END_DECLS
 
98
 
 
99
#endif /* __UP_DEVICE_H */
 
100