1 /* Copyright (C) 2016-2017 Shengyu Zhang <i@silverrainz.me>
2  *
3  * This file is part of Srain.
4  *
5  * Srain is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef __SUI_MESSAGE_LIST_H
20 #define __SUI_MESSAGE_LIST_H
21 
22 #include <gtk/gtk.h>
23 #include "sui_message.h"
24 
25 #define SUI_TYPE_MESSAGE_LIST (sui_message_list_get_type())
26 #define SUI_MESSAGE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SUI_TYPE_MESSAGE_LIST, SuiMessageList))
27 #define SUI_IS_MESSAGE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), SUI_TYPE_MESSAGE_LIST))
28 
29 typedef struct _SuiMessageList SuiMessageList;
30 typedef struct _SuiMessageListClass SuiMessageListClass;
31 
32 GType sui_message_list_get_type(void);
33 SuiMessageList *sui_message_list_new(void);
34 
35 void sui_message_list_add_message(SuiMessageList *self, SuiMessage *msg, GtkAlign halign);
36 GList *sui_message_list_get_recent_messages(SuiMessageList *self, int limit);
37 
38 void sui_message_list_scroll_up(SuiMessageList *self, double step);
39 void sui_message_list_scroll_down(SuiMessageList *self, double step);
40 
41 #endif /* __SUI_MESSAGE_LIST_H */
42