Big header cleanups and nntp compile fix
[platform/upstream/evolution-data-server.git] / camel / camel-address.h
1 /*
2  *  Copyright (C) 2000 Helix Code Inc.
3  *
4  *  Authors: Michael Zucchi <notzed@helixcode.com>
5  *
6  *  This program is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU Library General Public License
8  *  as published by the Free Software Foundation; either version 2 of
9  *  the License, or (at your option) any later version.
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
14  *  GNU Library General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Library General Public
17  *  License along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #ifndef _CAMEL_ADDRESS_H
22 #define _CAMEL_ADDRESS_H
23
24 #include <glib.h>
25 #include <camel/camel-object.h>
26
27 #define CAMEL_ADDRESS(obj)         CAMEL_CHECK_CAST (obj, camel_address_get_type (), CamelAddress)
28 #define CAMEL_ADDRESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_address_get_type (), CamelAddressClass)
29 #define CAMEL_IS_ADDRESS(obj)      CAMEL_CHECK_TYPE (obj, camel_address_get_type ())
30
31 typedef struct _CamelAddressClass CamelAddressClass;
32
33 struct _CamelAddress {
34         CamelObject parent;
35
36         GPtrArray *addresses;
37
38         struct _CamelAddressPrivate *priv;
39 };
40
41 struct _CamelAddressClass {
42         CamelObjectClass parent_class;
43
44         int   (*decode)         (CamelAddress *, const char *raw);
45         char *(*encode)         (CamelAddress *);
46
47         int   (*unformat)       (CamelAddress *, const char *raw);
48         char *(*format)         (CamelAddress *);
49
50         int   (*cat)            (CamelAddress *, const CamelAddress *);
51
52         void  (*remove)         (CamelAddress *, int index);
53 };
54
55 guint           camel_address_get_type  (void);
56 CamelAddress   *camel_address_new       (void);
57 CamelAddress   *camel_address_new_clone (const CamelAddress *);
58 int             camel_address_length    (CamelAddress *);
59
60 int             camel_address_decode    (CamelAddress *, const char *);
61 char           *camel_address_encode    (CamelAddress *);
62 int             camel_address_unformat  (CamelAddress *, const char *);
63 char           *camel_address_format    (CamelAddress *);
64
65 int             camel_address_cat       (CamelAddress *, const CamelAddress *);
66 int             camel_address_copy      (CamelAddress *, const CamelAddress *);
67
68 void            camel_address_remove    (CamelAddress *, int index);
69
70 #endif /* ! _CAMEL_ADDRESS_H */