## up-types up-types — Types used by UPower and libupower-glib |

## Functions

const gchar * | up_device_kind_to_string ()
const gchar * | up_device_state_to_string ()
const gchar * | up_device_technology_to_string ()
const gchar * | up_device_level_to_string ()
UpDeviceKind | up_device_kind_from_string ()
UpDeviceState | up_device_state_from_string ()
UpDeviceTechnology | up_device_technology_from_string ()
UpDeviceLevel | up_device_level_from_string ()

## Types and Values

enum | UpDeviceKind
enum | UpDeviceState
enum | UpDeviceTechnology
enum | UpDeviceLevel

## Description

These helper functions provide a way to marshal enumerated values to text and back again.

## Functions

### up_device_kind_to_string ()

    const gchar *
    up_device_kind_to_string (UpDeviceKind type_enum);

Converts a UpDeviceKind to a string.

#### Returns

identifier string

Since: 0.9.0

### up_device_state_to_string ()

    const gchar *
    up_device_state_to_string (UpDeviceState state_enum);

Converts a UpDeviceState to a string.

#### Returns

identifier string

Since: 0.9.0

### up_device_technology_to_string ()

    const gchar *
    up_device_technology_to_string (UpDeviceTechnology technology_enum);

Converts a UpDeviceTechnology to a string.

#### Returns

identifier string

Since: 0.9.0

### up_device_level_to_string ()

    const gchar *
    up_device_level_to_string (UpDeviceLevel level_enum);

Converts a UpDeviceLevel to a string.

#### Returns

identifier string

Since: 1.0

### up_device_kind_from_string ()

    UpDeviceKind
    up_device_kind_from_string (const gchar *type);

Converts a string to a UpDeviceKind.

#### Returns

enumerated value

Since: 0.9.0

### up_device_state_from_string ()

    UpDeviceState
    up_device_state_from_string (const gchar *state);

Converts a string to a UpDeviceState.

#### Returns

enumerated value

Since: 0.9.0

### up_device_technology_from_string ()

    UpDeviceTechnology
    up_device_technology_from_string (const gchar *technology);

Converts a string to a UpDeviceTechnology.

#### Returns

enumerated value

Since: 0.9.0

### up_device_level_from_string ()

    UpDeviceLevel
    up_device_level_from_string (const gchar *level);

Converts a string to a UpDeviceLevel.

#### Returns

enumerated value

Since: 1.0

## Types and Values

### enum UpDeviceKind

The device type.

#### Members

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_LAST |  |

### enum UpDeviceState

The device state.

#### Members

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 |  |

### enum UpDeviceTechnology

The device technology.

#### Members

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 |  |

### enum 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`

#### Members

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 |  |

## See Also

UpClient, UpDevice