1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-service.h : Abstract class for an email service */
7 * Bertrand Guiheneuf <bertrand@helixcode.com>
9 * Copyright 1999, 2000 Helix Code, Inc. (http://www.helixcode.com)
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28 #ifndef CAMEL_SERVICE_H
29 #define CAMEL_SERVICE_H 1
35 #endif /* __cplusplus }*/
38 #include "camel-types.h"
41 #define CAMEL_SERVICE_TYPE (camel_service_get_type ())
42 #define CAMEL_SERVICE(obj) (GTK_CHECK_CAST((obj), CAMEL_SERVICE_TYPE, CamelService))
43 #define CAMEL_SERVICE_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), CAMEL_SERVICE_TYPE, CamelServiceClass))
44 #define CAMEL_IS_SERVICE(o) (GTK_CHECK_TYPE((o), CAMEL_SERVICE_TYPE))
48 struct _CamelService {
49 GtkObject parent_object;
51 CamelSession *session;
61 GtkObjectClass parent_class;
63 gboolean (*connect) (CamelService *service, CamelException *ex);
64 gboolean (*connect_with_url) (CamelService *service, Gurl *url,
66 gboolean (*disconnect) (CamelService *service, CamelException *ex);
68 gboolean (*is_connected) (CamelService *service);
74 /* flags for url_flags. (others can be added if needed) */
75 #define CAMEL_SERVICE_URL_NEED_USER (1 << 1)
76 #define CAMEL_SERVICE_URL_NEED_HOST (1 << 4)
77 #define CAMEL_SERVICE_URL_NEED_PATH (1 << 6)
82 CamelService *camel_service_new (GtkType type, CamelSession *session,
83 Gurl *url, CamelException *ex);
85 gboolean camel_service_connect (CamelService *service, CamelException *ex);
86 gboolean camel_service_connect_with_url (CamelService *service, char *url,
88 gboolean camel_service_disconnect (CamelService *service, CamelException *ex);
89 gboolean camel_service_is_connected (CamelService *service);
90 char *camel_service_get_url (CamelService *service);
91 CamelSession *camel_service_get_session (CamelService *service);
93 /* Standard Gtk function */
94 GtkType camel_service_get_type (void);
98 #endif /* __cplusplus */
100 #endif /* CAMEL_SERVICE_H */