autoar-gtk-chooser

## autoar-gtk-chooser autoar-gtk-chooser — GTK+ widgets to choose archive format and filter |

## Functions

GtkWidget * | autoar_gtk_chooser_simple_new ()
gboolean | autoar_gtk_chooser_simple_get ()
GtkWidget * | autoar_gtk_chooser_advanced_new ()
gboolean | autoar_gtk_chooser_advanced_get ()

## Includes

    #include <gnome-autoar/autoar-gtk.h>

## Description

autoar-gtk-chooser contains two widgets for users to choose preferred archive format and filter.

## Functions

### autoar_gtk_chooser_simple_new ()

    GtkWidget *
    autoar_gtk_chooser_simple_new (AutoarFormat default_format,
                                   AutoarFilter default_filter);

Create a GtkComboBox with a list of common archive format. There is also an option called "Other format…", which will use `autoar_gtk_chooser_advanced_new()` and `autoar_gtk_chooser_advanced_get()` to select less common archive format. Arguments `default_format` and `default_filter` are the default archive format selected on the returned widget. You may want to get the preferred format of users using `autoar_pref_get_default_format()` and `autoar_pref_get_default_filter()`, or just set them to 1 to select the default archive format.

#### Parameters

default_format | an AutoarFormat |
default_filter | an AutoarFilter |

#### Returns

a new GtkComboBox widget.

[transfer full]

### autoar_gtk_chooser_simple_get ()

    gboolean
    autoar_gtk_chooser_simple_get (GtkWidget *simple,
                                   int *format,
                                   int *filter);

Gets the selected archive format of the widget created by `autoar_gtk_chooser_simple_new()`.

#### Parameters

simple | a GtkComboBox returned by `autoar_gtk_chooser_simple_new()` |
format | the place to store the AutoarFormat selected by the user |
filter | the place to store the AutoarFilter selected by the user |

#### Returns

`TRUE` if `format` and `filter` are set. `FALSE` if there is no selected item on `simple` , so `format` and `filter` are not modified.

### autoar_gtk_chooser_advanced_new ()

    GtkWidget *
    autoar_gtk_chooser_advanced_new (AutoarFormat default_format,
                                     AutoarFilter default_filter);

Create a GtkGrid with two lists. One list shows all available formats, and the other list shows all available filters.

#### Parameters

default_format | an AutoarFormat |
default_filter | an AutoarFilter |

#### Returns

a new GtkGrid widget.

[transfer full]

### autoar_gtk_chooser_advanced_get ()

    gboolean
    autoar_gtk_chooser_advanced_get (GtkWidget *advanced,
                                     int *format,
                                     int *filter);

Gets the selected archive format of the widget created by `autoar_gtk_chooser_advanced_new()`.

#### Parameters

advanced | a GtkGrid returned by `autoar_gtk_chooser_advanced_new()` |
format | the place to store the AutoarFormat selected by the user |
filter | the place to store the AutoarFilter selected by the user |

#### Returns

`TRUE` if `format` and `filter` are set. `FALSE` if there is no selected item on `advanced` , so `format` and `filter` are not modified.

## Types and Values