I#27 - [IMAPx] Ignore DavMail's CR/LF in BODYSTRUCTURE response
[evolution-data-server.git] / src / libedataserver / e-source-credentials-provider.h
blob390f1aafc96365e36115a17f35a8687777dbd9f9
1 /*
2 * Copyright (C) 2015 Red Hat, Inc. (www.redhat.com)
4 * This library is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library. If not, see <http://www.gnu.org/licenses/>.
18 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
19 #error "Only <libedataserver/libedataserver.h> should be included directly."
20 #endif
22 #ifndef E_SOURCE_CREDENTIALS_PROVIDER_H
23 #define E_SOURCE_CREDENTIALS_PROVIDER_H
25 #include <glib.h>
26 #include <glib-object.h>
27 #include <gio/gio.h>
29 #include <libedataserver/e-data-server-util.h>
30 #include <libedataserver/e-source.h>
31 #include <libedataserver/e-source-registry.h>
32 #include <libedataserver/e-source-credentials-provider-impl.h>
34 /* Standard GObject macros */
35 #define E_TYPE_SOURCE_CREDENTIALS_PROVIDER \
36 (e_source_credentials_provider_get_type ())
37 #define E_SOURCE_CREDENTIALS_PROVIDER(obj) \
38 (G_TYPE_CHECK_INSTANCE_CAST \
39 ((obj), E_TYPE_SOURCE_CREDENTIALS_PROVIDER, ESourceCredentialsProvider))
40 #define E_SOURCE_CREDENTIALS_PROVIDER_CLASS(cls) \
41 (G_TYPE_CHECK_CLASS_CAST \
42 ((cls), E_TYPE_SOURCE_CREDENTIALS_PROVIDER, ESourceCredentialsProviderClass))
43 #define E_IS_SOURCE_CREDENTIALS_PROVIDER(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE \
45 ((obj), E_TYPE_SOURCE_CREDENTIALS_PROVIDER))
46 #define E_IS_SOURCE_CREDENTIALS_PROVIDER_CLASS(cls) \
47 (G_TYPE_CHECK_CLASS_TYPE \
48 ((cls), E_TYPE_SOURCE_CREDENTIALS_PROVIDER))
49 #define E_SOURCE_CREDENTIALS_PROVIDER_GET_CLASS(obj) \
50 (G_TYPE_INSTANCE_GET_CLASS \
51 ((obj), E_TYPE_SOURCE_CREDENTIALS_PROVIDER, ESourceCredentialsProviderClass))
53 G_BEGIN_DECLS
55 typedef struct _ESourceCredentialsProvider ESourceCredentialsProvider;
56 typedef struct _ESourceCredentialsProviderClass ESourceCredentialsProviderClass;
57 typedef struct _ESourceCredentialsProviderPrivate ESourceCredentialsProviderPrivate;
59 /**
60 * ESourceCredentialsProvider:
62 * Contains only private data that should be read and manipulated using the
63 * functions below.
65 * Since: 3.16
66 **/
67 struct _ESourceCredentialsProvider {
68 /*< private >*/
69 GObject parent;
70 ESourceCredentialsProviderPrivate *priv;
73 struct _ESourceCredentialsProviderClass {
74 GObjectClass parent_class;
76 ESource * (*ref_source) (ESourceCredentialsProvider *provider,
77 const gchar *uid);
80 GType e_source_credentials_provider_get_type (void) G_GNUC_CONST;
81 ESourceCredentialsProvider *
82 e_source_credentials_provider_new (ESourceRegistry *registry);
83 GObject * e_source_credentials_provider_ref_registry
84 (ESourceCredentialsProvider *provider);
85 gboolean e_source_credentials_provider_register_impl
86 (ESourceCredentialsProvider *provider,
87 ESourceCredentialsProviderImpl *provider_impl);
88 void e_source_credentials_provider_unregister_impl
89 (ESourceCredentialsProvider *provider,
90 ESourceCredentialsProviderImpl *provider_impl);
91 ESource * e_source_credentials_provider_ref_source
92 (ESourceCredentialsProvider *provider,
93 const gchar *uid);
94 ESource * e_source_credentials_provider_ref_credentials_source
95 (ESourceCredentialsProvider *provider,
96 ESource *source);
97 gboolean e_source_credentials_provider_can_store (ESourceCredentialsProvider *provider,
98 ESource *source);
99 gboolean e_source_credentials_provider_can_prompt(ESourceCredentialsProvider *provider,
100 ESource *source);
101 gboolean e_source_credentials_provider_lookup_sync
102 (ESourceCredentialsProvider *provider,
103 ESource *source,
104 GCancellable *cancellable,
105 ENamedParameters **out_credentials,
106 GError **error);
107 void e_source_credentials_provider_lookup (ESourceCredentialsProvider *provider,
108 ESource *source,
109 GCancellable *cancellable,
110 GAsyncReadyCallback callback,
111 gpointer user_data);
112 gboolean e_source_credentials_provider_lookup_finish
113 (ESourceCredentialsProvider *provider,
114 GAsyncResult *result,
115 ENamedParameters **out_credentials,
116 GError **error);
117 gboolean e_source_credentials_provider_store_sync(ESourceCredentialsProvider *provider,
118 ESource *source,
119 const ENamedParameters *credentials,
120 gboolean permanently,
121 GCancellable *cancellable,
122 GError **error);
123 void e_source_credentials_provider_store (ESourceCredentialsProvider *provider,
124 ESource *source,
125 const ENamedParameters *credentials,
126 gboolean permanently,
127 GCancellable *cancellable,
128 GAsyncReadyCallback callback,
129 gpointer user_data);
130 gboolean e_source_credentials_provider_store_finish
131 (ESourceCredentialsProvider *provider,
132 GAsyncResult *result,
133 GError **error);
134 gboolean e_source_credentials_provider_delete_sync
135 (ESourceCredentialsProvider *provider,
136 ESource *source,
137 GCancellable *cancellable,
138 GError **error);
139 void e_source_credentials_provider_delete (ESourceCredentialsProvider *provider,
140 ESource *source,
141 GCancellable *cancellable,
142 GAsyncReadyCallback callback,
143 gpointer user_data);
144 gboolean e_source_credentials_provider_delete_finish
145 (ESourceCredentialsProvider *provider,
146 GAsyncResult *result,
147 GError **error);
149 G_END_DECLS
151 #endif /* E_SOURCE_CREDENTIALS_PROVIDER_H */