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
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."
22 #ifndef E_SOURCE_CREDENTIALS_PROVIDER_H
23 #define E_SOURCE_CREDENTIALS_PROVIDER_H
26 #include <glib-object.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))
55 typedef struct _ESourceCredentialsProvider ESourceCredentialsProvider
;
56 typedef struct _ESourceCredentialsProviderClass ESourceCredentialsProviderClass
;
57 typedef struct _ESourceCredentialsProviderPrivate ESourceCredentialsProviderPrivate
;
60 * ESourceCredentialsProvider:
62 * Contains only private data that should be read and manipulated using the
67 struct _ESourceCredentialsProvider
{
70 ESourceCredentialsProviderPrivate
*priv
;
73 struct _ESourceCredentialsProviderClass
{
74 GObjectClass parent_class
;
76 ESource
* (*ref_source
) (ESourceCredentialsProvider
*provider
,
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
,
94 ESource
* e_source_credentials_provider_ref_credentials_source
95 (ESourceCredentialsProvider
*provider
,
97 gboolean
e_source_credentials_provider_can_store (ESourceCredentialsProvider
*provider
,
99 gboolean
e_source_credentials_provider_can_prompt(ESourceCredentialsProvider
*provider
,
101 gboolean e_source_credentials_provider_lookup_sync
102 (ESourceCredentialsProvider
*provider
,
104 GCancellable
*cancellable
,
105 ENamedParameters
**out_credentials
,
107 void e_source_credentials_provider_lookup (ESourceCredentialsProvider
*provider
,
109 GCancellable
*cancellable
,
110 GAsyncReadyCallback callback
,
112 gboolean e_source_credentials_provider_lookup_finish
113 (ESourceCredentialsProvider
*provider
,
114 GAsyncResult
*result
,
115 ENamedParameters
**out_credentials
,
117 gboolean
e_source_credentials_provider_store_sync(ESourceCredentialsProvider
*provider
,
119 const ENamedParameters
*credentials
,
120 gboolean permanently
,
121 GCancellable
*cancellable
,
123 void e_source_credentials_provider_store (ESourceCredentialsProvider
*provider
,
125 const ENamedParameters
*credentials
,
126 gboolean permanently
,
127 GCancellable
*cancellable
,
128 GAsyncReadyCallback callback
,
130 gboolean e_source_credentials_provider_store_finish
131 (ESourceCredentialsProvider
*provider
,
132 GAsyncResult
*result
,
134 gboolean e_source_credentials_provider_delete_sync
135 (ESourceCredentialsProvider
*provider
,
137 GCancellable
*cancellable
,
139 void e_source_credentials_provider_delete (ESourceCredentialsProvider
*provider
,
141 GCancellable
*cancellable
,
142 GAsyncReadyCallback callback
,
144 gboolean e_source_credentials_provider_delete_finish
145 (ESourceCredentialsProvider
*provider
,
146 GAsyncResult
*result
,
151 #endif /* E_SOURCE_CREDENTIALS_PROVIDER_H */