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 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 (__LIBEBACKEND_H_INSIDE__) && !defined (LIBEBACKEND_COMPILATION)
19 #error "Only <libebackend/libebackend.h> should be included directly."
25 #include <libedataserver/libedataserver.h>
27 /* Standard GObject macros */
28 #define E_TYPE_BACKEND \
29 (e_backend_get_type ())
30 #define E_BACKEND(obj) \
31 (G_TYPE_CHECK_INSTANCE_CAST \
32 ((obj), E_TYPE_BACKEND, EBackend))
33 #define E_BACKEND_CLASS(cls) \
34 (G_TYPE_CHECK_CLASS_CAST \
35 ((cls), E_TYPE_BACKEND, EBackendClass))
36 #define E_IS_BACKEND(obj) \
37 (G_TYPE_CHECK_INSTANCE_TYPE \
38 ((obj), E_TYPE_BACKEND))
39 #define E_IS_BACKEND_CLASS(cls) \
40 (G_TYPE_CHECK_CLASS_TYPE \
41 ((cls), E_TYPE_BACKEND))
42 #define E_BACKEND_GET_CLASS(obj) \
43 (G_TYPE_INSTANCE_GET_CLASS \
44 ((obj), E_TYPE_BACKEND, EBackendClass))
48 /* forward declaration */
49 struct _EUserPrompter;
51 typedef struct _EBackend EBackend;
52 typedef struct _EBackendClass EBackendClass;
53 typedef struct _EBackendPrivate EBackendPrivate;
58 * Contains only private data that should be read and manipulated using the
66 EBackendPrivate *priv;
71 * @authenticate_sync: Authenticate synchronously
72 * @authenticate: Initiate authentication
73 * @authenticate_finish: Complete authentication
74 * @get_destination_address: Fetch the destination address
76 * Base class structure for the #EBackend class
80 struct _EBackendClass {
82 GObjectClass parent_class;
86 gboolean (*authenticate_sync) (EBackend *backend,
87 ESourceAuthenticator *auth,
88 GCancellable *cancellable,
90 void (*authenticate) (EBackend *backend,
91 ESourceAuthenticator *auth,
92 GCancellable *cancellable,
93 GAsyncReadyCallback callback,
95 gboolean (*authenticate_finish) (EBackend *backend,
99 gboolean (*get_destination_address)
105 gpointer reserved[12];
108 GType e_backend_get_type (void) G_GNUC_CONST;
109 gboolean e_backend_get_online (EBackend *backend);
110 void e_backend_set_online (EBackend *backend,
112 ESource * e_backend_get_source (EBackend *backend);
114 e_backend_ref_connectable (EBackend *backend);
115 void e_backend_set_connectable (EBackend *backend,
116 GSocketConnectable *connectable);
117 GMainContext * e_backend_ref_main_context (EBackend *backend);
118 gboolean e_backend_authenticate_sync (EBackend *backend,
119 ESourceAuthenticator *auth,
120 GCancellable *cancellable,
122 void e_backend_authenticate (EBackend *backend,
123 ESourceAuthenticator *auth,
124 GCancellable *cancellable,
125 GAsyncReadyCallback callback,
127 gboolean e_backend_authenticate_finish (EBackend *backend,
128 GAsyncResult *result,
130 struct _EUserPrompter *
131 e_backend_get_user_prompter (EBackend *backend);
133 e_backend_trust_prompt_sync (EBackend *backend,
134 const ENamedParameters *parameters,
135 GCancellable *cancellable,
137 void e_backend_trust_prompt (EBackend *backend,
138 const ENamedParameters *parameters,
139 GCancellable *cancellable,
140 GAsyncReadyCallback callback,
143 e_backend_trust_prompt_finish (EBackend *backend,
144 GAsyncResult *result,
147 gboolean e_backend_get_destination_address
151 gboolean e_backend_is_destination_reachable
153 GCancellable *cancellable,
158 #endif /* E_BACKEND_H */