## GcrSystemPrompter GcrSystemPrompter — a prompter which displays system prompts |

## Synopsis

    struct              GcrSystemPrompter;
    struct              GcrSystemPrompterClass;
    enum                GcrSystemPrompterMode;
    GcrSystemPrompter * gcr_system_prompter_new             (GcrSystemPrompterMode mode,
                                                             GType prompt_type);
    void                gcr_system_prompter_register        (GcrSystemPrompter *self,
                                                             GDBusConnection *connection);
    void                gcr_system_prompter_unregister      (GcrSystemPrompter *self,
                                                             gboolean wait);
    GcrSystemPrompterMode gcr_system_prompter_get_mode      (GcrSystemPrompter *self);
    GType               gcr_system_prompter_get_prompt_type (GcrSystemPrompter *self);
    gboolean            gcr_system_prompter_get_prompting   (GcrSystemPrompter *self);

## Object Hierarchy

      GObject
       +----GcrSystemPrompter

## Properties

      "mode"                     GcrSystemPrompterMode  : Read / Write / Construct Only
      "prompt-type"              GType*                : Read / Write / Construct Only
      "prompting"                gboolean              : Read

## Signals

      "new-prompt"                                     : Run Last

## Description

This is a DBus service which is rarely implemented. Use GcrSystemPrompt to display system prompts.

The GcrSystemPrompter service responds to dbus requests to create system prompts and creates GcrPrompt type objects to display those prompts.

Pass the GType of the implementation of GcrPrompt to `gcr_system_prompter_new()`.

## Details

### struct GcrSystemPrompter

    struct GcrSystemPrompter;

A prompter used by implementations of system prompts.

### struct GcrSystemPrompterClass

    struct GcrSystemPrompterClass {
    	GObjectClass parent_class;

    	/* signals */

    	GcrPrompt *    (* new_prompt)     (GcrSystemPrompter *self);
    };

The class for GcrSystemPrompter.

GObjectClass `parent_class`; | parent class
`new_prompt` () | default handler for the "new-prompt" signal

### enum GcrSystemPrompterMode

    typedef enum {
    	GCR_SYSTEM_PROMPTER_SINGLE,
    	GCR_SYSTEM_PROMPTER_MULTIPLE
    } GcrSystemPrompterMode;

The mode for the system prompter. Most system prompters can only show one prompt at a time and would use the `GCR_SYSTEM_PROMPTER_SINGLE` mode.

`GCR_SYSTEM_PROMPTER_SINGLE` | only one prompt shown at a time
`GCR_SYSTEM_PROMPTER_MULTIPLE` | more than one prompt shown at a time

### gcr_system_prompter_new ()

    GcrSystemPrompter * gcr_system_prompter_new             (GcrSystemPrompterMode mode,
                                                             GType prompt_type);

Create a new system prompter service. This prompter won't do anything unless you connect to its signals and show appropriate prompts.

If `prompt_type` is zero, then the new-prompt signal must be handled and return a valid prompt object implementing the GcrPrompt interface.

If `prompt_type` is non-zero then the GType must implement the GcrPrompt interface.

`mode` : | the mode for the prompt
`prompt_type` : | the gobject type for prompts created by this prompter
Returns : | a new prompter service. [transfer full]

### gcr_system_prompter_register ()

    void                gcr_system_prompter_register        (GcrSystemPrompter *self,
                                                             GDBusConnection *connection);

Register this system prompter on the DBus `connection`.

This makes the prompter available for clients to call. The prompter will remain registered until `gcr_system_prompter_unregister()` is called, or the prompter is unreferenced.

`self` : | the system prompter
`connection` : | a DBus connection

### gcr_system_prompter_unregister ()

    void                gcr_system_prompter_unregister      (GcrSystemPrompter *self,
                                                             gboolean wait);

Unregister this system prompter on the DBus `connection`.

The prompter must have previously been registered with `gcr_system_prompter_register()`.

If `wait` is set then this function will wait until all prompts have been closed or cancelled. This is usually only used by tests.

`self` : | the system prompter
`wait` : | whether to wait for closing prompts

### gcr_system_prompter_get_mode ()

    GcrSystemPrompterMode gcr_system_prompter_get_mode      (GcrSystemPrompter *self);

Get the mode for this prompter.

Most system prompters only display one prompt at a time and therefore return `GCR_SYSTEM_PROMPTER_SINGLE`.

`self` : | the prompter
Returns : | the prompter mode

### gcr_system_prompter_get_prompt_type ()

    GType               gcr_system_prompter_get_prompt_type (GcrSystemPrompter *self);

Get the GType for prompts created by this prompter.

The returned GType will be a GcrPrompt implementation.

`self` : | the prompter
Returns : | the prompt GType

### gcr_system_prompter_get_prompting ()

    gboolean            gcr_system_prompter_get_prompting   (GcrSystemPrompter *self);

Get whether prompting or not.

`self` : | the prompter
Returns : | whether prompting or not

## Property Details

### The `"mode"` property

      "mode"                     GcrSystemPrompterMode  : Read / Write / Construct Only

The mode for this prompter.

Most system prompters only display one prompt at a time and therefore return `GCR_SYSTEM_PROMPTER_SINGLE`.

Default value: GCR_SYSTEM_PROMPTER_SINGLE

### The `"prompt-type"` property

      "prompt-type"              GType*                : Read / Write / Construct Only

The GType for prompts created by this prompter. This must be a GcrPrompt implementation.

Allowed values: GcrPrompt

### The `"prompting"` property

      "prompting"                gboolean              : Read

Whether the prompter is prompting or not.

Default value: FALSE

## Signal Details

### The `"new-prompt"` signal

    GcrPrompt*          user_function                      (GcrSystemPrompter *Returns,
                                                            gpointer           user_data)      : Run Last

Signal emitted to create a new prompt when needed.

The default implementation of this signal creates a prompt of the type `gcr_system_prompter_get_prompt_type()`.

`user_data` : | user data set when the signal handler was connected.
Returns : | the new prompt. [transfer full]