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

« back to all changes in this revision

Viewing changes to libupower-glib/up-wakeups.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) 2009 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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_WAKEUPS_H
 
27
#define __UP_WAKEUPS_H
 
28
 
 
29
#include <glib-object.h>
 
30
#include <gio/gio.h>
 
31
 
 
32
#include <libupower-glib/up-types.h>
 
33
#include <libupower-glib/up-device.h>
 
34
#include <libupower-glib/up-wakeup-item.h>
 
35
 
 
36
G_BEGIN_DECLS
 
37
 
 
38
#define UP_TYPE_WAKEUPS         (up_wakeups_get_type ())
 
39
#define UP_WAKEUPS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_WAKEUPS, UpWakeups))
 
40
#define UP_WAKEUPS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_WAKEUPS, UpWakeupsClass))
 
41
#define UP_IS_WAKEUPS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_WAKEUPS))
 
42
#define UP_IS_WAKEUPS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_WAKEUPS))
 
43
#define UP_WAKEUPS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_WAKEUPS, UpWakeupsClass))
 
44
#define UP_WAKEUPS_ERROR        (up_wakeups_error_quark ())
 
45
#define UP_WAKEUPS_TYPE_ERROR   (up_wakeups_error_get_type ())
 
46
 
 
47
typedef struct UpWakeupsPrivate UpWakeupsPrivate;
 
48
 
 
49
typedef struct
 
50
{
 
51
         GObject                 parent;
 
52
         UpWakeupsPrivate       *priv;
 
53
} UpWakeups;
 
54
 
 
55
typedef struct
 
56
{
 
57
        GObjectClass             parent_class;
 
58
        void                    (*data_changed)         (UpWakeups              *wakeups);
 
59
        void                    (*total_changed)        (UpWakeups              *wakeups,
 
60
                                                         guint                   value);
 
61
} UpWakeupsClass;
 
62
 
 
63
GType            up_wakeups_get_type                    (void);
 
64
UpWakeups       *up_wakeups_new                         (void);
 
65
 
 
66
/* sync versions */
 
67
guint            up_wakeups_get_total_sync              (UpWakeups              *wakeups,
 
68
                                                         GCancellable           *cancellable,
 
69
                                                         GError                 **error);
 
70
GPtrArray       *up_wakeups_get_data_sync               (UpWakeups              *wakeups,
 
71
                                                         GCancellable           *cancellable,
 
72
                                                         GError                 **error);
 
73
gboolean         up_wakeups_get_properties_sync         (UpWakeups              *wakeups,
 
74
                                                         GCancellable           *cancellable,
 
75
                                                         GError                 **error);
 
76
 
 
77
/* accessors */
 
78
gboolean         up_wakeups_get_has_capability          (UpWakeups              *wakeups);
 
79
 
 
80
G_END_DECLS
 
81
 
 
82
#endif /* __UP_WAKEUPS_H */
 
83