Blame gcr/gcr-prompt.h

Packit b00eeb
/*
Packit b00eeb
 * gnome-keyring
Packit b00eeb
 *
Packit b00eeb
 * Copyright (C) 2011 Stefan Walter
Packit b00eeb
 *
Packit b00eeb
 * This program is free software; you can redistribute it and/or modify
Packit b00eeb
 * it under the terms of the GNU Lesser General Public License as
Packit b00eeb
 * published by the Free Software Foundation; either version 2.1 of
Packit b00eeb
 * the License, or (at your option) any later version.
Packit b00eeb
 *
Packit b00eeb
 * This program is distributed in the hope that it will be useful, but
Packit b00eeb
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit b00eeb
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit b00eeb
 * Lesser General Public License for more details.
Packit b00eeb
 *
Packit b00eeb
 * You should have received a copy of the GNU Lesser General Public
Packit b00eeb
 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
Packit b00eeb
 *
Packit b00eeb
 * Author: Stef Walter <stef@thewalter.net>
Packit b00eeb
 */
Packit b00eeb
Packit b00eeb
#if !defined (__GCR_INSIDE_HEADER__) && !defined (GCR_COMPILATION)
Packit b00eeb
#error "Only <gcr/gcr.h> or <gcr/gcr-base.h> can be included directly."
Packit b00eeb
#endif
Packit b00eeb
Packit b00eeb
#ifndef __GCR_PROMPT_H__
Packit b00eeb
#define __GCR_PROMPT_H__
Packit b00eeb
Packit b00eeb
#include "gcr-types.h"
Packit b00eeb
Packit b00eeb
#include <glib-object.h>
Packit b00eeb
Packit b00eeb
G_BEGIN_DECLS
Packit b00eeb
Packit b00eeb
typedef enum {
Packit b00eeb
	GCR_PROMPT_REPLY_CANCEL = 0,
Packit b00eeb
	GCR_PROMPT_REPLY_CONTINUE = 1,
Packit b00eeb
} GcrPromptReply;
Packit b00eeb
Packit b00eeb
#define GCR_TYPE_PROMPT                 (gcr_prompt_get_type ())
Packit b00eeb
#define GCR_PROMPT(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_PROMPT, GcrPrompt))
Packit b00eeb
#define GCR_IS_PROMPT(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_PROMPT))
Packit b00eeb
#define GCR_PROMPT_GET_INTERFACE(inst)  (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GCR_TYPE_PROMPT, GcrPromptIface))
Packit b00eeb
Packit b00eeb
typedef struct _GcrPrompt GcrPrompt;
Packit b00eeb
typedef struct _GcrPromptIface GcrPromptIface;
Packit b00eeb
Packit b00eeb
struct _GcrPromptIface {
Packit b00eeb
	GTypeInterface parent_iface;
Packit b00eeb
Packit b00eeb
	void               (* prompt_password_async)    (GcrPrompt *prompt,
Packit b00eeb
	                                                 GCancellable *cancellable,
Packit b00eeb
	                                                 GAsyncReadyCallback callback,
Packit b00eeb
	                                                 gpointer user_data);
Packit b00eeb
Packit b00eeb
	const gchar *      (* prompt_password_finish)   (GcrPrompt *prompt,
Packit b00eeb
	                                                 GAsyncResult *result,
Packit b00eeb
	                                                 GError **error);
Packit b00eeb
Packit b00eeb
	void               (* prompt_confirm_async)     (GcrPrompt *prompt,
Packit b00eeb
	                                                 GCancellable *cancellable,
Packit b00eeb
	                                                 GAsyncReadyCallback callback,
Packit b00eeb
	                                                 gpointer user_data);
Packit b00eeb
Packit b00eeb
	GcrPromptReply     (* prompt_confirm_finish)    (GcrPrompt *prompt,
Packit b00eeb
	                                                 GAsyncResult *result,
Packit b00eeb
	                                                 GError **error);
Packit b00eeb
Packit b00eeb
	void               (* prompt_close)             (GcrPrompt *prompt);
Packit b00eeb
};
Packit b00eeb
Packit b00eeb
GType                gcr_prompt_get_type                  (void);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_reset                     (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
gchar *              gcr_prompt_get_title                 (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_title                 (GcrPrompt *prompt,
Packit b00eeb
                                                           const gchar *title);
Packit b00eeb
Packit b00eeb
gchar *              gcr_prompt_get_message               (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_message               (GcrPrompt *prompt,
Packit b00eeb
                                                           const gchar *message);
Packit b00eeb
Packit b00eeb
gchar *              gcr_prompt_get_description           (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_description           (GcrPrompt *prompt,
Packit b00eeb
                                                           const gchar *description);
Packit b00eeb
Packit b00eeb
gchar *              gcr_prompt_get_warning               (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_warning               (GcrPrompt *prompt,
Packit b00eeb
                                                           const gchar *warning);
Packit b00eeb
Packit b00eeb
gchar *              gcr_prompt_get_choice_label          (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_choice_label          (GcrPrompt *prompt,
Packit b00eeb
                                                           const gchar *choice_label);
Packit b00eeb
Packit b00eeb
gboolean             gcr_prompt_get_choice_chosen         (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_choice_chosen         (GcrPrompt *prompt,
Packit b00eeb
                                                           gboolean chosen);
Packit b00eeb
Packit b00eeb
gboolean             gcr_prompt_get_password_new          (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_password_new          (GcrPrompt *prompt,
Packit b00eeb
                                                           gboolean new_password);
Packit b00eeb
Packit b00eeb
gint                 gcr_prompt_get_password_strength     (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
gchar *              gcr_prompt_get_caller_window         (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_caller_window         (GcrPrompt *prompt,
Packit b00eeb
                                                           const gchar *window_id);
Packit b00eeb
Packit b00eeb
gchar *              gcr_prompt_get_continue_label        (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_continue_label        (GcrPrompt *prompt,
Packit b00eeb
                                                           const gchar *continue_label);
Packit b00eeb
Packit b00eeb
gchar *              gcr_prompt_get_cancel_label          (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_set_cancel_label          (GcrPrompt *prompt,
Packit b00eeb
                                                           const gchar *cancel_label);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_password_async            (GcrPrompt *prompt,
Packit b00eeb
                                                           GCancellable *cancellable,
Packit b00eeb
                                                           GAsyncReadyCallback callback,
Packit b00eeb
                                                           gpointer user_data);
Packit b00eeb
Packit b00eeb
const gchar *        gcr_prompt_password_finish           (GcrPrompt *prompt,
Packit b00eeb
                                                           GAsyncResult *result,
Packit b00eeb
                                                           GError **error);
Packit b00eeb
Packit b00eeb
const gchar *        gcr_prompt_password                  (GcrPrompt *prompt,
Packit b00eeb
                                                           GCancellable *cancellable,
Packit b00eeb
                                                           GError **error);
Packit b00eeb
Packit b00eeb
const gchar *        gcr_prompt_password_run              (GcrPrompt *prompt,
Packit b00eeb
                                                           GCancellable *cancellable,
Packit b00eeb
                                                           GError **error);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_confirm_async             (GcrPrompt *prompt,
Packit b00eeb
                                                           GCancellable *cancellable,
Packit b00eeb
                                                           GAsyncReadyCallback callback,
Packit b00eeb
                                                           gpointer user_data);
Packit b00eeb
Packit b00eeb
GcrPromptReply       gcr_prompt_confirm_finish            (GcrPrompt *prompt,
Packit b00eeb
                                                           GAsyncResult *result,
Packit b00eeb
                                                           GError **error);
Packit b00eeb
Packit b00eeb
GcrPromptReply       gcr_prompt_confirm                   (GcrPrompt *prompt,
Packit b00eeb
                                                           GCancellable *cancellable,
Packit b00eeb
                                                           GError **error);
Packit b00eeb
Packit b00eeb
GcrPromptReply       gcr_prompt_confirm_run               (GcrPrompt *prompt,
Packit b00eeb
                                                           GCancellable *cancellable,
Packit b00eeb
                                                           GError **error);
Packit b00eeb
Packit b00eeb
void                 gcr_prompt_close                     (GcrPrompt *prompt);
Packit b00eeb
Packit b00eeb
G_END_DECLS
Packit b00eeb
Packit b00eeb
#endif /* __GCR_PROMPT_H__ */