## PhoshTorchManager

PhoshTorchManager — Interacts with torch via UPower

## Functions

PhoshTorchManager * | phosh_torch_manager_new ()
const char * | phosh_torch_manager_get_icon_name ()
gboolean | phosh_torch_manager_get_enabled ()
gboolean | phosh_torch_manager_get_present ()
void | phosh_torch_manager_toggle ()
int | phosh_torch_manager_get_brightness ()
double | phosh_torch_manager_get_scaled_brightness ()
void | phosh_torch_manager_set_scaled_brightness ()
int | phosh_torch_manager_get_max_brightness ()

## Properties

int | brightness | Read
gboolean | enabled | Read
char * | icon-name | Read
gboolean | present | Read

## Types and Values

#define | PHOSH_TYPE_TORCH_MANAGER
| PhoshTorchManager

## Object Hierarchy

        GObject
        ╰── PhoshManager
            ╰── PhoshTorchManager

## Description

PhoshTorchManager tracks the torch status and allows to set the brightness.

## Functions

### phosh_torch_manager_new ()

    PhoshTorchManager *
    phosh_torch_manager_new (void);

### phosh_torch_manager_get_icon_name ()

    const char *
    phosh_torch_manager_get_icon_name (PhoshTorchManager *self);

### phosh_torch_manager_get_enabled ()

    gboolean
    phosh_torch_manager_get_enabled (PhoshTorchManager *self);

### phosh_torch_manager_get_present ()

    gboolean
    phosh_torch_manager_get_present (PhoshTorchManager *self);

### phosh_torch_manager_toggle ()

    void
    phosh_torch_manager_toggle (PhoshTorchManager *self);

### phosh_torch_manager_get_brightness ()

    int
    phosh_torch_manager_get_brightness (PhoshTorchManager *self);

### phosh_torch_manager_get_scaled_brightness ()

    double
    phosh_torch_manager_get_scaled_brightness
                                   (PhoshTorchManager *self);

Gets the current brightness as fraction between 0 (off) and 1 (maximum brightness)

#### Parameters

self | The PhoshTorchManager |

### phosh_torch_manager_set_scaled_brightness ()

    void
    phosh_torch_manager_set_scaled_brightness
                                   (PhoshTorchManager *self,
                                    double frac);

Sets the current brightness as fraction between 0 (off) and 1 (maximum brightness)

#### Parameters

self | The PhoshTorchManager |
frac | The brightness as fraction |

### phosh_torch_manager_get_max_brightness ()

    int
    phosh_torch_manager_get_max_brightness
                                   (PhoshTorchManager *self);

## Types and Values

### PHOSH_TYPE_TORCH_MANAGER

    #define PHOSH_TYPE_TORCH_MANAGER (phosh_torch_manager_get_type ())

### PhoshTorchManager

    typedef struct _PhoshTorchManager PhoshTorchManager;

## Property Details

### The `“brightness”` property

      “brightness”               int

The torch brightness.

Owner: PhoshTorchManager

Flags: Read

Allowed values: >= 0

Default value: 0

### The `“enabled”` property

      “enabled”                  gboolean

Whether torch is enabled.

Owner: PhoshTorchManager

Flags: Read

Default value: FALSE

### The `“icon-name”` property

      “icon-name”                char *

The torch icon name.

Owner: PhoshTorchManager

Flags: Read

Default value: "torch-disabled-symbolic"

### The `“present”` property

      “present”                  gboolean

Whether a torch led is present.

Owner: PhoshTorchManager

Flags: Read

Default value: FALSE