Gcr.Prompt
Description: Reference for Gcr.Prompt

### Interface

# GcrPrompt

since: 4

#### 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.

Available since: 4

#### 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.

since: 4

###### 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.

since: 4

###### 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.

since: 4

###### gcr_prompt_confirm_finish

Complete an operation to prompt for confirmation.

since: 4

###### 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.

since: 4

###### gcr_prompt_get_caller_window

Get the string handle of the caller’s window.

since: 4

###### gcr_prompt_get_cancel_label

Get the label for the cancel button.

since: 4

###### gcr_prompt_get_choice_chosen

Get whether the additional choice was chosen or not.

since: 4

###### gcr_prompt_get_choice_label

Get the label for the additional choice.

since: 4

###### gcr_prompt_get_continue_label

Get the label for the continue button.

since: 4

###### gcr_prompt_get_description

Get the detailed description of the prompt.

since: 4

###### gcr_prompt_get_message

Gets the prompt message for the user.

since: 4

###### gcr_prompt_get_password_new

Get whether the prompt will prompt for a new password.

since: 4

###### gcr_prompt_get_password_strength

Get indication of the password strength.

since: 4

###### gcr_prompt_get_title

Gets the title of the prompt.

since: 4

###### gcr_prompt_get_warning

Get a prompt warning displayed on the prompt.

since: 4

###### gcr_prompt_password

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

since: 4

###### 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.

since: 4

###### gcr_prompt_password_finish

Complete an operation to prompt for a password.

since: 4

###### 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.

since: 4

###### gcr_prompt_reset

Reset the contents and properties of the prompt.

since: 4

###### gcr_prompt_set_caller_window

Set the string handle of the caller’s window.

since: 4

###### gcr_prompt_set_cancel_label

Set the label for the continue button.

since: 4

###### gcr_prompt_set_choice_chosen

Set whether the additional choice is chosen or not.

since: 4

###### gcr_prompt_set_choice_label

Set the label for the additional choice.

since: 4

###### gcr_prompt_set_continue_label

Set the label for the continue button.

since: 4

###### gcr_prompt_set_description

Set the detailed description of the prompt.

since: 4

###### gcr_prompt_set_message

Sets the prompt message for the user.

since: 4

###### gcr_prompt_set_password_new

Set whether the prompt will prompt for a new password.

since: 4

###### gcr_prompt_set_title

Sets the title of the prompt.

since: 4

###### gcr_prompt_set_warning

Set a prompt warning displayed on the prompt.

since: 4

#### Properties

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

The string handle of the caller’s window.

since: 4

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

The label for the cancel button in the prompt.

since: 4

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

Whether the additional choice is chosen or not.

since: 4

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

The label for the additional choice.

since: 4

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

The label for the continue button in the prompt.

since: 4

###### Gcr.Prompt:description

The detailed description of the prompt.

since: 4

###### Gcr.Prompt:message

The prompt message for the user.

since: 4

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

Whether the prompt will prompt for a new password.

since: 4

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

Indication of the password strength.

since: 4

###### Gcr.Prompt:title

The title of the prompt.

since: 4

###### Gcr.Prompt:warning

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

since: 4

#### 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.

since: 4

#### Interface structure

    struct GcrPromptInterface {
      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.

since: 4

###### 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.

since: 4

###### Gcr.Prompt.prompt_confirm_finish

Complete an operation to prompt for confirmation.

since: 4

###### 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.

since: 4

###### Gcr.Prompt.prompt_password_finish

Complete an operation to prompt for a password.

since: 4