More work:
[platform/upstream/evolution-data-server.git] / camel / camel-service.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-service.h : Abstract class for an email service */
3
4 /* 
5  *
6  * Author : 
7  *  Bertrand Guiheneuf <Bertrand.Guiheneuf@aful.org>
8  *
9  * Copyright 1999 International GNOME Support (http://www.gnome-support.com) .
10  *
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.
15  *
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.
20  *
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
24  * USA
25  */
26
27
28 #ifndef CAMEL_SERVICE_H
29 #define CAMEL_SERVICE_H 1
30
31
32 #ifdef __cplusplus
33 extern "C" {
34 #pragma }
35 #endif /* __cplusplus }*/
36
37 #include <gtk/gtk.h>
38
39 #define CAMEL_SERVICE_TYPE     (camel_service_get_type ())
40 #define CAMEL_SERVICE(obj)     (GTK_CHECK_CAST((obj), CAMEL_SERVICE_TYPE, CamelService))
41 #define CAMEL_SERVICE_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), CAMEL_SERVICE_TYPE, CamelServiceClass))
42 #define CAMEL_IS_SERVICE(o)    (GTK_CHECK_TYPE((o), CAMEL_SERVICE_TYPE))
43
44
45
46 typedef struct {
47         GtkObject parent_object;
48
49         gboolean connected;
50         gchar *url; /* This may be a full object ? */
51
52 } CamelService;
53
54
55
56 typedef struct {
57         GtkObjectClass parent_class;
58
59         void  (*connect) (CamelService *service);
60         void  (*connect_to_with_login_passwd) (CamelService *service, gchar *host, gchar *login, gchar *passwd);
61         void  (*connect_to_with_login_passwd_port) (CamelService *service, gchar *host, gchar *login, gchar *passwd, guint port);
62         gboolean  (*is_connected) (CamelService *service);
63         void  (*set_connected) (CamelService *service, gboolean state);
64         const gchar *  (*get_url) (CamelService *service);
65         
66 } CamelServiceClass;
67
68
69
70
71 /* public methods */
72 void camel_service_connect (CamelService *service);
73 gboolean camel_service_is_connected (CamelService *service);
74 void camel_service_connect_to_with_login_passwd (CamelService *service, gchar *host, gchar *login, gchar *passwd);
75 void camel_service_connect_to_with_login_passwd_port (CamelService *service, gchar *host, gchar *login, gchar *passwd, guint port);
76 const gchar *camel_service_get_url (CamelService *service);
77 /* Standard Gtk function */
78 GtkType camel_service_get_type (void);
79
80 #ifdef __cplusplus
81 }
82 #endif /* __cplusplus */
83
84 #endif /* CAMEL_SERVICE_H */
85