## EphyDialog

EphyDialog — A customized GtkDialog for Epiphany

## Synopsis

                        EphyDialog;
                        EphyDialogProperty;
    enum                EphyDialogApplyType;
    EphyDialog *        ephy_dialog_new                     (void);
    EphyDialog *        ephy_dialog_new_with_parent         (GtkWidget *parent_window);
    void                ephy_dialog_construct               (EphyDialog *dialog,
                                                             const EphyDialogProperty *properties,
                                                             const char *file,
                                                             const char *name,
                                                             const char *domain);
    void                ephy_dialog_add_enum                (EphyDialog *dialog,
                                                             const char *property_id,
                                                             guint n_items,
                                                             const char * const *items);
    void                ephy_dialog_set_data_column         (EphyDialog *dialog,
                                                             const char *property_id,
                                                             int column);
    void                ephy_dialog_set_size_group          (EphyDialog *dialog,
                                                             const char *first_id,
                                                             ...);
    int                 ephy_dialog_run                     (EphyDialog *dialog);
    void                ephy_dialog_show                    (EphyDialog *dialog);
    void                ephy_dialog_hide                    (EphyDialog *dialog);
    void                ephy_dialog_set_parent              (EphyDialog *dialog,
                                                             GtkWidget *parent);
    GtkWidget *         ephy_dialog_get_parent              (EphyDialog *dialog);
    void                ephy_dialog_set_modal               (EphyDialog *dialog,
                                                             gboolean is_modal);
    GtkWidget *         ephy_dialog_get_control             (EphyDialog *dialog,
                                                             const char *property_id);
    void                ephy_dialog_get_controls            (EphyDialog *dialog,
                                                             const char *first_id,
                                                             ...);
    gboolean            ephy_dialog_get_value               (EphyDialog *dialog,
                                                             const char *property_id,
                                                             GValue *value);
    void                ephy_dialog_set_value               (EphyDialog *dialog,
                                                             const char *property_id,
                                                             const GValue *value);
    void                ephy_dialog_set_pref                (EphyDialog *dialog,
                                                             const char *property_id,
                                                             const char *pref);

## Object Hierarchy

      GObject
       +----EphyDialog

## Properties

      "default-height"           gint                  : Read / Write / Construct Only
      "default-width"            gint                  : Read / Write / Construct Only
      "modal"                    gboolean              : Read / Write
      "parent-window"            GtkWindow*            : Read / Write
      "persist-position"         gboolean              : Read / Write / Construct Only

## Signals

      "changed"                                        : Run First / Has Details

## Description

A customized GtkDialog for Epiphany.

## Details

### EphyDialog

    typedef struct _EphyDialog EphyDialog;

### EphyDialogProperty

    typedef struct {
    	const char *id;
    	const char *pref;
    	EphyDialogApplyType apply_type;
    	GType data_type;
    } EphyDialogProperty;

### enum EphyDialogApplyType

    typedef enum
    {
    	PT_NORMAL = 0,
    	PT_AUTOAPPLY = 1 << 0,
    	PT_INVERTED = 1 << 1
    } EphyDialogApplyType;

### ephy_dialog_new ()

    EphyDialog *        ephy_dialog_new                     (void);

Creates a new EphyDialog.

Returns : | a new EphyDialog

### ephy_dialog_new_with_parent ()

    EphyDialog *        ephy_dialog_new_with_parent         (GtkWidget *parent_window);

Creates a new EphyDialog with `parent_window` as its parent.

`parent_window` : | a window to be parent of the new dialog
Returns : | a new EphyDialog

### ephy_dialog_construct ()

    void                ephy_dialog_construct               (EphyDialog *dialog,
                                                             const EphyDialogProperty *properties,
                                                             const char *file,
                                                             const char *name,
                                                             const char *domain);

Constructs the widget part of `dialog` using the widget identified by `name` in the GtkBuilder file found at `file`. Fills the dialog properties with `properties` and sets translation domain to `domain`.

`dialog` : | an EphyDialog
`properties` : | an array of EphyDialogProperty elements
`file` : | the path to a GtkBuilder file
`name` : | name of the widget to use for `dialog`, found in `file`
`domain` : | translation domain to set for `dialog`

### ephy_dialog_add_enum ()

    void                ephy_dialog_add_enum                (EphyDialog *dialog,
                                                             const char *property_id,
                                                             guint n_items,
                                                             const char * const *items);

Modifies the property identified by `property_id` in `dialog` to have its string_enum member set to a GList constructed with the elements given as `items`.

`dialog` : | an EphyDialog
`property_id` : | string identifier of the property to modify
`n_items` : | length of `items` array
`items` : | array of items to add to `property_id`

### ephy_dialog_set_data_column ()

    void                ephy_dialog_set_data_column         (EphyDialog *dialog,
                                                             const char *property_id,
                                                             int column);

Sets the data_col member of the property identified by `property_id` in `dialog` to `column`.

`dialog` : | an EphyDialog
`property_id` : | string identifier of the property to modify
`column` : | value for the data_col member of `property_id`

### ephy_dialog_set_size_group ()

    void                ephy_dialog_set_size_group          (EphyDialog *dialog,
                                                             const char *first_id,
                                                             ...);

Put `first_id` and `Varargs` widgets into the same GtkSizeGroup. Note that this are all widgets inside `dialog`.

`dialog` : | an EphyDialog
`first_id` : | id of a widget in `dialog`
`...` : | a `NULL`-terminated list of widget ids

### ephy_dialog_run ()

    int                 ephy_dialog_run                     (EphyDialog *dialog);

Runs gtk_dialog_run on `dialog` and waits for a response.

`dialog` : | an EphyDialog
Returns : | the user response to gtk_dialog_run or 0 if `dialog` is not valid

### ephy_dialog_show ()

    void                ephy_dialog_show                    (EphyDialog *dialog);

Shows `dialog` on screen.

`dialog` : | an EphyDialog

### ephy_dialog_hide ()

    void                ephy_dialog_hide                    (EphyDialog *dialog);

Calls gtk_widget_hide on `dialog`.

`dialog` : | an EphyDialog

### ephy_dialog_set_parent ()

    void                ephy_dialog_set_parent              (EphyDialog *dialog,
                                                             GtkWidget *parent);

Sets `parent` as the parent-window of `dialog`.

`dialog` : | an EphyDialog
`parent` : | new parent for `dialog`

### ephy_dialog_get_parent ()

    GtkWidget *         ephy_dialog_get_parent              (EphyDialog *dialog);

Gets `dialog`'s parent-window.

`dialog` : | an EphyDialog
Returns : | the parent-window of `dialog`. [transfer none]

### ephy_dialog_set_modal ()

    void                ephy_dialog_set_modal               (EphyDialog *dialog,
                                                             gboolean is_modal);

Sets `dialog` to be modal or not.

`dialog` : | an EphyDialog
`is_modal` : | `TRUE` to make `dialog` modal

### ephy_dialog_get_control ()

    GtkWidget *         ephy_dialog_get_control             (EphyDialog *dialog,
                                                             const char *property_id);

Gets the internal widget corresponding to `property_id` from `dialog`.

`dialog` : | an EphyDialog
`property_id` : | the string identifier of the requested control
Returns : | the GtkWidget corresponding to `property_id` or `NULL`. [transfer none]

### ephy_dialog_get_controls ()

    void                ephy_dialog_get_controls            (EphyDialog *dialog,
                                                             const char *first_id,
                                                             ...);

Gets the requested controls according to given property-store_location pairs. Properties are given as strings (const char *), controls are returned as GtkWidget elements. Rename to: ephy_dialog_get_controls

`dialog` : | an EphyDialog
`first_id` : | identifier of the requested control
`...` : | a `NULL` terminated list of extra pairs of properties as const char and store locations as GtkWidgets.

### ephy_dialog_get_value ()

    gboolean            ephy_dialog_get_value               (EphyDialog *dialog,
                                                             const char *property_id,
                                                             GValue *value);

Gets the value of `property_id` and stores it in `value`.

`dialog` : | an EphyDialog
`property_id` : | property name
`value` : | location to store the value of `property_id`. [out]
Returns : | `TRUE` if the operation was successful

### ephy_dialog_set_value ()

    void                ephy_dialog_set_value               (EphyDialog *dialog,
                                                             const char *property_id,
                                                             const GValue *value);

Sets the property identified by `property_id` to `value` in `dialog`.

`dialog` : | an EphyDialog
`property_id` : | `dialog` property to set
`value` : | value to set `property_id` to

### ephy_dialog_set_pref ()

    void                ephy_dialog_set_pref                (EphyDialog *dialog,
                                                             const char *property_id,
                                                             const char *pref);

Sets the pref member of the property of `dialog` identified by `property_id` to `pref`.

`dialog` : | an EphyDialog
`property_id` : | string identifier of the property to modify
`pref` : | preference value of the property identified by `property_id`

## Property Details

### The `"default-height"` property

      "default-height"           gint                  : Read / Write / Construct Only

The dialog default height.

Allowed values: >= G_MAXULONG

Default value: -1

### The `"default-width"` property

      "default-width"            gint                  : Read / Write / Construct Only

The dialog default width.

Allowed values: >= G_MAXULONG

Default value: -1

### The `"modal"` property

      "modal"                    gboolean              : Read / Write

Whether the dialog is or not modal.

Default value: FALSE

### The `"parent-window"` property

      "parent-window"            GtkWindow*            : Read / Write

Dialog's parent window.

### The `"persist-position"` property

      "persist-position"         gboolean              : Read / Write / Construct Only

If dialog position should be persistent.

Default value: FALSE

## Signal Details

### The `"changed"` signal

    void                user_function                      (EphyDialog *dialog,
                                                            gpointer    value,
                                                            gpointer    user_data)      : Run First / Has Details

Emitted everytime a child widget of the dialog has its changed or clicked signal emitted.

`dialog` : | the object on which the signal is emitted
`value` : | new value of the modified widget, as a GValue
`user_data` : | user data set when the signal handler was connected.