### Interface

# Gcr Prompt

#### Description [src]

    interface Gcr.Prompt : GObject.Object

A prompt displayed to the user. It is an interface with various implementations.

Various properties are set on the prompt, and then the prompt is displayed the various prompt methods like `gcr_prompt_password_run()`.

A `GcrPrompt` may be used to display multiple related prompts. Most implementions do not hide the window between display of multiple related prompts, and the `GcrPrompt` must be closed or destroyed in order to make it go away. This allows the user to see that the prompts are related.

Use `GcrPromptDialog` (part of gcr-ui) to create an in-process GTK+ dialog prompt. Use `GcrSystemPrompt` to create a system prompt in a prompter process.

The prompt implementation will always display the `GcrPrompt:message` property, but may choose not to display the `GcrPrompt:description` or `GcrPrompt:title` properties.

#### Prerequisite

In order to implement Prompt, your type must inherit from`GObject`.

#### Implementations

- GcrSystemPrompt

#### Instance methods

###### gcr_prompt_close

Closes the prompt so that in can no longer be used to prompt. The various prompt methods will return results as if the user dismissed the prompt.

###### gcr_prompt_confirm

Prompts for confirmation asking a cancel/continue style question. Set the various properties on the prompt before calling this function to represent the question correctly.

###### gcr_prompt_confirm_async

Prompts for confirmation asking a cancel/continue style question. Set the various properties on the prompt before calling this method to represent the question correctly.

###### gcr_prompt_confirm_finish

Complete an operation to prompt for confirmation.

###### gcr_prompt_confirm_run

Prompts for confirmation asking a cancel/continue style question. Set the various properties on the prompt before calling this function to represent the question correctly.

###### gcr_prompt_get_caller_window

Get the string handle of the caller’s window.

###### gcr_prompt_get_cancel_label

Get the label for the cancel button.

###### gcr_prompt_get_choice_chosen

Get whether the additional choice was chosen or not.

###### gcr_prompt_get_choice_label

Get the label for the additional choice.

###### gcr_prompt_get_continue_label

Get the label for the continue button.

###### gcr_prompt_get_description

Get the detailed description of the prompt.

###### gcr_prompt_get_message

Gets the prompt message for the user.

###### gcr_prompt_get_password_new

Get whether the prompt will prompt for a new password.

###### gcr_prompt_get_password_strength

Get indication of the password strength.

###### gcr_prompt_get_title

Gets the title of the prompt.

###### gcr_prompt_get_warning

Get a prompt warning displayed on the prompt.

###### gcr_prompt_password

Prompts for password. Set the various properties on the prompt before calling this method to explain which password should be entered.

###### gcr_prompt_password_async

Prompts for password. Set the various properties on the prompt before calling this method to explain which password should be entered.

###### gcr_prompt_password_finish

Complete an operation to prompt for a password.

###### gcr_prompt_password_run

Prompts for password. Set the various properties on the prompt before calling this method to explain which password should be entered.

###### gcr_prompt_reset

Reset the contents and properties of the prompt.

###### gcr_prompt_set_caller_window

Set the string handle of the caller’s window.

###### gcr_prompt_set_cancel_label

Set the label for the continue button.

###### gcr_prompt_set_choice_chosen

Set whether the additional choice is chosen or not.

###### gcr_prompt_set_choice_label

Set the label for the additional choice.

###### gcr_prompt_set_continue_label

Set the label for the continue button.

###### gcr_prompt_set_description

Set the detailed description of the prompt.

###### gcr_prompt_set_message

Sets the prompt message for the user.

###### gcr_prompt_set_password_new

Set whether the prompt will prompt for a new password.

###### gcr_prompt_set_title

Sets the title of the prompt.

###### gcr_prompt_set_warning

Set a prompt warning displayed on the prompt.

#### Properties

###### Gcr.Prompt:caller-window

The string handle of the caller’s window.

###### Gcr.Prompt:cancel-label

The label for the cancel button in the prompt.

###### Gcr.Prompt:choice-chosen

Whether the additional choice is chosen or not.

###### Gcr.Prompt:choice-label

The label for the additional choice.

###### Gcr.Prompt:continue-label

The label for the continue button in the prompt.

###### Gcr.Prompt:description

The detailed description of the prompt.

###### Gcr.Prompt:message

The prompt message for the user.

###### Gcr.Prompt:password-new

Whether the prompt will prompt for a new password.

###### Gcr.Prompt:password-strength

Indication of the password strength.

###### Gcr.Prompt:title

The title of the prompt.

###### Gcr.Prompt:warning

A prompt warning displayed on the prompt, or `NULL` for no warning.

#### Signals

###### Gcr.Prompt::prompt-close

Action signal fired when the prompt is to be closed. After the default handler has run, the prompt is closed. The various prompting methods will return results as if the user dismissed the prompt.

#### Interface structure

    struct GcrPromptIface {
      GTypeInterface parent_iface;
      void (* prompt_password_async) (
        GcrPrompt* prompt,
        GCancellable* cancellable,
        GAsyncReadyCallback callback,
        gpointer user_data
      );
      const gchar* (* prompt_password_finish) (
        GcrPrompt* prompt,
        GAsyncResult* result,
        GError** error
      );
      void (* prompt_confirm_async) (
        GcrPrompt* prompt,
        GCancellable* cancellable,
        GAsyncReadyCallback callback,
        gpointer user_data
      );
      GcrPromptReply (* prompt_confirm_finish) (
        GcrPrompt* prompt,
        GAsyncResult* result,
        GError** error
      );
      void (* prompt_close) (
        GcrPrompt* prompt
      );

    }

The interface for implementing `GcrPrompt`.

###### Interface members

`parent_iface` |
    GTypeInterface
| Parent interface.
`prompt_password_async` |
    void (* prompt_password_async) (
        GcrPrompt* prompt,
        GCancellable* cancellable,
        GAsyncReadyCallback callback,
        gpointer user_data
      )
| No description available.
`prompt_password_finish` |
    const gchar* (* prompt_password_finish) (
        GcrPrompt* prompt,
        GAsyncResult* result,
        GError** error
      )
| No description available.
`prompt_confirm_async` |
    void (* prompt_confirm_async) (
        GcrPrompt* prompt,
        GCancellable* cancellable,
        GAsyncReadyCallback callback,
        gpointer user_data
      )
| No description available.
`prompt_confirm_finish` |
    GcrPromptReply (* prompt_confirm_finish) (
        GcrPrompt* prompt,
        GAsyncResult* result,
        GError** error
      )
| No description available.
`prompt_close` |
    void (* prompt_close) (
        GcrPrompt* prompt
      )
| No description available.

#### Virtual methods

###### Gcr.Prompt.prompt_close

No description available.

###### Gcr.Prompt.prompt_confirm_async

Prompts for confirmation asking a cancel/continue style question. Set the various properties on the prompt before calling this method to represent the question correctly.

###### Gcr.Prompt.prompt_confirm_finish

Complete an operation to prompt for confirmation.

###### Gcr.Prompt.prompt_password_async

Prompts for password. Set the various properties on the prompt before calling this method to explain which password should be entered.

###### Gcr.Prompt.prompt_password_finish

Complete an operation to prompt for a password.