]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-theme.h
merge git work
[empathy.git] / libempathy-gtk / empathy-theme.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2007 Imendio AB
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (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 GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __EMPATHY_THEME_H__
22 #define __EMPATHY_THEME_H__
23
24 #include <glib-object.h>
25 #include <gtk/gtktextbuffer.h>
26
27 G_BEGIN_DECLS
28
29 #define EMPATHY_TYPE_THEME            (empathy_theme_get_type ())
30 #define EMPATHY_THEME(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_THEME, EmpathyTheme))
31 #define EMPATHY_THEME_CLASS(k)        (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_THEME, EmpathyThemeClass))
32 #define EMPATHY_IS_THEME(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_THEME))
33 #define EMPATHY_IS_THEME_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_THEME))
34 #define EMPATHY_THEME_GET_CLASS(o)    (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_THEME, EmpathyThemeClass))
35
36 typedef struct _EmpathyTheme      EmpathyTheme;
37 typedef struct _EmpathyThemeClass EmpathyThemeClass;
38
39 #include "empathy-chat-view.h"
40
41 struct _EmpathyTheme {
42         GObject parent;
43 };
44
45 typedef void EmpathyThemeContext;
46
47 struct _EmpathyThemeClass {
48         GObjectClass parent_class;
49
50         /* <vtable> */
51         EmpathyThemeContext * (*setup_with_view)  (EmpathyTheme        *theme,
52                                                   EmpathyChatView     *view);
53         void                 (*detach_from_view) (EmpathyTheme        *theme,
54                                                   EmpathyThemeContext *context,
55                                                   EmpathyChatView     *view);
56         void                 (*view_cleared)     (EmpathyTheme        *theme,
57                                                   EmpathyThemeContext *context,
58                                                   EmpathyChatView     *view);
59         void                 (*append_message)   (EmpathyTheme        *theme,
60                                                   EmpathyThemeContext *context,
61                                                   EmpathyChatView     *view,
62                                                   EmpathyMessage      *message);
63         void                 (*append_event)     (EmpathyTheme        *theme,
64                                                   EmpathyThemeContext *context,
65                                                   EmpathyChatView     *view,
66                                                   const gchar        *str);
67         void                 (*append_timestamp) (EmpathyTheme        *theme,
68                                                   EmpathyThemeContext *context,
69                                                   EmpathyChatView     *view,
70                                                   EmpathyMessage      *message,
71                                                   gboolean            show_date,
72                                                   gboolean            show_time);
73         void                 (*append_spacing)   (EmpathyTheme        *theme,
74                                                   EmpathyThemeContext *context,
75                                                   EmpathyChatView     *view);
76         void                 (*update_show_avatars) (EmpathyTheme     *theme,
77                                                      EmpathyThemeContext *context,
78                                                      EmpathyChatView  *view,
79                                                      gboolean         show);
80 };
81
82 GType         empathy_theme_get_type             (void) G_GNUC_CONST;
83
84 EmpathyTheme * empathy_theme_new                  (void);
85
86 EmpathyThemeContext *
87 empathy_theme_setup_with_view                    (EmpathyTheme        *theme,
88                                                  EmpathyChatView     *view);
89 void         empathy_theme_detach_from_view      (EmpathyTheme        *theme,
90                                                  EmpathyThemeContext *context,
91                                                  EmpathyChatView     *view);
92 void         empathy_theme_view_cleared          (EmpathyTheme        *theme,
93                                                  EmpathyThemeContext *context,
94                                                  EmpathyChatView     *view);
95
96 void         empathy_theme_append_message        (EmpathyTheme        *theme,
97                                                  EmpathyThemeContext *context,
98                                                  EmpathyChatView     *view,
99                                                  EmpathyMessage      *msg);
100 void         empathy_theme_append_text           (EmpathyTheme        *theme,
101                                                  EmpathyThemeContext *context,
102                                                  EmpathyChatView     *view,
103                                                  const gchar        *body,
104                                                  const gchar        *tag, 
105                                                  const gchar        *link_tag);
106 void         empathy_theme_append_spacing        (EmpathyTheme        *theme,
107                                                  EmpathyThemeContext *context,
108                                                  EmpathyChatView     *view);
109 void         empathy_theme_append_event          (EmpathyTheme        *theme,
110                                                  EmpathyThemeContext *context,
111                                                  EmpathyChatView     *view,
112                                                  const gchar        *str);
113 void         empathy_theme_append_timestamp      (EmpathyTheme        *theme,
114                                                  EmpathyThemeContext *context,
115                                                  EmpathyChatView     *view,
116                                                  EmpathyMessage      *message,
117                                                  gboolean            show_date,
118                                                  gboolean            show_time);
119
120 void      
121 empathy_theme_maybe_append_date_and_time         (EmpathyTheme        *theme,
122                                                  EmpathyThemeContext *context,
123                                                  EmpathyChatView     *view,
124                                                  EmpathyMessage      *message);
125 gboolean     empathy_theme_get_show_avatars      (EmpathyTheme        *theme);
126 void         empathy_theme_set_show_avatars      (EmpathyTheme        *theme,
127                                                  gboolean            show);
128
129 G_END_DECLS
130
131 #endif /* __EMPATHY_THEME_H__ */
132