1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* e-destination-store.h - EDestination store with GtkTreeModel interface.
5 * Copyright (C) 2004 Novell, Inc.
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.
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.
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.
20 * Authors: Hans Petter Jansson <hpj@novell.com>
23 #ifndef E_DESTINATION_STORE_H
24 #define E_DESTINATION_STORE_H
26 #include <gtk/gtktreemodel.h>
27 #include <libebook/e-destination.h>
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))
38 typedef struct _EDestinationStore EDestinationStore;
39 typedef struct _EDestinationStoreClass EDestinationStoreClass;
41 struct _EDestinationStore {
47 GPtrArray *destinations;
50 struct _EDestinationStoreClass {
51 GObjectClass parent_class;
56 E_DESTINATION_STORE_COLUMN_NAME,
57 E_DESTINATION_STORE_COLUMN_EMAIL,
58 E_DESTINATION_STORE_COLUMN_ADDRESS,
60 E_DESTINATION_STORE_NUM_COLUMNS
62 EDestinationStoreColumnType;
64 GtkType e_destination_store_get_type (void);
65 EDestinationStore *e_destination_store_new (void);
67 EDestination *e_destination_store_get_destination (EDestinationStore *destination_store,
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);
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,
81 guint e_destination_store_get_destination_count (EDestinationStore *destination_store);
82 GtkTreePath *e_destination_store_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter);
86 #endif /* E_DESTINATION_STORE_H */