BluetoothChooser

## BluetoothChooser BluetoothChooser — a Bluetooth chooser widget |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    #include <bluetooth-plugin.h>

    #define             BLUETOOTH_GET_CHOOSER_CLASS         (obj)
                        BluetoothChooser;
    GtkWidget *         bluetooth_chooser_new               (const char *title);
    void                bluetooth_chooser_set_title         (BluetoothChooser *self,
                                                             const char *title);
    char *              bluetooth_chooser_get_selected_device
                                                            (BluetoothChooser *self);
    gboolean            bluetooth_chooser_get_selected_device_info
                                                            (BluetoothChooser *self,
                                                             const char *field,
                                                             GValue *value);
    char *              bluetooth_chooser_get_selected_device_name
                                                            (BluetoothChooser *self);
    char *              bluetooth_chooser_get_selected_device_icon
                                                            (BluetoothChooser *self);
    BluetoothType       bluetooth_chooser_get_selected_device_type
                                                            (BluetoothChooser *self);
    gboolean            bluetooth_chooser_get_selected_device_is_connected
                                                            (BluetoothChooser *self);
    void                bluetooth_chooser_start_discovery   (BluetoothChooser *self);
    void                bluetooth_chooser_stop_discovery    (BluetoothChooser *self);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkBox
                                     +----GtkVBox
                                           +----BluetoothChooser

## Implemented Interfaces

BluetoothChooser implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Properties

      "device-category-filter"   BluetoothCategory     : Read / Write / Construct
      "device-selected"          gchar*                : Read / Write
      "device-service-filter"    gchar*                : Write
      "device-type-filter"       gint                  : Read / Write / Construct
      "has-internal-device-filter" gboolean              : Read / Write / Construct Only
      "show-connected"           gboolean              : Read / Write
      "show-device-category"     gboolean              : Read / Write / Construct
      "show-device-type"         gboolean              : Read / Write / Construct
      "show-pairing"             gboolean              : Read / Write
      "show-searching"           gboolean              : Read / Write
      "title"                    gchar*                : Write

## Signals

      "selected-device-changed"                        : Run Last

## Description

A tree-like widget used to select Bluetooth devices.

## Details

### BLUETOOTH_GET_CHOOSER_CLASS()

    #define             BLUETOOTH_GET_CHOOSER_CLASS(obj)

`obj` : |

### BluetoothChooser

    typedef struct _BluetoothChooser BluetoothChooser;

### bluetooth_chooser_new ()

    GtkWidget *         bluetooth_chooser_new               (const char *title);

Returns a new BluetoothChooser widget.

`title` : | the widget header title, if `NULL`, the widget header will be hidden.
Returns : | A BluetoothChooser widget

### bluetooth_chooser_set_title ()

    void                bluetooth_chooser_set_title         (BluetoothChooser *self,
                                                             const char *title);

Sets the BluetoothChooser's title.

`self` : | a BluetoothChooser widget.
`title` : | the widget header title.

### bluetooth_chooser_get_selected_device ()

    char *              bluetooth_chooser_get_selected_device
                                                            (BluetoothChooser *self);

Returns the Bluetooth address for the currently selected device.

`self` : | a BluetoothChooser widget.
Returns : | the Bluetooth address for the currently selected device, or `NULL`.

### bluetooth_chooser_get_selected_device_info ()

    gboolean            bluetooth_chooser_get_selected_device_info
                                                            (BluetoothChooser *self,
                                                             const char *field,
                                                             GValue *value);

Returns whether the `value` has been set.

`self` : | A BluetoothChooser widget.
`field` : | The identifier for the field to get data for.
`value` : | An empty GValue to set.
Returns : | `TRUE` if the `value` has been set.

### bluetooth_chooser_get_selected_device_name ()

    char *              bluetooth_chooser_get_selected_device_name
                                                            (BluetoothChooser *self);

Returns the name for the currently selected device.

`self` : | a BluetoothChooser widget.
Returns : | the name for the currently selected device, or `NULL`.

### bluetooth_chooser_get_selected_device_icon ()

    char *              bluetooth_chooser_get_selected_device_icon
                                                            (BluetoothChooser *self);

Returns the icon name to use to represent the currently selected device.

`self` : | a BluetoothChooser widget.
Returns : | the icon name to use to represent the currently selected device, or `NULL`.

### bluetooth_chooser_get_selected_device_type ()

    BluetoothType       bluetooth_chooser_get_selected_device_type
                                                            (BluetoothChooser *self);

Returns the BluetoothType of the device selected.

`self` : | a BluetoothChooser widget.
Returns : | the BluetoothType of the device selected, or '0' if unknown.

### bluetooth_chooser_get_selected_device_is_connected ()

    gboolean            bluetooth_chooser_get_selected_device_is_connected
                                                            (BluetoothChooser *self);

Returns whether the selected device is connected to this computer.

`self` : | a BluetoothChooser widget.
Returns : | whether the selected device is connected to this computer, will always be `FALSE` if no devices are selected.

### bluetooth_chooser_start_discovery ()

    void                bluetooth_chooser_start_discovery   (BluetoothChooser *self);

Starts a discovery on the default Bluetooth adapter. Note that this will only work if the Search label is visible, as otherwise the user has no visual feedback that the process is on-going.

See also: "show-searching"

`self` : | a BluetoothChooser widget.

### bluetooth_chooser_stop_discovery ()

    void                bluetooth_chooser_stop_discovery    (BluetoothChooser *self);

Stops a discovery started with bluetooth_chooser_start_discovery.

`self` : | a BluetoothChooser widget.

## Property Details

### The `"device-category-filter"` property

      "device-category-filter"   BluetoothCategory     : Read / Write / Construct

The #BluetoothCategory to show.

Default value: BLUETOOTH_CATEGORY_ALL

### The `"device-selected"` property

      "device-selected"          gchar*                : Read / Write

the Bluetooth address for the currently selected device, or %NULL.

Default value: NULL

### The `"device-service-filter"` property

      "device-service-filter"    gchar*                : Write

A string representing the service to filter for.

Default value: NULL

### The `"device-type-filter"` property

      "device-type-filter"       gint                  : Read / Write / Construct

A bitmask of #BluetoothType to show.

Allowed values: [1,32767]

Default value: 1

### The `"has-internal-device-filter"` property

      "has-internal-device-filter" gboolean              : Read / Write / Construct Only

Whether the #BluetoothChooser should be constructed with a visible #BluetoothFilterWidget.

Default value: TRUE

### The `"show-connected"` property

      "show-connected"           gboolean              : Read / Write

Whether to show the connected column in the tree.

Default value: FALSE

### The `"show-device-category"` property

      "show-device-category"     gboolean              : Read / Write / Construct

Whether to show the device category filter.

Default value: TRUE

### The `"show-device-type"` property

      "show-device-type"         gboolean              : Read / Write / Construct

Whether to show the device type filter.

Default value: TRUE

### The `"show-pairing"` property

      "show-pairing"             gboolean              : Read / Write

Whether to show the pairing column in the tree.

Default value: FALSE

### The `"show-searching"` property

      "show-searching"           gboolean              : Read / Write

Whether to show the Searching label , this is necessary if you want to programmatically start a discovery, using bluetooth_chooser_start_discovery().

Default value: FALSE

### The `"title"` property

      "title"                    gchar*                : Write

The widget header title.

Default value: NULL

## Signal Details

### The `"selected-device-changed"` signal

    void                user_function                      (BluetoothChooser *chooser,
                                                            gchar            *address,
                                                            gpointer          user_data)      : Run Last

The "selected-device-changed" signal is launched when the selected device is changed, it will be `NULL` if a device was unselected.

`chooser` : | a BluetoothChooser widget which received the signal
`address` : | the Bluetooth address for the currently selected device, or `NULL`
`user_data` : | user data set when the signal handler was connected.