summaryrefslogtreecommitdiff
path: root/libupower-glib/up-types.h
blob: 379d46cf84e38e5853b5c5f4c04be70bda7b3743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2008 Richard Hughes <richard@hughsie.com>
 *
 * Licensed under the GNU General Public License Version 2
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#if !defined (__UPOWER_H_INSIDE__) && !defined (UP_COMPILATION)
#error "Only <upower.h> can be included directly."
#endif

#ifndef __UP_TYPES_H
#define __UP_TYPES_H

#include <glib-object.h>

G_BEGIN_DECLS

/**
 * UpDeviceKind:
 *
 * The device type.
 **/
typedef enum {
	UP_DEVICE_KIND_UNKNOWN,
	UP_DEVICE_KIND_LINE_POWER,
	UP_DEVICE_KIND_BATTERY,
	UP_DEVICE_KIND_UPS,
	UP_DEVICE_KIND_MONITOR,
	UP_DEVICE_KIND_MOUSE,
	UP_DEVICE_KIND_KEYBOARD,
	UP_DEVICE_KIND_PDA,
	UP_DEVICE_KIND_PHONE,
	UP_DEVICE_KIND_MEDIA_PLAYER,
	UP_DEVICE_KIND_TABLET,
	UP_DEVICE_KIND_COMPUTER,
	UP_DEVICE_KIND_GAMING_INPUT,
	UP_DEVICE_KIND_PEN,
	UP_DEVICE_KIND_LAST
} UpDeviceKind;

/**
 * UpDeviceState:
 *
 * The device state.
 **/
typedef enum {
	UP_DEVICE_STATE_UNKNOWN,
	UP_DEVICE_STATE_CHARGING,
	UP_DEVICE_STATE_DISCHARGING,
	UP_DEVICE_STATE_EMPTY,
	UP_DEVICE_STATE_FULLY_CHARGED,
	UP_DEVICE_STATE_PENDING_CHARGE,
	UP_DEVICE_STATE_PENDING_DISCHARGE,
	UP_DEVICE_STATE_LAST
} UpDeviceState;

/**
 * UpDeviceTechnology:
 *
 * The device technology.
 **/
typedef enum {
	UP_DEVICE_TECHNOLOGY_UNKNOWN,
	UP_DEVICE_TECHNOLOGY_LITHIUM_ION,
	UP_DEVICE_TECHNOLOGY_LITHIUM_POLYMER,
	UP_DEVICE_TECHNOLOGY_LITHIUM_IRON_PHOSPHATE,
	UP_DEVICE_TECHNOLOGY_LEAD_ACID,
	UP_DEVICE_TECHNOLOGY_NICKEL_CADMIUM,
	UP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE,
	UP_DEVICE_TECHNOLOGY_LAST
} UpDeviceTechnology;

/**
 * UpDeviceLevel:
 *
 * The level of a battery. Only values up to, and including
 * %UP_DEVICE_LEVEL_ACTION are relevant for the #WarningLevel.
 * The #BatteryLevel only uses the following values:
 * - %UP_DEVICE_LEVEL_UNKNOWN
 * - %UP_DEVICE_LEVEL_NONE
 * - %UP_DEVICE_LEVEL_LOW
 * - %UP_DEVICE_LEVEL_CRITICAL
 * - %UP_DEVICE_LEVEL_NORMAL
 * - %UP_DEVICE_LEVEL_HIGH
 * - %UP_DEVICE_LEVEL_FULL
 **/
typedef enum {
	UP_DEVICE_LEVEL_UNKNOWN,
	UP_DEVICE_LEVEL_NONE,
	UP_DEVICE_LEVEL_DISCHARGING,
	UP_DEVICE_LEVEL_LOW,
	UP_DEVICE_LEVEL_CRITICAL,
	UP_DEVICE_LEVEL_ACTION,
	UP_DEVICE_LEVEL_NORMAL,
	UP_DEVICE_LEVEL_HIGH,
	UP_DEVICE_LEVEL_FULL,
	UP_DEVICE_LEVEL_LAST
} UpDeviceLevel;

const gchar	*up_device_kind_to_string		(UpDeviceKind		 type_enum);
const gchar	*up_device_state_to_string		(UpDeviceState		 state_enum);
const gchar	*up_device_technology_to_string		(UpDeviceTechnology	 technology_enum);
const gchar	*up_device_level_to_string		(UpDeviceLevel		 level_enum);
UpDeviceKind	 up_device_kind_from_string		(const gchar		*type);
UpDeviceState	 up_device_state_from_string		(const gchar		*state);
UpDeviceTechnology up_device_technology_from_string	(const gchar		*technology);
UpDeviceLevel	 up_device_level_from_string		(const gchar		*level);

G_END_DECLS

#endif /* __UP_TYPES_H */