1 /* Copyright (c) 2006, Nokia Corporation
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the Nokia Corporation nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef __MODEST_TNY_HEADER_TREE_VIEW_H__
31 #define __MODEST_TNY_HEADER_TREE_VIEW_H__
34 #include <tny-msg-folder-iface.h>
35 #include <tny-account-tree-model.h>
36 #include <tny-msg-iface.h>
37 #include <tny-msg-header-iface.h>
38 #include <tny-msg-header-list-model.h>
42 /* convenience macros */
43 #define MODEST_TYPE_TNY_HEADER_TREE_VIEW (modest_tny_header_tree_view_get_type())
44 #define MODEST_TNY_HEADER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW,ModestTnyHeaderTreeView))
45 #define MODEST_TNY_HEADER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_HEADER_TREE_VIEW,ModestTnyHeaderTreeViewClass))
46 #define MODEST_IS_TNY_HEADER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW))
47 #define MODEST_IS_TNY_HEADER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_HEADER_TREE_VIEW))
48 #define MODEST_TNY_HEADER_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW,ModestTnyHeaderTreeViewClass))
50 typedef struct _ModestTnyHeaderTreeView ModestTnyHeaderTreeView;
51 typedef struct _ModestTnyHeaderTreeViewClass ModestTnyHeaderTreeViewClass;
53 struct _ModestTnyHeaderTreeView {
55 /* insert public members, if any */
58 struct _ModestTnyHeaderTreeViewClass {
59 GtkTreeViewClass parent_class;
61 void (*message_selected) (ModestTnyHeaderTreeView* self,
65 /* msg == NULL implies that the operation is finished, ie.
66 * the progress indictation can be hidden */
67 void (*status_update) (ModestTnyHeaderTreeView* self,
75 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_FROM,
76 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_TO,
77 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_SUBJECT,
78 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_SENT_DATE,
79 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_RECEIVED_DATE,
80 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_MSGTYPE,
81 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_ATTACH,
82 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_COMPACT_HEADER,
84 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_NUM
86 typedef guint ModestTnyHeaderTreeViewColumn;
89 MODEST_TNY_HEADER_TREE_VIEW_STYLE_NORMAL,
90 MODEST_TNY_HEADER_TREE_VIEW_STYLE_COMPACT,
92 MODEST_TNY_HEADER_TREE_VIEW_STYLE_NUM
94 typedef guint ModestTnyHeaderTreeViewStyle;
99 * modest_tny_header_tree_view_get_type:
101 * get the GType for ModestTnyHeaderTreeView
105 GType modest_tny_header_tree_view_get_type (void) G_GNUC_CONST;
109 * modest_tny_header_tree_view_new:
110 * @folder: a TnyMsgFolderIface object
111 * @columns: a list of ModestTnyHeaderTreeViewColumn
112 * @style: a ModestTnyHeaderTreeViewColumn with the style of this listview
113 * ( MODEST_TNY_HEADER_TREE_VIEW_STYLE_NORMAL or MODEST_TNY_HEADER_TREE_VIEW_STYLE_COMPACT)
115 * create a new ModestTnyHeaderTreeView instance, based on a folder iface
117 * Returns: a new GtkWidget (a GtkTreeView-subclass)
119 GtkWidget* modest_tny_header_tree_view_new (TnyMsgFolderIface *folder,
121 ModestTnyHeaderTreeViewStyle style);
124 * modest_tny_header_tree_view_set_folder:
125 * @self: a ModestTnyHeaderTreeView instance
126 * @folder: a TnyMsgFolderIface object
128 * set the folder for this ModestTnyHeaderTreeView
130 * Returns: TRUE if it succeeded, FALSE otherwise
132 gboolean modest_tny_header_tree_view_set_folder (ModestTnyHeaderTreeView *self,
133 TnyMsgFolderIface *folder);
137 * modest_tny_header_tree_view_set_columns:
138 * @self: a ModestTnyHeaderTreeView instance
139 * @columns: a list of ModestTnyHeaderTreeViewColumn
141 * set the columns for this ModestTnyHeaderTreeView
143 * Returns: TRUE if it succeeded, FALSE otherwise
145 gboolean modest_tny_header_tree_view_set_columns (ModestTnyHeaderTreeView *self,
148 * modest_tny_header_tree_view_get_columns:
149 * @self: a ModestTnyHeaderTreeView instance
150 * @folder: a TnyMsgFolderIface object
152 * get the columns for this ModestTnyHeaderTreeView
154 * Returns: list of columms, or NULL in case of no columns or error
156 const GSList* modest_tny_header_tree_view_get_columns (ModestTnyHeaderTreeView *self);
160 * modest_tny_header_tree_view_set_style:
161 * @self: a ModestTnyHeaderTreeView instance
162 * @style: the style for this tree view
164 * set the folder for this ModestTnyHeaderTreeView
166 * Returns: TRUE if it succeeded, FALSE otherwise
168 gboolean modest_tny_header_tree_view_set_style (ModestTnyHeaderTreeView *self,
169 ModestTnyHeaderTreeViewStyle style);
172 * modest_tny_header_tree_view_set_folder:
173 * @self: a ModestTnyHeaderTreeView instance
174 * @folder: a TnyMsgFolderIface object
176 * set the folder for this ModestTnyHeaderTreeView
178 * Returns: TRUE if it succeeded, FALSE otherwise
180 ModestTnyHeaderTreeViewStyle modest_tny_header_tree_view_get_style (ModestTnyHeaderTreeView *self);
185 #endif /* __MODEST_TNY_HEADER_TREE_VIEW_H__ */