Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-transport.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-transport.h : Abstract class for an email transport */
3
4 /*
5  *
6  * Author :
7  *  Dan Winship <danw@ximian.com>
8  *
9  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of version 2 of the GNU Lesser General Public
13  * License as published by the Free Software Foundation.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
23  * USA
24  */
25
26 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
27 #error "Only <camel/camel.h> can be included directly."
28 #endif
29
30 #ifndef CAMEL_TRANSPORT_H
31 #define CAMEL_TRANSPORT_H
32
33 #include <camel/camel-address.h>
34 #include <camel/camel-mime-message.h>
35 #include <camel/camel-service.h>
36
37 /* Standard GObject macros */
38 #define CAMEL_TYPE_TRANSPORT \
39         (camel_transport_get_type ())
40 #define CAMEL_TRANSPORT(obj) \
41         (G_TYPE_CHECK_INSTANCE_CAST \
42         ((obj), CAMEL_TYPE_TRANSPORT, CamelTransport))
43 #define CAMEL_TRANSPORT_CLASS(cls) \
44         (G_TYPE_CHECK_CLASS_CAST \
45         ((cls), CAMEL_TYPE_TRANSPORT, CamelTransportClass))
46 #define CAMEL_IS_TRANSPORT(obj) \
47         (G_TYPE_CHECK_INSTANCE_TYPE \
48         ((obj), CAMEL_TYPE_TRANSPORT))
49 #define CAMEL_IS_TRANSPORT_CLASS(cls) \
50         (G_TYPE_CHECK_CLASS_TYPE \
51         ((cls), CAMEL_TYPE_TRANSPORT))
52 #define CAMEL_TRANSPORT_GET_CLASS(obj) \
53         (G_TYPE_INSTANCE_GET_CLASS \
54         ((obj), CAMEL_TYPE_TRANSPORT, CamelTransportClass))
55
56 G_BEGIN_DECLS
57
58 typedef struct _CamelTransport CamelTransport;
59 typedef struct _CamelTransportClass CamelTransportClass;
60 typedef struct _CamelTransportPrivate CamelTransportPrivate;
61
62 /**
63  * CamelTransportLock:
64  *
65  * Since: 2.32
66  **/
67 typedef enum {
68         CAMEL_TRANSPORT_SEND_LOCK
69 } CamelTransportLock;
70
71 struct _CamelTransport {
72         CamelService parent;
73         CamelTransportPrivate *priv;
74 };
75
76 struct _CamelTransportClass {
77         CamelServiceClass parent_class;
78
79         /* Synchronous I/O Methods */
80         gboolean        (*send_to_sync)         (CamelTransport *transport,
81                                                  CamelMimeMessage *message,
82                                                  CamelAddress *from,
83                                                  CamelAddress *recipients,
84                                                  GCancellable *cancellable,
85                                                  GError **error);
86
87         /* Asynchronous I/O Methods (all have defaults) */
88         void            (*send_to)              (CamelTransport *transport,
89                                                  CamelMimeMessage *message,
90                                                  CamelAddress *from,
91                                                  CamelAddress *recipients,
92                                                  gint io_priority,
93                                                  GCancellable *cancellable,
94                                                  GAsyncReadyCallback callback,
95                                                  gpointer user_data);
96         gboolean        (*send_to_finish)       (CamelTransport *transport,
97                                                  GAsyncResult *result,
98                                                  GError **error);
99 };
100
101 GType           camel_transport_get_type        (void);
102 void            camel_transport_lock            (CamelTransport *transport,
103                                                  CamelTransportLock lock);
104 void            camel_transport_unlock          (CamelTransport *transport,
105                                                  CamelTransportLock lock);
106
107 gboolean        camel_transport_send_to_sync    (CamelTransport *transport,
108                                                  CamelMimeMessage *message,
109                                                  CamelAddress *from,
110                                                  CamelAddress *recipients,
111                                                  GCancellable *cancellable,
112                                                  GError **error);
113 void            camel_transport_send_to         (CamelTransport *transport,
114                                                  CamelMimeMessage *message,
115                                                  CamelAddress *from,
116                                                  CamelAddress *recipients,
117                                                  gint io_priority,
118                                                  GCancellable *cancellable,
119                                                  GAsyncReadyCallback callback,
120                                                  gpointer user_data);
121 gboolean        camel_transport_send_to_finish  (CamelTransport *transport,
122                                                  GAsyncResult *result,
123                                                  GError **error);
124
125 G_END_DECLS
126
127 #endif /* CAMEL_TRANSPORT_H */