1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /*
3  * Copyright © 2011 – 2017 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #if !defined (__GOA_BACKEND_INSIDE_GOA_BACKEND_H__) && !defined (GOA_BACKEND_COMPILATION)
20 #error "Only <goabackend/goabackend.h> can be included directly."
21 #endif
22 
23 #ifndef __GOA_PROVIDER_H__
24 #define __GOA_PROVIDER_H__
25 
26 #include <gtk/gtk.h>
27 #include <goa/goa.h>
28 #include <goabackend/goabackendenums.h>
29 
30 G_BEGIN_DECLS
31 
32 #define GOA_TYPE_PROVIDER         (goa_provider_get_type ())
33 G_DECLARE_DERIVABLE_TYPE (GoaProvider, goa_provider, GOA, PROVIDER, GObject);
34 
35 typedef struct _GoaProviderPrivate GoaProviderPrivate;
36 
37 const gchar           *goa_provider_get_provider_type            (GoaProvider            *self);
38 
39 gchar                 *goa_provider_get_provider_name            (GoaProvider            *self,
40                                                                   GoaObject              *object);
41 
42 GIcon                 *goa_provider_get_provider_icon            (GoaProvider            *self,
43                                                                   GoaObject              *object);
44 
45 G_DEPRECATED_FOR(goa_provider_get_provider_features)
46 GoaProviderGroup       goa_provider_get_provider_group           (GoaProvider            *self);
47 
48 GoaProviderFeatures    goa_provider_get_provider_features        (GoaProvider            *self);
49 
50 G_DEPRECATED
51 void                   goa_provider_set_preseed_data             (GoaProvider            *self,
52                                                                   GVariant               *preseed_data);
53 
54 G_DEPRECATED
55 GVariant              *goa_provider_get_preseed_data             (GoaProvider            *self);
56 
57 GoaObject             *goa_provider_add_account                  (GoaProvider            *self,
58                                                                   GoaClient              *client,
59                                                                   GtkDialog              *dialog,
60                                                                   GtkBox                 *vbox,
61                                                                   GError                **error);
62 
63 gboolean               goa_provider_refresh_account              (GoaProvider            *self,
64                                                                   GoaClient              *client,
65                                                                   GoaObject              *object,
66                                                                   GtkWindow              *parent,
67                                                                   GError                **error);
68 
69 void                   goa_provider_show_account                 (GoaProvider            *self,
70                                                                   GoaClient              *client,
71                                                                   GoaObject              *object,
72                                                                   GtkBox                 *vbox,
73                                                                   GtkGrid                *dummy1,
74                                                                   GtkGrid                *dummy2);
75 
76 guint                  goa_provider_get_credentials_generation   (GoaProvider            *self);
77 
78 void                   goa_provider_get_all                      (GAsyncReadyCallback     callback,
79                                                                   gpointer                user_data);
80 
81 gboolean               goa_provider_get_all_finish               (GList                 **out_providers,
82                                                                   GAsyncResult           *result,
83                                                                   GError                **error);
84 
85 GoaProvider           *goa_provider_get_for_provider_type        (const gchar            *provider_type);
86 
87 /* ---------------------------------------------------------------------------------------------------- */
88 
89 GtkWidget *goa_util_add_row_widget (GtkGrid      *grid,
90                                     gint          row,
91                                     const gchar  *label_text,
92                                     GtkWidget    *widget);
93 
94 gchar *
95 goa_util_lookup_keyfile_string (GoaObject    *object,
96                                 const gchar  *key);
97 
98 gboolean
99 goa_util_lookup_keyfile_boolean (GoaObject    *object,
100                                  const gchar  *key);
101 
102 void
103 goa_util_account_notify_property_cb (GObject *object, GParamSpec *pspec, gpointer user_data);
104 
105 GtkWidget *goa_util_add_row_switch_from_keyfile_with_blurb (GtkGrid      *grid,
106                                                             gint          row,
107                                                             GoaObject    *object,
108                                                             const gchar  *label_text,
109                                                             const gchar  *key,
110                                                             const gchar  *blurb);
111 
112 G_END_DECLS
113 
114 #endif /* __GOA_PROVIDER_H__ */
115