GcrSystemPrompter: Gcr Library Reference Manual

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

## Functions

GcrSystemPrompter * | gcr_system_prompter_new ()
void | gcr_system_prompter_register ()
void | gcr_system_prompter_unregister ()
GcrSystemPrompterMode | gcr_system_prompter_get_mode ()
GType | gcr_system_prompter_get_prompt_type ()
gboolean | gcr_system_prompter_get_prompting ()

## Properties

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

## Signals

GcrPrompt* | new-prompt | Run Last

## Types and Values

struct | GcrSystemPrompter
struct | GcrSystemPrompterClass
enum | GcrSystemPrompterMode

## Object Hierarchy

        GEnum
        ╰── GcrSystemPrompterMode
        GObject
        ╰── GcrSystemPrompter

## 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()`.

## Functions

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

#### Parameters

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.

#### Parameters

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.

#### Parameters

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

#### Parameters

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.

#### Parameters

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.

#### Parameters

self | the prompter |

#### Returns

whether prompting or not

## Types and Values

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

#### Members

`new_prompt` () | default handler for the “new-prompt” signal |

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

#### Members

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

## Property Details

### The `“mode”` property

      “mode”                     GcrSystemPrompterMode

The mode for this prompter.

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

Owner: GcrSystemPrompter

Flags: Read / Write / Construct Only

Default value: GCR_SYSTEM_PROMPTER_SINGLE

### The `“prompt-type”` property

      “prompt-type”              GType *

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

Owner: GcrSystemPrompter

Flags: Read / Write / Construct Only

Allowed values: GcrPrompt

### The `“prompting”` property

      “prompting”                gboolean

Whether the prompter is prompting or not.

Owner: GcrSystemPrompter

Flags: Read

Default value: FALSE

## Signal Details

### The `“new-prompt”` signal

    GcrPrompt*
    user_function (GcrSystemPrompter *Returns,
                   gpointer           user_data)

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()`.

#### Parameters

user_data | user data set when the signal handler was connected. |

#### Returns

the new prompt.

[transfer full]

Flags: Run Last