Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / camel-sasl.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Authors: Jeffrey Stedfast <fejj@ximian.com>
4  *
5  *  Copyright 2001 Ximian, Inc. (www.ximian.com)
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of version 2 of the GNU Lesser General Public
9  * License as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22
23 #ifndef CAMEL_SASL_H
24 #define CAMEL_SASL_H
25
26 #include <glib.h>
27 #include <camel/camel-object.h>
28 #include <camel/camel-exception.h>
29 #include <camel/camel-service.h>
30
31 #define CAMEL_SASL_TYPE     (camel_sasl_get_type ())
32 #define CAMEL_SASL(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_SASL_TYPE, CamelSasl))
33 #define CAMEL_SASL_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_TYPE, CamelSaslClass))
34 #define CAMEL_IS_SASL(o)    (CAMEL_CHECK_TYPE((o), CAMEL_SASL_TYPE))
35
36 G_BEGIN_DECLS
37
38 typedef struct _CamelSasl {
39         CamelObject parent_object;
40         
41         char *service_name;
42         char *mech;             /* mechanism */
43         CamelService *service;
44         gboolean authenticated;
45 } CamelSasl;
46
47
48 typedef struct _CamelSaslClass {
49         CamelObjectClass parent_class;
50         
51         GByteArray *    (*challenge)   (CamelSasl *sasl, GByteArray *token, CamelException *ex);
52
53 } CamelSaslClass;
54
55
56 /* Standard Camel function */
57 CamelType  camel_sasl_get_type (void);
58
59 /* public methods */
60 GByteArray *camel_sasl_challenge        (CamelSasl *sasl, GByteArray *token, CamelException *ex);
61 char       *camel_sasl_challenge_base64 (CamelSasl *sasl, const char *token, CamelException *ex);
62
63 gboolean    camel_sasl_authenticated    (CamelSasl *sasl);
64
65 /* utility functions */
66 CamelSasl  *camel_sasl_new              (const char *service_name, const char *mechanism, CamelService *service);
67
68 GList                *camel_sasl_authtype_list (gboolean include_plain);
69 CamelServiceAuthType *camel_sasl_authtype      (const char *mechanism);
70
71 G_END_DECLS
72
73 #endif /* CAMEL_SASL_H */