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 #if !defined (__UPOWER_H_INSIDE__) && !defined (UP_COMPILATION) 23 #error "Only <upower.h> can be included directly." 24 #endif 25 26 #ifndef __UP_TYPES_H 27 #define __UP_TYPES_H 28 29 #include <glib-object.h> 30 31 G_BEGIN_DECLS 32 33 /** 34 * UpDeviceKind: 35 * 36 * The device type. 37 **/ 38 typedef enum { 39 UP_DEVICE_KIND_UNKNOWN, 40 UP_DEVICE_KIND_LINE_POWER, 41 UP_DEVICE_KIND_BATTERY, 42 UP_DEVICE_KIND_UPS, 43 UP_DEVICE_KIND_MONITOR, 44 UP_DEVICE_KIND_MOUSE, 45 UP_DEVICE_KIND_KEYBOARD, 46 UP_DEVICE_KIND_PDA, 47 UP_DEVICE_KIND_PHONE, 48 UP_DEVICE_KIND_MEDIA_PLAYER, 49 UP_DEVICE_KIND_TABLET, 50 UP_DEVICE_KIND_COMPUTER, 51 UP_DEVICE_KIND_GAMING_INPUT, 52 UP_DEVICE_KIND_PEN, 53 UP_DEVICE_KIND_TOUCHPAD, 54 UP_DEVICE_KIND_MODEM, 55 UP_DEVICE_KIND_NETWORK, 56 UP_DEVICE_KIND_HEADSET, 57 UP_DEVICE_KIND_SPEAKERS, 58 UP_DEVICE_KIND_HEADPHONES, 59 UP_DEVICE_KIND_VIDEO, 60 UP_DEVICE_KIND_OTHER_AUDIO, 61 UP_DEVICE_KIND_REMOTE_CONTROL, 62 UP_DEVICE_KIND_PRINTER, 63 UP_DEVICE_KIND_SCANNER, 64 UP_DEVICE_KIND_CAMERA, 65 UP_DEVICE_KIND_WEARABLE, 66 UP_DEVICE_KIND_TOY, 67 UP_DEVICE_KIND_BLUETOOTH_GENERIC, 68 UP_DEVICE_KIND_LAST 69 } UpDeviceKind; 70 71 /** 72 * UpDeviceState: 73 * 74 * The device state. 75 **/ 76 typedef enum { 77 UP_DEVICE_STATE_UNKNOWN, 78 UP_DEVICE_STATE_CHARGING, 79 UP_DEVICE_STATE_DISCHARGING, 80 UP_DEVICE_STATE_EMPTY, 81 UP_DEVICE_STATE_FULLY_CHARGED, 82 UP_DEVICE_STATE_PENDING_CHARGE, 83 UP_DEVICE_STATE_PENDING_DISCHARGE, 84 UP_DEVICE_STATE_LAST 85 } UpDeviceState; 86 87 /** 88 * UpDeviceTechnology: 89 * 90 * The device technology. 91 **/ 92 typedef enum { 93 UP_DEVICE_TECHNOLOGY_UNKNOWN, 94 UP_DEVICE_TECHNOLOGY_LITHIUM_ION, 95 UP_DEVICE_TECHNOLOGY_LITHIUM_POLYMER, 96 UP_DEVICE_TECHNOLOGY_LITHIUM_IRON_PHOSPHATE, 97 UP_DEVICE_TECHNOLOGY_LEAD_ACID, 98 UP_DEVICE_TECHNOLOGY_NICKEL_CADMIUM, 99 UP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE, 100 UP_DEVICE_TECHNOLOGY_LAST 101 } UpDeviceTechnology; 102 103 /** 104 * UpDeviceLevel: 105 * 106 * The level of a battery. Only values up to, and including 107 * %UP_DEVICE_LEVEL_ACTION are relevant for the #WarningLevel. 108 * The #BatteryLevel only uses the following values: 109 * - %UP_DEVICE_LEVEL_UNKNOWN 110 * - %UP_DEVICE_LEVEL_NONE 111 * - %UP_DEVICE_LEVEL_LOW 112 * - %UP_DEVICE_LEVEL_CRITICAL 113 * - %UP_DEVICE_LEVEL_NORMAL 114 * - %UP_DEVICE_LEVEL_HIGH 115 * - %UP_DEVICE_LEVEL_FULL 116 **/ 117 typedef enum { 118 UP_DEVICE_LEVEL_UNKNOWN, 119 UP_DEVICE_LEVEL_NONE, 120 UP_DEVICE_LEVEL_DISCHARGING, 121 UP_DEVICE_LEVEL_LOW, 122 UP_DEVICE_LEVEL_CRITICAL, 123 UP_DEVICE_LEVEL_ACTION, 124 UP_DEVICE_LEVEL_NORMAL, 125 UP_DEVICE_LEVEL_HIGH, 126 UP_DEVICE_LEVEL_FULL, 127 UP_DEVICE_LEVEL_LAST 128 } UpDeviceLevel; 129 130 const gchar *up_device_kind_to_string (UpDeviceKind type_enum); 131 const gchar *up_device_state_to_string (UpDeviceState state_enum); 132 const gchar *up_device_technology_to_string (UpDeviceTechnology technology_enum); 133 const gchar *up_device_level_to_string (UpDeviceLevel level_enum); 134 UpDeviceKind up_device_kind_from_string (const gchar *type); 135 UpDeviceState up_device_state_from_string (const gchar *state); 136 UpDeviceTechnology up_device_technology_from_string (const gchar *technology); 137 UpDeviceLevel up_device_level_from_string (const gchar *level); 138 139 G_END_DECLS 140 141 #endif /* __UP_TYPES_H */ 142 143