1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-transport.h : Abstract class for an email transport */
7 * Dan Winship <danw@ximian.com>
9 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
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.
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.
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
26 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
27 #error "Only <camel/camel.h> can be included directly."
30 #ifndef CAMEL_TRANSPORT_H
31 #define CAMEL_TRANSPORT_H
33 #include <camel/camel-address.h>
34 #include <camel/camel-mime-message.h>
35 #include <camel/camel-service.h>
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))
58 typedef struct _CamelTransport CamelTransport;
59 typedef struct _CamelTransportClass CamelTransportClass;
60 typedef struct _CamelTransportPrivate CamelTransportPrivate;
68 CAMEL_TRANSPORT_SEND_LOCK
71 struct _CamelTransport {
73 CamelTransportPrivate *priv;
76 struct _CamelTransportClass {
77 CamelServiceClass parent_class;
79 /* Synchronous I/O Methods */
80 gboolean (*send_to_sync) (CamelTransport *transport,
81 CamelMimeMessage *message,
83 CamelAddress *recipients,
84 GCancellable *cancellable,
87 /* Asynchronous I/O Methods (all have defaults) */
88 void (*send_to) (CamelTransport *transport,
89 CamelMimeMessage *message,
91 CamelAddress *recipients,
93 GCancellable *cancellable,
94 GAsyncReadyCallback callback,
96 gboolean (*send_to_finish) (CamelTransport *transport,
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);
107 gboolean camel_transport_send_to_sync (CamelTransport *transport,
108 CamelMimeMessage *message,
110 CamelAddress *recipients,
111 GCancellable *cancellable,
113 void camel_transport_send_to (CamelTransport *transport,
114 CamelMimeMessage *message,
116 CamelAddress *recipients,
118 GCancellable *cancellable,
119 GAsyncReadyCallback callback,
121 gboolean camel_transport_send_to_finish (CamelTransport *transport,
122 GAsyncResult *result,
127 #endif /* CAMEL_TRANSPORT_H */