2013-02-20 [colin] 3.9.0cvs85
[claws.git] / src / plugins / notification / gtkhotkey / gtk-hotkey-listener.h
1 /*
2  * This file is part of GtkHotkey.
3  * Copyright Mikkel Kamstrup Erlandsen, March, 2008
4  *
5  *   GtkHotkey is free software: you can redistribute it and/or modify
6  *   it under the terms of the GNU Lesser 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  *   GtkHotkey 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 Lesser General Public License for more details.
14  *
15  *   You should have received a copy of the GNU Lesser General Public License
16  *   along with GtkHotkey.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #if !defined (__GTK_HOTKEY_H__) && !defined (GTK_HOTKEY_COMPILATION)
20 #error "Only <gtkhotkey.h> can be included directly."
21 #endif
22
23 #ifndef __GTK_HOTKEY_LISTENER_H__
24 #define __GTK_HOTKEY_LISTENER_H__
25
26 #include <glib.h>
27 #include <glib-object.h>
28 #include "gtk-hotkey-info.h"
29
30 G_BEGIN_DECLS
31
32
33 #define GTK_HOTKEY_TYPE_LISTENER (gtk_hotkey_listener_get_type ())
34 #define GTK_HOTKEY_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_HOTKEY_TYPE_LISTENER, GtkHotkeyListener))
35 #define GTK_HOTKEY_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_HOTKEY_TYPE_LISTENER, GtkHotkeyListenerClass))
36 #define GTK_HOTKEY_IS_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_HOTKEY_TYPE_LISTENER))
37 #define GTK_HOTKEY_IS_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_HOTKEY_TYPE_LISTENER))
38 #define GTK_HOTKEY_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_HOTKEY_TYPE_LISTENER, GtkHotkeyListenerClass))
39
40 typedef struct _GtkHotkeyListener GtkHotkeyListener;
41 typedef struct _GtkHotkeyListenerClass GtkHotkeyListenerClass;
42 typedef struct _GtkHotkeyListenerPrivate GtkHotkeyListenerPrivate;
43
44 struct _GtkHotkeyListener {
45         GObject                                         parent;
46         GtkHotkeyListenerPrivate        *priv;
47 };
48
49 struct _GtkHotkeyListenerClass {
50         GObjectClass    parent;
51         gboolean                (*bind_hotkey)    (GtkHotkeyListener    *self,
52                                                                            GtkHotkeyInfo                *hotkey,
53                                                                            GError                               **error);
54         gboolean                (*unbind_hotkey) (GtkHotkeyListener             *self,
55                                                                           GtkHotkeyInfo                 *hotkey,
56                                                                           GError                                **error);
57 };
58
59 GtkHotkeyListener*  gtk_hotkey_listener_get_default                     (void);
60
61 void                            gtk_hotkey_listener_activated                   (GtkHotkeyListener      *self,
62                                                                                                                          GtkHotkeyInfo          *hotkey,
63                                                                                                                          guint                          event_time);
64
65 gboolean                        gtk_hotkey_listener_bind_hotkey         (GtkHotkeyListener  *self,
66                                                                                                                  GtkHotkeyInfo          *hotkey,
67                                                                                                                  GError                         **error);
68
69 gboolean                        gtk_hotkey_listener_unbind_hotkey   (GtkHotkeyListener  *self,
70                                                                                                                  GtkHotkeyInfo          *hotkey,
71                                                                                                                  GError                         **error);
72
73 GType                           gtk_hotkey_listener_get_type                    (void);
74
75 G_END_DECLS
76
77 #endif /* __GTK_HOTKEY_LISTENER_H__ */