~ubuntu-branches/ubuntu/wily/upower/wily

« back to all changes in this revision

Viewing changes to .pc/no_deprecation_define.patch/libupower-glib/up-client.h

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-03-19 19:19:51 UTC
  • mfrom: (17.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130319191951-2lmdpe40kitm2zbx
Tags: 0.9.20-1
* New upstream release.
* Bump libpolkit-gobject-1-dev build dependency as per upstream
  configure.ac.
* Build with --enable-deprecated, we are not ready yet to drop
  suspend/hibernate functionality.
* Bump Standards-Version to 3.9.4. No changes necessary.
* Add "build" autopkgtest to compile/link/run a simple program against
  libupower-glib.
* Drop unnecessary "needs-root" restriction from upstream-system
  autopkgtest.
* Add no_deprecation_define.patch: Do not require applications to define
  UPOWER_ENABLE_DEPRECATED to access suspend/resume functionality. We are
  not ready to do that yet in Debian.

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-2010 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_CLIENT_H
 
27
#define __UP_CLIENT_H
 
28
 
 
29
#include <glib-object.h>
 
30
#include <gio/gio.h>
 
31
 
 
32
#include <libupower-glib/up-device.h>
 
33
 
 
34
G_BEGIN_DECLS
 
35
 
 
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 ())
 
44
 
 
45
typedef struct _UpClientPrivate UpClientPrivate;
 
46
 
 
47
typedef struct
 
48
{
 
49
         GObject                 parent;
 
50
         UpClientPrivate        *priv;
 
51
} UpClient;
 
52
 
 
53
typedef struct
 
54
{
 
55
        GObjectClass             parent_class;
 
56
        void                    (*device_added)         (UpClient               *client,
 
57
                                                         UpDevice               *device);
 
58
        void                    (*device_changed)       (UpClient               *client,
 
59
                                                         UpDevice               *device);
 
60
        void                    (*device_removed)       (UpClient               *client,
 
61
                                                         UpDevice               *device);
 
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);
 
69
        /*< private >*/
 
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);
 
79
} UpClientClass;
 
80
 
 
81
/* general */
 
82
GType            up_client_get_type                     (void);
 
83
UpClient        *up_client_new                          (void);
 
84
 
 
85
/* sync versions */
 
86
gboolean         up_client_get_properties_sync          (UpClient               *client,
 
87
                                                         GCancellable           *cancellable,
 
88
                                                         GError                 **error);
 
89
gboolean         up_client_enumerate_devices_sync       (UpClient               *client,
 
90
                                                         GCancellable           *cancellable,
 
91
                                                         GError                 **error);
 
92
#ifdef UPOWER_ENABLE_DEPRECATED
 
93
gboolean         up_client_suspend_sync                 (UpClient               *client,
 
94
                                                         GCancellable           *cancellable,
 
95
                                                         GError                 **error);
 
96
gboolean         up_client_about_to_sleep_sync          (UpClient               *client,
 
97
                                                         UpSleepKind             sleep_kind,
 
98
                                                         GCancellable           *cancellable,
 
99
                                                         GError                 **error);
 
100
gboolean         up_client_hibernate_sync               (UpClient               *client,
 
101
                                                         GCancellable           *cancellable,
 
102
                                                         GError                 **error);
 
103
#endif
 
104
 
 
105
/* accessors */
 
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);
 
110
#endif
 
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);
 
117
#endif
 
118
gboolean         up_client_get_on_battery               (UpClient               *client);
 
119
gboolean         up_client_get_on_low_battery           (UpClient               *client);
 
120
 
 
121
G_END_DECLS
 
122
 
 
123
#endif /* __UP_CLIENT_H */
 
124