Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserverui / e-source-selector.h
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /* e-source-selector.h
3  *
4  * Copyright (C) 2003  Ximian, Inc.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * 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 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  * Author: Ettore Perazzoli <ettore@ximian.com>
22  */
23
24 #ifndef _E_SOURCE_SELECTOR_H_
25 #define _E_SOURCE_SELECTOR_H_
26
27 #include <gtk/gtkmenu.h>
28 #include <gtk/gtktreeview.h>
29 #include "libedataserver/e-source-list.h"
30
31 G_BEGIN_DECLS
32
33 #define E_TYPE_SOURCE_SELECTOR          (e_source_selector_get_type ())
34 #define E_SOURCE_SELECTOR(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SOURCE_SELECTOR, ESourceSelector))
35 #define E_SOURCE_SELECTOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SOURCE_SELECTOR, ESourceSelectorClass))
36 #define E_IS_SOURCE_SELECTOR(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SOURCE_SELECTOR))
37 #define E_IS_SOURCE_SELECTOR_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SOURCE_SELECTOR))
38
39
40 typedef struct _ESourceSelector        ESourceSelector;
41 typedef struct _ESourceSelectorPrivate ESourceSelectorPrivate;
42 typedef struct _ESourceSelectorClass   ESourceSelectorClass;
43
44 struct _ESourceSelector {
45         GtkTreeView parent;
46
47         ESourceSelectorPrivate *priv;
48 };
49
50 struct _ESourceSelectorClass {
51         GtkTreeViewClass parent_class;
52
53         void (* selection_changed) (ESourceSelector *selector);
54         void (* primary_selection_changed) (ESourceSelector *selector);
55         gboolean (*popup_event)(ESourceSelector *selector, ESource *primary, GdkEventButton *event);
56 };
57
58
59 GType  e_source_selector_get_type  (void);
60
61 GtkWidget *e_source_selector_new  (ESourceList *list);
62
63 void      e_source_selector_select_source       (ESourceSelector *selector,
64                                                  ESource         *source);
65 void      e_source_selector_unselect_source     (ESourceSelector *selector,
66                                                  ESource         *source);
67 gboolean  e_source_selector_source_is_selected  (ESourceSelector *selector,
68                                                  ESource         *source);
69
70 GSList *e_source_selector_get_selection   (ESourceSelector *selector);
71 void    e_source_selector_free_selection  (GSList          *list);
72
73 void      e_source_selector_show_selection   (ESourceSelector *selector,
74                                               gboolean         show);
75 gboolean  e_source_selector_selection_shown  (ESourceSelector *selector);
76
77 void e_source_selector_set_select_new (ESourceSelector *selector, gboolean state);
78
79 ESource *e_source_selector_peek_primary_selection  (ESourceSelector *selector);
80 void     e_source_selector_set_primary_selection   (ESourceSelector *selector,
81                                                     ESource         *source);
82
83 ESourceGroup *e_source_selector_get_primary_source_group (ESourceSelector *selector);
84 G_END_DECLS
85
86 #endif /* _E_SOURCE_SELECTOR_H_ */