Top |
Functions
e_user_prompter_new ()
EUserPrompter *
e_user_prompter_new (void
);
Creates a new instance of EUserPrompter.
Since: 3.8
e_user_prompter_prompt ()
void e_user_prompter_prompt (EUserPrompter *prompter
,const gchar *type
,const gchar *title
,const gchar *primary_text
,const gchar *secondary_text
,gboolean use_markup
,GList *button_captions
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously prompt a user for a decision.
The type
can be one of "info", "warning", "question" or "error", to include
an icon in the message prompt; anything else results in no icon in the message.
If button_captions
is NULL
or empty list, then only one button is shown in
the prompt, a "Dismiss" button.
When the operation is finished, callback
will be called. You can then
call e_user_prompter_prompt_finish()
to get the result of the operation.
Parameters
prompter |
||
type |
type of the prompt; can be |
[allow-none] |
title |
window title of the prompt; can be |
[allow-none] |
primary_text |
primary text of the prompt; can be |
[allow-none] |
secondary_text |
secondary text of the prompt; can be |
[allow-none] |
use_markup |
whether both texts are with markup |
|
button_captions |
captions of buttons to use in the message; can be |
[allow-none] |
cancellable |
optional GCancellable object, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
data to pass to the callback function. |
[closure] |
Since: 3.8
e_user_prompter_prompt_finish ()
gint e_user_prompter_prompt_finish (EUserPrompter *prompter
,GAsyncResult *result
,GError **error
);
Finishes the operation started with e_user_prompter_prompt()
.
If an error occurred, the function sets error
and returns -1.
Returns
0-based index of a button being used by a user as a response,
corresponding to 'button_captions' from e_user_prompter_prompt()
call.
Since: 3.8
e_user_prompter_prompt_sync ()
gint e_user_prompter_prompt_sync (EUserPrompter *prompter
,const gchar *type
,const gchar *title
,const gchar *primary_text
,const gchar *secondary_text
,gboolean use_markup
,GList *button_captions
,GCancellable *cancellable
,GError **error
);
Prompts a user for a decision.
The type
can be one of "info", "warning", "question" or "error", to include
an icon in the message prompt; anything else results in no icon in the message.
If button_captions
is NULL
or empty list, then only one button is shown in
the prompt, a "Dismiss" button.
If an error occurred, the function sets error
and returns -1.
Parameters
prompter |
||
type |
type of the prompt; can be |
[allow-none] |
title |
window title of the prompt; can be |
[allow-none] |
primary_text |
primary text of the prompt; can be |
[allow-none] |
secondary_text |
secondary text of the prompt; can be |
[allow-none] |
use_markup |
whether both texts are with markup |
|
button_captions |
captions of buttons to use in the message; can be |
[allow-none] |
cancellable |
optional GCancellable object, or |
[allow-none] |
error |
Returns
0-based index of a button being used by a user as a response,
corresponding to button_captions
list.
Since: 3.8
e_user_prompter_extension_prompt ()
void e_user_prompter_extension_prompt (EUserPrompter *prompter
,const gchar *dialog_name
,const ENamedParameters *in_parameters
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously prompt a user for a decision on an extension-provided dialog.
The caller usually provides an extension for EUserPrompterServer, a descendant
of EUserPrompterServerExtension, which registers itself as a dialog provider.
The extension defines dialog_name
, same as meaning of in_parameters
;
only the extension and the caller know about meaning of these.
When the operation is finished, callback
will be called. You can then
call e_user_prompter_extension_prompt_finish()
to get the result of the operation.
If there is no extension providing given dialog name, the operation finishes with
a G_IO_ERROR, G_IO_ERROR_NOT_FOUND GError.
Parameters
prompter |
||
dialog_name |
name of a dialog to invoke |
|
in_parameters |
optional parameters to pass to extension; can be |
[allow-none] |
cancellable |
optional GCancellable object, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
data to pass to the callback function. |
[closure] |
Since: 3.8
e_user_prompter_extension_prompt_finish ()
gint e_user_prompter_extension_prompt_finish (EUserPrompter *prompter
,GAsyncResult *result
,ENamedParameters *out_values
,GError **error
);
Finishes the operation started with e_user_prompter_extension_prompt()
.
Caller can provide out_values
to get additional values provided by the extension.
In case the caller is not interested in additional values, it can pass NULL
out_values
.
The out_values
will be cleared first, then any values will be added there.
Only the caller and the extension know about meaning of the result code and
additional values.
If an error occurred, the function sets error
and returns -1. If there is
no extension providing given dialog name, the operation finishes with
a G_IO_ERROR, G_IO_ERROR_NOT_FOUND error
.
Parameters
prompter |
||
result |
||
out_values |
Where to store values from the extension, or |
[allow-none] |
error |
Since: 3.8
e_user_prompter_extension_prompt_sync ()
gint e_user_prompter_extension_prompt_sync (EUserPrompter *prompter
,const gchar *dialog_name
,const ENamedParameters *in_parameters
,ENamedParameters *out_values
,GCancellable *cancellable
,GError **error
);
Synchronously prompt a user for a decision on an extension-provided dialog.
The caller usually provides an extension for EUserPrompterServer, a descendant
of EUserPrompterServerExtension, which registers itself as a dialog provider.
The extension defines dialog_name
, same as meaning of in_parameters
;
only the extension and the caller know about meaning of these.
Caller can provide out_values
to get additional values provided by the extension.
In case the caller is not interested in additional values, it can pass NULL
out_values
.
The out_values
will be cleared first, then any values will be added there.
Only the caller and the extension know about meaning of the result code and
additional values.
If an error occurred, the function sets error
and returns -1. If there is
no extension providing given dialog name, the operation finishes with
a G_IO_ERROR, G_IO_ERROR_NOT_FOUND error
.
Parameters
prompter |
||
dialog_name |
name of a dialog to invoke |
|
in_parameters |
optional parameters to pass to extension; can be |
[allow-none] |
out_values |
Where to store values from the extension, or |
[allow-none] |
cancellable |
optional GCancellable object, or |
[allow-none] |
error |
Since: 3.8