1 /*
2  * Copyright (C) 2007  Ignacio Casal Quinteiro <nacho.resa@gmail.com>
3  *
4  *     This program is free software: you can redistribute it and/or modify
5  *     it under the terms of the GNU General Public License as published by
6  *     the Free Software Foundation, either version 3 of the License, or
7  *     (at your option) any later version.
8  *
9  *     This program is distributed in the hope that it will be useful,
10  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *     GNU General Public License for more details.
13  *
14  *     You should have received a copy of the GNU General Public License
15  *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __MESSAGE_TABLE_H__
19 #define __MESSAGE_TABLE_H__
20 
21 #include <glib.h>
22 #include <glib-object.h>
23 #include <gtk/gtk.h>
24 
25 #include "gtr-message-container.h"
26 #include "gtr-msg.h"
27 #include "gtr-tab.h"
28 
29 G_BEGIN_DECLS
30 /*
31  * Type checking and casting macros
32  */
33 #define GTR_TYPE_MESSAGE_TABLE		(gtr_message_table_get_type ())
34 #define GTR_MESSAGE_TABLE(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), GTR_TYPE_MESSAGE_TABLE, GtrMessageTable))
35 #define GTR_MESSAGE_TABLE_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), GTR_TYPE_MESSAGE_TABLE, GtrMessageTableClass))
36 #define GTR_IS_MESSAGE_TABLE(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), GTR_TYPE_MESSAGE_TABLE))
37 #define GTR_IS_MESSAGE_TABLE_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), GTR_TYPE_MESSAGE_TABLE))
38 #define GTR_MESSAGE_TABLE_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GTR_TYPE_MESSAGE_TABLE, GtrMessageTableClass))
39 
40 /*
41  * Main object structure
42  */
43 typedef struct _GtrMessageTable GtrMessageTable;
44 
45 struct _GtrMessageTable
46 {
47   GtkBox parent_instance;
48 };
49 
50 /*
51  * Class definition
52  */
53 typedef struct _GtrMessageTableClass GtrMessageTableClass;
54 typedef gboolean (* GtrMessageTableNavigationFunc) (GtrMsg * msg);
55 
56 struct _GtrMessageTableClass
57 {
58   GtkBoxClass parent_class;
59 };
60 
61 typedef enum {
62   GTR_NAVIGATE_PREV,
63   GTR_NAVIGATE_NEXT,
64   GTR_NAVIGATE_FIRST,
65   GTR_NAVIGATE_LAST
66 } GtrMessageTableNavigation;
67 
68 /*
69  * Public methods
70  */
71 GType
72 gtr_message_table_get_type (void)
73   G_GNUC_CONST;
74 
75      GType gtr_message_table_register_type (GTypeModule * module);
76 
77      GtkWidget *gtr_message_table_new (void);
78 
79      void gtr_message_table_populate (GtrMessageTable * table,
80                                       GtrMessageContainer * container);
81 
82      GtrMsg * gtr_message_table_navigate (GtrMessageTable * table,
83                                           GtrMessageTableNavigation navigation,
84                                           GtrMessageTableNavigationFunc func);
85 
86 
87      void
88        gtr_message_table_update_translation (GtrMessageTable *
89                                              table,
90                                              GtrMsg * msg,
91                                              gchar * translation);
92 
93      void gtr_message_table_sort_by (GtrMessageTable *table,
94                                      GtrMessageTableSortBy sort);
95 
96 G_END_DECLS
97 #endif /* __MESSAGE_TABLE_H__ */
98