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

« back to all changes in this revision

Viewing changes to src/up-qos.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
#ifndef __UP_QOS_H
 
23
#define __UP_QOS_H
 
24
 
 
25
#include <glib-object.h>
 
26
#include <dbus/dbus-glib.h>
 
27
 
 
28
G_BEGIN_DECLS
 
29
 
 
30
#define UP_TYPE_QOS             (up_qos_get_type ())
 
31
#define UP_QOS(o)               (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_QOS, UpQos))
 
32
#define UP_QOS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_QOS, UpQosClass))
 
33
#define UP_IS_QOS(o)            (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_QOS))
 
34
#define UP_IS_QOS_CLASS(k)      (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_QOS))
 
35
#define UP_QOS_GET_CLASS(o)     (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_QOS, UpQosClass))
 
36
 
 
37
typedef struct UpQosPrivate UpQosPrivate;
 
38
 
 
39
typedef struct
 
40
{
 
41
        GObject           parent;
 
42
        UpQosPrivate     *priv;
 
43
} UpQos;
 
44
 
 
45
typedef struct
 
46
{
 
47
        GObjectClass    parent_class;
 
48
        void            (* latency_changed)             (UpQos          *qos,
 
49
                                                         const gchar    *type,
 
50
                                                         gint            value);
 
51
        void            (* requests_changed)            (UpQos          *qos);
 
52
} UpQosClass;
 
53
 
 
54
UpQos           *up_qos_new                             (void);
 
55
GType            up_qos_get_type                        (void);
 
56
void             up_qos_test                            (gpointer        user_data);
 
57
 
 
58
void             up_qos_request_latency         (UpQos          *qos,
 
59
                                                         const gchar    *type,
 
60
                                                         gint            value,
 
61
                                                         gboolean        persistent,
 
62
                                                         DBusGMethodInvocation *context);
 
63
void             up_qos_cancel_request                  (UpQos          *qos,
 
64
                                                         guint32         cookie,
 
65
                                                         DBusGMethodInvocation *context);
 
66
void             up_qos_set_minimum_latency             (UpQos          *qos,
 
67
                                                         const gchar    *type,
 
68
                                                         gint            value,
 
69
                                                         DBusGMethodInvocation *context);
 
70
gboolean         up_qos_get_latency                     (UpQos          *qos,
 
71
                                                         const gchar    *type,
 
72
                                                         gint           *value,
 
73
                                                         GError         **error);
 
74
gboolean         up_qos_get_latency_requests            (UpQos          *qos,
 
75
                                                         GPtrArray      **requests,
 
76
                                                         GError         **error);
 
77
 
 
78
G_END_DECLS
 
79
 
 
80
#endif  /* __UP_QOS_H */