|
Packit |
79f644 |
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
Packit |
79f644 |
/*
|
|
Packit |
79f644 |
* Copyright © 2012 – 2017 Red Hat, Inc.
|
|
Packit |
79f644 |
*
|
|
Packit |
79f644 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
79f644 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
79f644 |
* License as published by the Free Software Foundation; either
|
|
Packit |
79f644 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
79f644 |
*
|
|
Packit |
79f644 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
79f644 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
79f644 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
79f644 |
* Lesser General Public License for more details.
|
|
Packit |
79f644 |
*
|
|
Packit |
79f644 |
* You should have received a copy of the GNU Lesser General
|
|
Packit |
79f644 |
* Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
79f644 |
*/
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
#if !defined (__GOA_BACKEND_INSIDE_GOA_BACKEND_H__) && !defined (GOA_BACKEND_COMPILATION)
|
|
Packit |
79f644 |
#error "Only <goabackend/goabackend.h> can be included directly."
|
|
Packit |
79f644 |
#endif
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
#ifndef __GOA_UTILS_H__
|
|
Packit |
79f644 |
#define __GOA_UTILS_H__
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
#include <gio/gio.h>
|
|
Packit |
79f644 |
#include <glib.h>
|
|
Packit |
79f644 |
#include <gtk/gtk.h>
|
|
Packit |
79f644 |
#include <libsoup/soup.h>
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
#include "goaprovider.h"
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
G_BEGIN_DECLS
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
#define GOA_OAUTH2_ACCESS_DENIED "access_denied"
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
#define GOA_SETTINGS_SCHEMA "org.gnome.online-accounts"
|
|
Packit |
79f644 |
#define GOA_SETTINGS_WHITELISTED_PROVIDERS "whitelisted-providers"
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
typedef gpointer (*GoaPeekInterfaceFunc) (GoaObject *);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_account_add_attention_needed (GoaClient *client,
|
|
Packit |
79f644 |
GoaObject *object,
|
|
Packit |
79f644 |
GoaProvider *provider,
|
|
Packit |
79f644 |
GtkBox *vbox);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_account_add_header (GoaObject *object, GtkGrid *grid, gint row);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_initialize_client_factory (void);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_check_duplicate (GoaClient *client,
|
|
Packit |
79f644 |
const gchar *identity,
|
|
Packit |
79f644 |
const gchar *presentation_identity,
|
|
Packit |
79f644 |
const gchar *provider_type,
|
|
Packit |
79f644 |
GoaPeekInterfaceFunc func,
|
|
Packit |
79f644 |
GError **error);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gchar *goa_utils_data_input_stream_read_line (GDataInputStream *stream,
|
|
Packit |
79f644 |
gsize *length,
|
|
Packit |
79f644 |
GCancellable *cancellable,
|
|
Packit |
79f644 |
GError **error);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_set_dialog_title (GoaProvider *provider, GtkDialog *dialog, gboolean add_account);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_delete_credentials_for_account_sync (GoaProvider *provider,
|
|
Packit |
79f644 |
GoaAccount *account,
|
|
Packit |
79f644 |
GCancellable *cancellable,
|
|
Packit |
79f644 |
GError **error);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_delete_credentials_for_id_sync (GoaProvider *provider,
|
|
Packit |
79f644 |
const gchar *id,
|
|
Packit |
79f644 |
GCancellable *cancellable,
|
|
Packit |
79f644 |
GError **error);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
GVariant *goa_utils_lookup_credentials_sync (GoaProvider *provider,
|
|
Packit |
79f644 |
GoaObject *object,
|
|
Packit |
79f644 |
GCancellable *cancellable,
|
|
Packit |
79f644 |
GError **error);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_store_credentials_for_id_sync (GoaProvider *provider,
|
|
Packit |
79f644 |
const gchar *id,
|
|
Packit |
79f644 |
GVariant *credentials,
|
|
Packit |
79f644 |
GCancellable *cancellable,
|
|
Packit |
79f644 |
GError **error);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_store_credentials_for_object_sync (GoaProvider *provider,
|
|
Packit |
79f644 |
GoaObject *object,
|
|
Packit |
79f644 |
GVariant *credentials,
|
|
Packit |
79f644 |
GCancellable *cancellable,
|
|
Packit |
79f644 |
GError **error);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_keyfile_copy_group (GKeyFile *src_key_file,
|
|
Packit |
79f644 |
const gchar *src_group_name,
|
|
Packit |
79f644 |
GKeyFile *dest_key_file,
|
|
Packit |
79f644 |
const gchar *dest_group_name);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_keyfile_get_boolean (GKeyFile *key_file, const gchar *group_name, const gchar *key);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_keyfile_remove_key (GoaAccount *account, const gchar *key);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_keyfile_set_boolean (GoaAccount *account, const gchar *key, gboolean value);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_keyfile_set_string (GoaAccount *account, const gchar *key, const gchar *value);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_parse_email_address (const gchar *email, gchar **out_username, gchar **out_domain);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_set_error_soup (GError **err, SoupMessage *msg);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
void goa_utils_set_error_ssl (GError **err, GTlsCertificateFlags flags);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
gboolean goa_utils_get_credentials (GoaProvider *provider,
|
|
Packit |
79f644 |
GoaObject *object,
|
|
Packit |
79f644 |
const gchar *id,
|
|
Packit |
79f644 |
gchar **username,
|
|
Packit |
79f644 |
gchar **password,
|
|
Packit |
79f644 |
GCancellable *cancellable,
|
|
Packit |
79f644 |
GError **error);
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
G_END_DECLS
|
|
Packit |
79f644 |
|
|
Packit |
79f644 |
#endif /* __GOA_UTILS_H__ */
|