Assamese translation updated
[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) 1999-2008 Novell, Inc. (www.novell.com)
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 #if !defined (__LIBEDATASERVERUI_H_INSIDE__) && !defined (LIBEDATASERVERUI_COMPILATION)
25 #error "Only <libedataserverui/libedataserverui.h> should be included directly."
26 #endif
27
28 #ifndef E_SOURCE_SELECTOR_H
29 #define E_SOURCE_SELECTOR_H
30
31 #include <gtk/gtk.h>
32 #include <libedataserver/libedataserver.h>
33
34 /* Standard GObject macros */
35 #define E_TYPE_SOURCE_SELECTOR \
36         (e_source_selector_get_type ())
37 #define E_SOURCE_SELECTOR(obj) \
38         (G_TYPE_CHECK_INSTANCE_CAST \
39         ((obj), E_TYPE_SOURCE_SELECTOR, ESourceSelector))
40 #define E_SOURCE_SELECTOR_CLASS(cls) \
41         (G_TYPE_CHECK_CLASS_CAST \
42         ((cls), E_TYPE_SOURCE_SELECTOR, ESourceSelectorClass))
43 #define E_IS_SOURCE_SELECTOR(obj) \
44         (G_TYPE_CHECK_INSTANCE_TYPE \
45         ((obj), E_TYPE_SOURCE_SELECTOR))
46 #define E_IS_SOURCE_SELECTOR_CLASS(cls) \
47         (G_TYPE_CHECK_CLASS_TYPE \
48         ((cls), E_TYPE_SOURCE_SELECTOR))
49 #define E_SOURCE_SELECTOR_GET_CLASS(obj) \
50         (G_TYPE_INSTANCE_GET_CLASS \
51         ((obj), E_TYPE_SOURCE_SELECTOR, ESourceSelectorClass))
52
53 G_BEGIN_DECLS
54
55 typedef struct _ESourceSelector ESourceSelector;
56 typedef struct _ESourceSelectorClass ESourceSelectorClass;
57 typedef struct _ESourceSelectorPrivate ESourceSelectorPrivate;
58
59 struct _ESourceSelector {
60         GtkTreeView parent;
61         ESourceSelectorPrivate *priv;
62 };
63
64 struct _ESourceSelectorClass {
65         GtkTreeViewClass parent_class;
66
67         /* Methods */
68         gboolean        (*get_source_selected)  (ESourceSelector *selector,
69                                                  ESource *source);
70         void            (*set_source_selected)  (ESourceSelector *selector,
71                                                  ESource *source,
72                                                  gboolean selected);
73
74         /* Signals */
75         void            (*selection_changed)    (ESourceSelector *selector);
76         void            (*primary_selection_changed)
77                                                 (ESourceSelector *selector);
78         gboolean        (*popup_event)          (ESourceSelector *selector,
79                                                  ESource *primary,
80                                                  GdkEventButton *event);
81         gboolean        (*data_dropped)         (ESourceSelector *selector,
82                                                  GtkSelectionData *data,
83                                                  ESource *destination,
84                                                  GdkDragAction action,
85                                                  guint target_info);
86
87         gpointer padding1;
88         gpointer padding2;
89         gpointer padding3;
90 };
91
92 GType           e_source_selector_get_type      (void);
93 GtkWidget *     e_source_selector_new           (ESourceRegistry *registry,
94                                                  const gchar *extension_name);
95 ESourceRegistry *
96                 e_source_selector_get_registry  (ESourceSelector *selector);
97 const gchar *   e_source_selector_get_extension_name
98                                                 (ESourceSelector *selector);
99 gboolean        e_source_selector_get_show_colors
100                                                 (ESourceSelector *selector);
101 void            e_source_selector_set_show_colors
102                                                 (ESourceSelector *selector,
103                                                  gboolean show_colors);
104 gboolean        e_source_selector_get_show_toggles
105                                                 (ESourceSelector *selector);
106 void            e_source_selector_set_show_toggles
107                                                 (ESourceSelector *selector,
108                                                  gboolean show_toggles);
109 void            e_source_selector_select_source (ESourceSelector *selector,
110                                                  ESource *source);
111 void            e_source_selector_unselect_source
112                                                 (ESourceSelector *selector,
113                                                  ESource *source);
114 void            e_source_selector_select_exclusive
115                                                 (ESourceSelector *selector,
116                                                  ESource *source);
117 gboolean        e_source_selector_source_is_selected
118                                                 (ESourceSelector *selector,
119                                                  ESource *source);
120 GSList *        e_source_selector_get_selection (ESourceSelector *selector);
121 void            e_source_selector_free_selection
122                                                 (GSList *list);
123 void            e_source_selector_set_select_new
124                                                 (ESourceSelector *selector,
125                                                  gboolean state);
126 void            e_source_selector_edit_primary_selection
127                                                 (ESourceSelector *selector);
128 ESource *       e_source_selector_ref_primary_selection
129                                                 (ESourceSelector *selector);
130 void            e_source_selector_set_primary_selection
131                                                 (ESourceSelector *selector,
132                                                  ESource *source);
133 ESource *       e_source_selector_ref_source_by_path
134                                                 (ESourceSelector *selector,
135                                                  GtkTreePath *path);
136 void            e_source_selector_queue_write   (ESourceSelector *selector,
137                                                  ESource *source);
138
139 G_END_DECLS
140
141 #endif /* E_SOURCE_SELECTOR_H */