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.
31 /* modest-tny-header-tree-view.h */
33 #ifndef __MODEST_TNY_HEADER_TREE_VIEW_H__
34 #define __MODEST_TNY_HEADER_TREE_VIEW_H__
37 #include <tny-msg-folder-iface.h>
38 #include <tny-account-tree-model.h>
39 #include <tny-msg-iface.h>
40 #include <tny-msg-header-iface.h>
41 #include <tny-msg-header-list-model.h>
45 /* convenience macros */
46 #define MODEST_TYPE_TNY_HEADER_TREE_VIEW (modest_tny_header_tree_view_get_type())
47 #define MODEST_TNY_HEADER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW,ModestTnyHeaderTreeView))
48 #define MODEST_TNY_HEADER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_HEADER_TREE_VIEW,ModestTnyHeaderTreeViewClass))
49 #define MODEST_IS_TNY_HEADER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW))
50 #define MODEST_IS_TNY_HEADER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_HEADER_TREE_VIEW))
51 #define MODEST_TNY_HEADER_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_HEADER_TREE_VIEW,ModestTnyHeaderTreeViewClass))
53 typedef struct _ModestTnyHeaderTreeView ModestTnyHeaderTreeView;
54 typedef struct _ModestTnyHeaderTreeViewClass ModestTnyHeaderTreeViewClass;
56 struct _ModestTnyHeaderTreeView {
58 /* insert public members, if any */
61 struct _ModestTnyHeaderTreeViewClass {
62 GtkTreeViewClass parent_class;
64 void (*message_selected) (ModestTnyHeaderTreeView* self,
68 /* msg == NULL implies that the operation is finished, ie.
69 * the progress indictation can be hidden */
70 void (*status_update) (ModestTnyHeaderTreeView* self,
78 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_FROM,
79 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_TO,
80 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_SUBJECT,
81 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_SENT_DATE,
82 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_RECEIVED_DATE,
83 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_MSGTYPE,
84 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_ATTACH,
85 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_COMPACT_HEADER,
87 MODEST_TNY_HEADER_TREE_VIEW_COLUMN_NUM
89 typedef guint ModestTnyHeaderTreeViewColumn;
92 MODEST_TNY_HEADER_TREE_VIEW_STYLE_NORMAL,
93 MODEST_TNY_HEADER_TREE_VIEW_STYLE_COMPACT,
95 MODEST_TNY_HEADER_TREE_VIEW_STYLE_NUM
97 typedef guint ModestTnyHeaderTreeViewStyle;
102 * modest_tny_header_tree_view_get_type:
104 * get the GType for ModestTnyHeaderTreeView
108 GType modest_tny_header_tree_view_get_type (void) G_GNUC_CONST;
112 * modest_tny_header_tree_view_new:
113 * @folder: a TnyMsgFolderIface object
114 * @columns: a list of ModestTnyHeaderTreeViewColumn
115 * @style: a ModestTnyHeaderTreeViewColumn with the style of this listview
116 * ( MODEST_TNY_HEADER_TREE_VIEW_STYLE_NORMAL or MODEST_TNY_HEADER_TREE_VIEW_STYLE_COMPACT)
118 * create a new ModestTnyHeaderTreeView instance, based on a folder iface
120 * Returns: a new GtkWidget (a GtkTreeView-subclass)
122 GtkWidget* modest_tny_header_tree_view_new (TnyMsgFolderIface *folder,
124 ModestTnyHeaderTreeViewStyle style);
127 * modest_tny_header_tree_view_set_folder:
128 * @self: a ModestTnyHeaderTreeView instance
129 * @folder: a TnyMsgFolderIface object
131 * set the folder for this ModestTnyHeaderTreeView
133 * Returns: TRUE if it succeeded, FALSE otherwise
135 gboolean modest_tny_header_tree_view_set_folder (ModestTnyHeaderTreeView *self,
136 TnyMsgFolderIface *folder);
140 * modest_tny_header_tree_view_set_columns:
141 * @self: a ModestTnyHeaderTreeView instance
142 * @columns: a list of ModestTnyHeaderTreeViewColumn
144 * set the columns for this ModestTnyHeaderTreeView
146 * Returns: TRUE if it succeeded, FALSE otherwise
148 gboolean modest_tny_header_tree_view_set_columns (ModestTnyHeaderTreeView *self,
151 * modest_tny_header_tree_view_get_columns:
152 * @self: a ModestTnyHeaderTreeView instance
153 * @folder: a TnyMsgFolderIface object
155 * get the columns for this ModestTnyHeaderTreeView
157 * Returns: list of columms, or NULL in case of no columns or error
159 const GSList* modest_tny_header_tree_view_get_columns (ModestTnyHeaderTreeView *self);
163 * modest_tny_header_tree_view_set_style:
164 * @self: a ModestTnyHeaderTreeView instance
165 * @style: the style for this tree view
167 * set the folder for this ModestTnyHeaderTreeView
169 * Returns: TRUE if it succeeded, FALSE otherwise
171 gboolean modest_tny_header_tree_view_set_style (ModestTnyHeaderTreeView *self,
172 ModestTnyHeaderTreeViewStyle style);
175 * modest_tny_header_tree_view_set_folder:
176 * @self: a ModestTnyHeaderTreeView instance
177 * @folder: a TnyMsgFolderIface object
179 * set the folder for this ModestTnyHeaderTreeView
181 * Returns: TRUE if it succeeded, FALSE otherwise
183 ModestTnyHeaderTreeViewStyle modest_tny_header_tree_view_get_style (ModestTnyHeaderTreeView *self);
191 #endif /* __MODEST_TNY_HEADER_TREE_VIEW_H__ */