1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
4 * Copyright (C) 2003 Ximian, Inc.
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.
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.
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.
21 * Author: Ettore Perazzoli <ettore@ximian.com>
24 #ifndef _E_SOURCE_SELECTOR_H_
25 #define _E_SOURCE_SELECTOR_H_
27 #include <gtk/gtkmenu.h>
28 #include <gtk/gtktreeview.h>
29 #include "libedataserver/e-source-list.h"
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))
40 typedef struct _ESourceSelector ESourceSelector;
41 typedef struct _ESourceSelectorPrivate ESourceSelectorPrivate;
42 typedef struct _ESourceSelectorClass ESourceSelectorClass;
44 struct _ESourceSelector {
47 ESourceSelectorPrivate *priv;
50 struct _ESourceSelectorClass {
51 GtkTreeViewClass parent_class;
53 void (* selection_changed) (ESourceSelector *selector);
54 void (* primary_selection_changed) (ESourceSelector *selector);
55 gboolean (*popup_event)(ESourceSelector *selector, ESource *primary, GdkEventButton *event);
59 GType e_source_selector_get_type (void);
61 GtkWidget *e_source_selector_new (ESourceList *list);
63 void e_source_selector_select_source (ESourceSelector *selector,
65 void e_source_selector_unselect_source (ESourceSelector *selector,
67 gboolean e_source_selector_source_is_selected (ESourceSelector *selector,
70 GSList *e_source_selector_get_selection (ESourceSelector *selector);
71 void e_source_selector_free_selection (GSList *list);
73 void e_source_selector_show_selection (ESourceSelector *selector,
75 gboolean e_source_selector_selection_shown (ESourceSelector *selector);
77 void e_source_selector_set_select_new (ESourceSelector *selector, gboolean state);
79 ESource *e_source_selector_peek_primary_selection (ESourceSelector *selector);
80 void e_source_selector_set_primary_selection (ESourceSelector *selector,
83 ESourceGroup *e_source_selector_get_primary_source_group (ESourceSelector *selector);
86 #endif /* _E_SOURCE_SELECTOR_H_ */