2010-01-25 15:20:09 +00:00
|
|
|
/* -*- 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
|
2010-01-27 16:27:15 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2010-01-25 15:20:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
2010-01-25 16:26:47 +00:00
|
|
|
/**
|
2010-01-26 10:53:04 +00:00
|
|
|
* UpDeviceKind:
|
2010-01-25 16:26:47 +00:00
|
|
|
*
|
|
|
|
|
* The device type.
|
|
|
|
|
**/
|
2010-01-25 15:20:09 +00:00
|
|
|
typedef enum {
|
2010-01-26 10:53:04 +00:00
|
|
|
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,
|
2010-05-28 11:45:44 +01:00
|
|
|
UP_DEVICE_KIND_MEDIA_PLAYER,
|
|
|
|
|
UP_DEVICE_KIND_TABLET,
|
2010-06-01 14:25:10 +01:00
|
|
|
UP_DEVICE_KIND_COMPUTER,
|
lib: Add UP_DEVICE_KIND_GAMING_INPUT for gaming devices
Joypads, joysticks, dance mats, paddles, Wiimotes, steering wheels,
tractor cabin simulators, pedals, yokes, breathing controllers, and,
hmm, etc.
https://bugs.freedesktop.org/show_bug.cgi?id=102493
2017-08-31 15:33:49 +02:00
|
|
|
UP_DEVICE_KIND_GAMING_INPUT,
|
2019-10-24 12:50:26 +02:00
|
|
|
UP_DEVICE_KIND_PEN,
|
2020-12-16 11:55:41 +01:00
|
|
|
UP_DEVICE_KIND_TOUCHPAD,
|
2021-01-20 10:12:14 +01:00
|
|
|
UP_DEVICE_KIND_MODEM,
|
|
|
|
|
UP_DEVICE_KIND_NETWORK,
|
|
|
|
|
UP_DEVICE_KIND_HEADSET,
|
|
|
|
|
UP_DEVICE_KIND_SPEAKERS,
|
|
|
|
|
UP_DEVICE_KIND_HEADPHONES,
|
|
|
|
|
UP_DEVICE_KIND_VIDEO,
|
|
|
|
|
UP_DEVICE_KIND_OTHER_AUDIO,
|
|
|
|
|
UP_DEVICE_KIND_REMOTE_CONTROL,
|
|
|
|
|
UP_DEVICE_KIND_PRINTER,
|
|
|
|
|
UP_DEVICE_KIND_SCANNER,
|
|
|
|
|
UP_DEVICE_KIND_CAMERA,
|
|
|
|
|
UP_DEVICE_KIND_WEARABLE,
|
|
|
|
|
UP_DEVICE_KIND_TOY,
|
2010-01-26 10:53:04 +00:00
|
|
|
UP_DEVICE_KIND_LAST
|
|
|
|
|
} UpDeviceKind;
|
2010-01-25 15:20:09 +00:00
|
|
|
|
2010-01-25 16:26:47 +00:00
|
|
|
/**
|
|
|
|
|
* UpDeviceState:
|
|
|
|
|
*
|
|
|
|
|
* The device state.
|
|
|
|
|
**/
|
2010-01-25 15:20:09 +00:00
|
|
|
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;
|
|
|
|
|
|
2010-01-25 16:26:47 +00:00
|
|
|
/**
|
|
|
|
|
* UpDeviceTechnology:
|
|
|
|
|
*
|
|
|
|
|
* The device technology.
|
|
|
|
|
**/
|
2010-01-25 15:20:09 +00:00
|
|
|
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;
|
|
|
|
|
|
2013-10-11 11:20:37 +02:00
|
|
|
/**
|
|
|
|
|
* UpDeviceLevel:
|
|
|
|
|
*
|
2017-10-19 17:19:15 +02:00
|
|
|
* 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
|
2013-10-11 11:20:37 +02:00
|
|
|
**/
|
|
|
|
|
typedef enum {
|
|
|
|
|
UP_DEVICE_LEVEL_UNKNOWN,
|
|
|
|
|
UP_DEVICE_LEVEL_NONE,
|
2013-10-14 14:33:54 +02:00
|
|
|
UP_DEVICE_LEVEL_DISCHARGING,
|
2013-10-11 11:20:37 +02:00
|
|
|
UP_DEVICE_LEVEL_LOW,
|
|
|
|
|
UP_DEVICE_LEVEL_CRITICAL,
|
|
|
|
|
UP_DEVICE_LEVEL_ACTION,
|
2017-04-04 18:16:10 +02:00
|
|
|
UP_DEVICE_LEVEL_NORMAL,
|
|
|
|
|
UP_DEVICE_LEVEL_HIGH,
|
|
|
|
|
UP_DEVICE_LEVEL_FULL,
|
2013-10-11 11:20:37 +02:00
|
|
|
UP_DEVICE_LEVEL_LAST
|
|
|
|
|
} UpDeviceLevel;
|
|
|
|
|
|
2010-01-26 10:53:04 +00:00
|
|
|
const gchar *up_device_kind_to_string (UpDeviceKind type_enum);
|
2010-01-25 15:20:09 +00:00
|
|
|
const gchar *up_device_state_to_string (UpDeviceState state_enum);
|
|
|
|
|
const gchar *up_device_technology_to_string (UpDeviceTechnology technology_enum);
|
2013-10-11 11:20:37 +02:00
|
|
|
const gchar *up_device_level_to_string (UpDeviceLevel level_enum);
|
2010-01-26 10:53:04 +00:00
|
|
|
UpDeviceKind up_device_kind_from_string (const gchar *type);
|
2010-01-25 15:20:09 +00:00
|
|
|
UpDeviceState up_device_state_from_string (const gchar *state);
|
|
|
|
|
UpDeviceTechnology up_device_technology_from_string (const gchar *technology);
|
2013-10-11 11:20:37 +02:00
|
|
|
UpDeviceLevel up_device_level_from_string (const gchar *level);
|
2010-01-25 15:20:09 +00:00
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif /* __UP_TYPES_H */
|
|
|
|
|
|