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  * This library is free software: you can redistribute it and/or modify it
6  * under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
12  * for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library. If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Authors: Michael Zucchi <notzed@ximian.com>
18  */
19 
20 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
21 #error "Only <camel/camel.h> can be included directly."
22 #endif
23 
24 #ifndef CAMEL_ADDRESS_H
25 #define CAMEL_ADDRESS_H
26 
27 #include <glib-object.h>
28 
29 /* Standard GObject macros */
30 #define CAMEL_TYPE_ADDRESS \
31 	(camel_address_get_type ())
32 #define CAMEL_ADDRESS(obj) \
33 	(G_TYPE_CHECK_INSTANCE_CAST \
34 	((obj), CAMEL_TYPE_ADDRESS, CamelAddress))
35 #define CAMEL_ADDRESS_CLASS(cls) \
36 	(G_TYPE_CHECK_CLASS_CAST \
37 	((cls), CAMEL_TYPE_ADDRESS, CamelAddressClass))
38 #define CAMEL_IS_ADDRESS(obj) \
39 	(G_TYPE_CHECK_INSTANCE_TYPE \
40 	((obj), CAMEL_TYPE_ADDRESS))
41 #define CAMEL_IS_ADDRESS_CLASS(cls) \
42 	(G_TYPE_CHECK_CLASS_TYPE \
43 	((cls), CAMEL_TYPE_ADDRESS))
44 #define CAMEL_ADDRESS_GET_CLASS(obj) \
45 	(G_TYPE_INSTANCE_GET_CLASS \
46 	((obj), CAMEL_TYPE_ADDRESS, CamelAddressClass))
47 
48 G_BEGIN_DECLS
49 
50 typedef struct _CamelAddress CamelAddress;
51 typedef struct _CamelAddressClass CamelAddressClass;
52 typedef struct _CamelAddressPrivate CamelAddressPrivate;
53 
54 struct _CamelAddress {
55 	GObject parent;
56 
57 	CamelAddressPrivate *priv;
58 };
59 
60 struct _CamelAddressClass {
61 	GObjectClass parent_class;
62 
63 	gint		(*length)		(CamelAddress *addr);
64 	gint		(*decode)		(CamelAddress *addr,
65 						 const gchar *raw);
66 	gchar *		(*encode)		(CamelAddress *addr);
67 	gint		(*unformat)		(CamelAddress *addr,
68 						 const gchar *raw);
69 	gchar *		(*format)		(CamelAddress *addr);
70 	gint		(*cat)			(CamelAddress *dest,
71 						 CamelAddress *source);
72 	void		(*remove)		(CamelAddress *addr,
73 						 gint index);
74 
75 	/* Padding for future expansion */
76 	gpointer reserved[20];
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 */
99