BluetoothChooser

## BluetoothChooser BluetoothChooser — a Bluetooth chooser widget |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    #include <bluetooth-chooser.h>

    struct              BluetoothChooser;
    struct              BluetoothChooserClass;
    void                bluetooth_chooser_dump_selected_device
                                                            (BluetoothChooser *self);
    GtkWidget *         bluetooth_chooser_get_scrolled_window
                                                            (BluetoothChooser *self);
    char *              bluetooth_chooser_get_selected_device
                                                            (BluetoothChooser *self);
    char *              bluetooth_chooser_get_selected_device_icon
                                                            (BluetoothChooser *self);
    gboolean            bluetooth_chooser_get_selected_device_info
                                                            (BluetoothChooser *self,
                                                             const char *field,
                                                             GValue *value);
    gboolean            bluetooth_chooser_get_selected_device_is_connected
                                                            (BluetoothChooser *self);
    char *              bluetooth_chooser_get_selected_device_name
                                                            (BluetoothChooser *self);
    BluetoothType       bluetooth_chooser_get_selected_device_type
                                                            (BluetoothChooser *self);
    GtkWidget *         bluetooth_chooser_new               (void);
    void                bluetooth_chooser_start_discovery   (BluetoothChooser *self);
    void                bluetooth_chooser_stop_discovery    (BluetoothChooser *self);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBox
                               +----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-device-type-column"  gboolean              : Read / Write / Construct
      "show-pairing"             gboolean              : Read / Write
      "show-searching"           gboolean              : Read / Write

## Signals

      "selected-device-activated"                      : Run Last
      "selected-device-changed"                        : Run Last

## Description

A tree-like widget used to select Bluetooth devices.

## Details

### struct BluetoothChooser

    struct BluetoothChooser;

### struct BluetoothChooserClass

    struct BluetoothChooserClass {
    	GtkBoxClass parent_class;

    	void (*selected_device_changed) (BluetoothChooser *chooser, const char *address);
    	void (*selected_device_activated) (BluetoothChooser *chooser, const char *address);
    };

### bluetooth_chooser_dump_selected_device ()

    void                bluetooth_chooser_dump_selected_device
                                                            (BluetoothChooser *self);

Prints all the known attributes for the currently selected device on the standard output. Useful for debugging.

`self` : | A BluetoothChooser widget.

### bluetooth_chooser_get_scrolled_window ()

    GtkWidget *         bluetooth_chooser_get_scrolled_window
                                                            (BluetoothChooser *self);

Returns the GtkScrolledWindow object for the BluetoothChooser. This is useful to set a minimum height to the chooser using `gtk_scrolled_window_set_min_content_height()` or to join the chooser with a toolbar.

`self` : | A BluetoothChooser widget.
Returns : | a GtkScrolledWindow object. [transfer none]

### 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_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_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_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_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_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_new ()

    GtkWidget *         bluetooth_chooser_new               (void);

Returns a new BluetoothChooser widget.

Returns : | A BluetoothChooser widget

### 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-device-type-column"` property

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

Whether to show the device type column.

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

## Signal Details

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

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

The "selected-device-activated" signal is launched when a device is double-clicked in the chooser.

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

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