Port Camel to GObject.
[platform/upstream/evolution-data-server.git] / camel / camel-address.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
4  *
5  *  Authors: Michael Zucchi <notzed@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 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
23 #error "Only <camel/camel.h> can be included directly."
24 #endif
25
26 #ifndef CAMEL_ADDRESS_H
27 #define CAMEL_ADDRESS_H
28
29 #include <camel/camel-object.h>
30
31 /* Standard GObject macros */
32 #define CAMEL_TYPE_ADDRESS \
33         (camel_address_get_type ())
34 #define CAMEL_ADDRESS(obj) \
35         (G_TYPE_CHECK_INSTANCE_CAST \
36         ((obj), CAMEL_TYPE_ADDRESS, CamelAddress))
37 #define CAMEL_ADDRESS_CLASS(cls) \
38         (G_TYPE_CHECK_CLASS_CAST \
39         ((cls), CAMEL_TYPE_ADDRESS, CamelAddressClass))
40 #define CAMEL_IS_ADDRESS(obj) \
41         (G_TYPE_CHECK_INSTANCE_TYPE \
42         ((obj), CAMEL_TYPE_ADDRESS))
43 #define CAMEL_IS_ADDRESS_CLASS(cls) \
44         (G_TYPE_CHECK_CLASS_TYPE \
45         ((cls), CAMEL_TYPE_ADDRESS))
46 #define CAMEL_ADDRESS_GET_CLASS(obj) \
47         (G_TYPE_INSTANCE_GET_CLASS \
48         ((obj), CAMEL_TYPE_ADDRESS, CamelAddressClass))
49
50 G_BEGIN_DECLS
51
52 typedef struct _CamelAddress CamelAddress;
53 typedef struct _CamelAddressClass CamelAddressClass;
54 typedef struct _CamelAddressPrivate CamelAddressPrivate;
55
56 struct _CamelAddress {
57         CamelObject parent;
58
59         GPtrArray *addresses;
60
61         CamelAddressPrivate *priv;
62 };
63
64 struct _CamelAddressClass {
65         CamelObjectClass parent_class;
66
67         gint            (*decode)               (CamelAddress *addr,
68                                                  const gchar *raw);
69         gchar *         (*encode)               (CamelAddress *addr);
70         gint            (*unformat)             (CamelAddress *addr,
71                                                  const gchar *raw);
72         gchar *         (*format)               (CamelAddress *addr);
73         gint            (*cat)                  (CamelAddress *dest,
74                                                  CamelAddress *source);
75         void            (*remove)               (CamelAddress *addr,
76                                                  gint index);
77 };
78
79 GType           camel_address_get_type          (void);
80 CamelAddress *  camel_address_new               (void);
81 CamelAddress *  camel_address_new_clone         (CamelAddress *addr);
82 gint            camel_address_length            (CamelAddress *addr);
83 gint            camel_address_decode            (CamelAddress *addr,
84                                                  const gchar *raw);
85 gchar *         camel_address_encode            (CamelAddress *addr);
86 gint            camel_address_unformat          (CamelAddress *addr,
87                                                  const gchar *raw);
88 gchar *         camel_address_format            (CamelAddress *addr);
89 gint            camel_address_cat               (CamelAddress *dest,
90                                                  CamelAddress *source);
91 gint            camel_address_copy              (CamelAddress *dest,
92                                                  CamelAddress *source);
93 void            camel_address_remove            (CamelAddress *addr,
94                                                  gint index);
95
96 G_END_DECLS
97
98 #endif /* CAMEL_ADDRESS_H */