2 * camel-network-service.h
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
19 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
20 #error "Only <camel/camel.h> can be included directly."
23 #ifndef CAMEL_NETWORK_SERVICE_H
24 #define CAMEL_NETWORK_SERVICE_H
26 #include <camel/camel-enums.h>
27 #include <camel/camel-network-settings.h>
28 #include <camel/camel-stream.h>
30 /* Standard GObject macros */
31 #define CAMEL_TYPE_NETWORK_SERVICE \
32 (camel_network_service_get_type ())
33 #define CAMEL_NETWORK_SERVICE(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST \
35 ((obj), CAMEL_TYPE_NETWORK_SERVICE, CamelNetworkService))
36 #define CAMEL_NETWORK_SERVICE_INTERFACE(cls) \
37 (G_TYPE_CHECK_CLASS_CAST \
38 ((cls), CAMEL_TYPE_NETWORK_SERVICE, CamelNetworkServiceInterface))
39 #define CAMEL_IS_NETWORK_SERVICE(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE \
41 ((obj), CAMEL_TYPE_NETWORK_SERVICE))
42 #define CAMEL_IS_NETWORK_SERVICE_INTERFACE(cls) \
43 (G_TYPE_CHECK_CLASS_TYPE \
44 ((cls), CAMEL_TYPE_NETWORK_SERVICE))
45 #define CAMEL_NETWORK_SERVICE_GET_INTERFACE(obj) \
46 (G_TYPE_INSTANCE_GET_INTERFACE \
47 ((obj), CAMEL_TYPE_NETWORK_SERVICE, CamelNetworkServiceInterface))
52 * CamelNetworkService:
56 typedef struct _CamelNetworkService CamelNetworkService;
57 typedef struct _CamelNetworkServiceInterface CamelNetworkServiceInterface;
59 struct _CamelNetworkServiceInterface {
60 GTypeInterface parent_interface;
62 const gchar * (*get_service_name)
63 (CamelNetworkService *service,
64 CamelNetworkSecurityMethod method);
65 guint16 (*get_default_port)
66 (CamelNetworkService *service,
67 CamelNetworkSecurityMethod method);
69 CamelStream * (*connect_sync) (CamelNetworkService *service,
70 GCancellable *cancellable,
73 gpointer reserved[16];
76 GType camel_network_service_get_type (void) G_GNUC_CONST;
77 const gchar * camel_network_service_get_service_name
78 (CamelNetworkService *service,
79 CamelNetworkSecurityMethod method);
80 guint16 camel_network_service_get_default_port
81 (CamelNetworkService *service,
82 CamelNetworkSecurityMethod method);
83 CamelStream * camel_network_service_connect_sync
84 (CamelNetworkService *service,
85 GCancellable *cancellable,
90 #endif /* CAMEL_NETWORK_SERVICE_H */