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

« back to all changes in this revision

Viewing changes to src/up-history.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_HISTORY_H
 
23
#define __UP_HISTORY_H
 
24
 
 
25
#include <glib-object.h>
 
26
 
 
27
#include "up-types.h"
 
28
 
 
29
G_BEGIN_DECLS
 
30
 
 
31
#define UP_TYPE_HISTORY         (up_history_get_type ())
 
32
#define UP_HISTORY(o)                   (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_HISTORY, UpHistory))
 
33
#define UP_HISTORY_CLASS(k)             (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_HISTORY, UpHistoryClass))
 
34
#define UP_IS_HISTORY(o)                (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_HISTORY))
 
35
#define UP_IS_HISTORY_CLASS(k)          (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_HISTORY))
 
36
#define UP_HISTORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_HISTORY, UpHistoryClass))
 
37
#define UP_HISTORY_ERROR                (up_history_error_quark ())
 
38
#define UP_HISTORY_TYPE_ERROR           (up_history_error_get_type ())
 
39
 
 
40
typedef struct UpHistoryPrivate UpHistoryPrivate;
 
41
 
 
42
typedef struct
 
43
{
 
44
         GObject                 parent;
 
45
         UpHistoryPrivate       *priv;
 
46
} UpHistory;
 
47
 
 
48
typedef struct
 
49
{
 
50
        GObjectClass             parent_class;
 
51
} UpHistoryClass;
 
52
 
 
53
typedef enum {
 
54
        UP_HISTORY_TYPE_CHARGE,
 
55
        UP_HISTORY_TYPE_RATE,
 
56
        UP_HISTORY_TYPE_TIME_FULL,
 
57
        UP_HISTORY_TYPE_TIME_EMPTY,
 
58
        UP_HISTORY_TYPE_UNKNOWN
 
59
} UpHistoryType;
 
60
 
 
61
 
 
62
GType            up_history_get_type                    (void);
 
63
UpHistory       *up_history_new                 (void);
 
64
void             up_history_test                        (gpointer        user_data);
 
65
 
 
66
GPtrArray       *up_history_get_data                    (UpHistory              *history,
 
67
                                                         UpHistoryType           type,
 
68
                                                         guint                   timespan,
 
69
                                                         guint                   resolution);
 
70
GPtrArray       *up_history_get_profile_data            (UpHistory              *history,
 
71
                                                         gboolean                charging);
 
72
gboolean         up_history_set_id                      (UpHistory              *history,
 
73
                                                         const gchar            *id);
 
74
gboolean         up_history_set_state                   (UpHistory              *history,
 
75
                                                         UpDeviceState           state);
 
76
gboolean         up_history_set_charge_data             (UpHistory              *history,
 
77
                                                         gdouble                 percentage);
 
78
gboolean         up_history_set_rate_data               (UpHistory              *history,
 
79
                                                         gdouble                 rate);
 
80
gboolean         up_history_set_time_full_data          (UpHistory              *history,
 
81
                                                         gint64                  time);
 
82
gboolean         up_history_set_time_empty_data (UpHistory              *history,
 
83
                                                         gint64                  time);
 
84
 
 
85
G_END_DECLS
 
86
 
 
87
#endif /* __UP_HISTORY_H */
 
88