HAL
3
LIBTRACKER-COMMON Library

# HAL

## Synopsis

    #include <libtracker-common/tracker-hal.h>

                        TrackerHal;
    TrackerHal *        tracker_hal_new                     (void);
    gboolean            tracker_hal_get_battery_exists      (TrackerHal *hal);
    gboolean            tracker_hal_get_battery_in_use      (TrackerHal *hal);
    GList *             tracker_hal_get_mounted_directory_roots
                                                            (TrackerHal *hal);
    GList *             tracker_hal_get_removable_device_roots
                                                            (TrackerHal *hal);

## Object Hierarchy

      GObject
       +----TrackerHal

## Properties

      "battery-exists"           gboolean              : Read
      "battery-in-use"           gboolean              : Read
      "battery-percentage"       gdouble               : Read

## Signals

      "mount-point-added"                              : Run Last
      "mount-point-removed"                            : Run Last

## Description

## Details

### TrackerHal

    typedef struct _TrackerHal TrackerHal;

### tracker_hal_new ()

    TrackerHal *        tracker_hal_new                     (void);

Creates a new instance of TrackerHal.

Returns :

  The newly created TrackerHal.

### tracker_hal_get_battery_exists ()

    gboolean            tracker_hal_get_battery_exists      (TrackerHal *hal);

Returns whether the computer has batteries.

`hal` :

  A TrackerHal

Returns :

  TRUE if the computer has batteries available.

### tracker_hal_get_battery_in_use ()

    gboolean            tracker_hal_get_battery_in_use      (TrackerHal *hal);

Returns whether the computer battery (if any) is currently in use.

`hal` :

  A TrackerHal.

Returns :

  TRUE if the computer is running on battery power.

### tracker_hal_get_mounted_directory_roots ()

    GList *             tracker_hal_get_mounted_directory_roots
                                                            (TrackerHal *hal);

Returns a Glist of strings containing the root directories for mounted devices. Each element must be freed using `g_free()` and the list itself using `g_list_free()`.

`hal` :

  A TrackerHal

Returns :

  The list of root directories.

### tracker_hal_get_removable_device_roots ()

    GList *             tracker_hal_get_removable_device_roots
                                                            (TrackerHal *hal);

Returns a GList of strings containing the root directories for removable devices. Each element must be freed using `g_free()` and the list itself through `g_list_free()`.

`hal` :

  A TrackerHal

Returns :

  The list of root directories.

## Property Details

### The `"battery-exists"` property

      "battery-exists"           gboolean              : Read

There is a battery on this machine.

Default value: FALSE

### The `"battery-in-use"` property

      "battery-in-use"           gboolean              : Read

Whether the battery is being used.

Default value: FALSE

### The `"battery-percentage"` property

      "battery-percentage"       gdouble               : Read

Battery percentage.

Allowed values: [0,1]

Default value: 0

## Signal Details

### The `"mount-point-added"` signal

    void                user_function                      (TrackerHal *trackerhal,
                                                            gchar      *arg1,
                                                            gchar      *arg2,
                                                            gpointer    user_data)       : Run Last

`trackerhal` :

  the object which received the signal.

`arg1` :

`arg2` :

`user_data` :

  user data set when the signal handler was connected.

### The `"mount-point-removed"` signal

    void                user_function                      (TrackerHal *trackerhal,
                                                            gchar      *arg1,
                                                            gchar      *arg2,
                                                            gpointer    user_data)       : Run Last

`trackerhal` :

  the object which received the signal.

`arg1` :

`arg2` :

`user_data` :

  user data set when the signal handler was connected.