## GcrViewerWidget

GcrViewerWidget — A widget which shows certificates or keys

## Synopsis

                        GcrViewerWidget;
    GcrViewerWidget *   gcr_viewer_widget_new               (void);
    void                gcr_viewer_widget_load_data         (GcrViewerWidget *self,
                                                             const gchar *display_name,
                                                             const guchar *data,
                                                             gsize n_data);
    void                gcr_viewer_widget_load_file         (GcrViewerWidget *self,
                                                             GFile *file);
    GcrParser *         gcr_viewer_widget_get_parser        (GcrViewerWidget *self);
    void                gcr_viewer_widget_show_error        (GcrViewerWidget *self,
                                                             const gchar *message,
                                                             GError *error);
    void                gcr_viewer_widget_clear_error       (GcrViewerWidget *self);
    const gchar *       gcr_viewer_widget_get_display_name  (GcrViewerWidget *self);
    void                gcr_viewer_widget_set_display_name  (GcrViewerWidget *self,
                                                             const gchar *display_name);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBox
                               +----GcrViewerWidget

## Implemented Interfaces

GcrViewerWidget implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Properties

      "display-name"             gchar*                : Read / Write
      "parser"                   GcrParser*            : Read

## Signals

      "added"                                          : Run Last

## Description

A viewer widget which can display certificates and keys that are located in files.

## Details

### GcrViewerWidget

    typedef struct _GcrViewerWidget GcrViewerWidget;

A viewer widget object.

### gcr_viewer_widget_new ()

    GcrViewerWidget *   gcr_viewer_widget_new               (void);

Create a new viewer widget.

Returns : | A new GcrViewerWidget object. [transfer full]

### gcr_viewer_widget_load_data ()

    void                gcr_viewer_widget_load_data         (GcrViewerWidget *self,
                                                             const gchar *display_name,
                                                             const guchar *data,
                                                             gsize n_data);

Parse and load some data to be displayed into the viewer widgets. The data may contain multiple parseable items if the format can contain multiple items.

`self` : | a viewer widget
`display_name` : | label for the loaded data. [allow-none]
`data` : | data to load. [array length=n_data]
`n_data` : | length of data to load

### gcr_viewer_widget_load_file ()

    void                gcr_viewer_widget_load_file         (GcrViewerWidget *self,
                                                             GFile *file);

Display contents of a file in the viewer widget. Multiple files can be loaded.

`self` : | a viewer widget
`file` : | a file to load

### gcr_viewer_widget_get_parser ()

    GcrParser *         gcr_viewer_widget_get_parser        (GcrViewerWidget *self);

Get the parser used to parse loaded data into viewable items.

`self` : | a viewer widget
Returns : | the parser. [transfer none]

### gcr_viewer_widget_show_error ()

    void                gcr_viewer_widget_show_error        (GcrViewerWidget *self,
                                                             const gchar *message,
                                                             GError *error);

Show an error on the viewer widget. This is displayed on a info bar near the edge of the widget.

`self` : | a viewer widget
`message` : | descriptive error message
`error` : | detailed error. [allow-none]

### gcr_viewer_widget_clear_error ()

    void                gcr_viewer_widget_clear_error       (GcrViewerWidget *self);

Clear the error displayed on the viewer widget.

`self` : | a viewer widget

### gcr_viewer_widget_get_display_name ()

    const gchar *       gcr_viewer_widget_get_display_name  (GcrViewerWidget *self);

Get the display name for data being displayed. This is automatically calculated from a loaded file, or can be explicitly set.

Used as a hint when displaying a title for the data, but may be overridden by the parsed data.

`self` : | a viewer widget
Returns : | the display name

### gcr_viewer_widget_set_display_name ()

    void                gcr_viewer_widget_set_display_name  (GcrViewerWidget *self,
                                                             const gchar *display_name);

Set the display name for data being displayed. Once explicitly set it will no longer be calculated automatically by loading data.

Used as a hint when displaying a title for the data, but may be overridden by the parsed data.

`self` : | a viewer widget
`display_name` : | the display name

## Property Details

### The `"display-name"` property

      "display-name"             gchar*                : Read / Write

Display name for data being displayed. This is automatically calculated from a loaded file, or can be explicitly set.

Used as a hint when displaying a title for the data, but may be overridden by the parsed data.

Default value: NULL

### The `"parser"` property

      "parser"                   GcrParser*            : Read

The parser used to parse loaded data into viewable items.

## Signal Details

### The `"added"` signal

    void                user_function                      (GcrViewerWidget *self,
                                                            GObject         *renderer,
                                                            GcrParsed       *parsed,
                                                            gpointer         user_data)      : Run Last

This signal is emitted when an item is added to the viewer widget.

`self` : | the viewer widget
`renderer` : | the renderer that was added. [type Gcr.Renderer]
`parsed` : | the parsed item that was added. [type Gcr.Parsed]
`user_data` : | user data set when the signal handler was connected.