Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserverui / e-destination-store.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /* e-destination-store.h - EDestination store with GtkTreeModel interface.
4  *
5  * Copyright (C) 2004 Novell, Inc.
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
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * Authors: Hans Petter Jansson <hpj@novell.com>
21  */
22
23 #ifndef E_DESTINATION_STORE_H
24 #define E_DESTINATION_STORE_H
25
26 #include <gtk/gtktreemodel.h>
27 #include <libebook/e-destination.h>
28
29 G_BEGIN_DECLS
30
31 #define E_TYPE_DESTINATION_STORE            (e_destination_store_get_type ())
32 #define E_DESTINATION_STORE(obj)            (GTK_CHECK_CAST ((obj), E_TYPE_DESTINATION_STORE, EDestinationStore))
33 #define E_DESTINATION_STORE_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_DESTINATION_STORE, EDestinationStoreClass))
34 #define E_IS_DESTINATION_STORE(obj)         (GTK_CHECK_TYPE ((obj), E_TYPE_DESTINATION_STORE))
35 #define E_IS_DESTINATION_STORE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_DESTINATION_STORE))
36 #define E_DESTINATION_STORE_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), E_TYPE_DESTINATION_STORE, EDestinationStoreClass))
37
38 typedef struct _EDestinationStore       EDestinationStore;
39 typedef struct _EDestinationStoreClass  EDestinationStoreClass;
40
41 struct _EDestinationStore {
42         GObject     parent;
43
44         /* Private */
45
46         gint        stamp;
47         GPtrArray  *destinations;
48 };
49
50 struct _EDestinationStoreClass {
51         GObjectClass parent_class;
52 };
53
54 typedef enum
55 {
56         E_DESTINATION_STORE_COLUMN_NAME,
57         E_DESTINATION_STORE_COLUMN_EMAIL,
58         E_DESTINATION_STORE_COLUMN_ADDRESS,
59
60         E_DESTINATION_STORE_NUM_COLUMNS
61 }
62 EDestinationStoreColumnType;
63
64 GtkType            e_destination_store_get_type           (void);
65 EDestinationStore *e_destination_store_new                (void);
66
67 EDestination      *e_destination_store_get_destination    (EDestinationStore *destination_store,
68                                                            GtkTreeIter *iter);
69
70 /* Returns a shallow copy; free the list when done, but don't unref elements */
71 GList             *e_destination_store_list_destinations  (EDestinationStore *destination_store);
72
73 void               e_destination_store_insert_destination (EDestinationStore *destination_store,
74                                                            gint index, EDestination *destination);
75 void               e_destination_store_append_destination (EDestinationStore *destination_store,
76                                                            EDestination *destination);
77 void               e_destination_store_remove_destination (EDestinationStore *destination_store,
78                                                            EDestination *destination);
79 void               e_destination_store_remove_destination_nth (EDestinationStore *destination_store, 
80                                                                int n);
81 guint              e_destination_store_get_destination_count (EDestinationStore *destination_store);
82 GtkTreePath       *e_destination_store_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter);
83
84 G_END_DECLS
85
86 #endif  /* E_DESTINATION_STORE_H */