2013-02-20 [colin] 3.9.0cvs85
[claws.git] / src / plugins / notification / gtkhotkey / gtk-hotkey-registry.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_REGISTRY_H__
24 #define __GTK_HOTKEY_REGISTRY_H__
25
26 #include <glib.h>
27 #include <glib-object.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include "gtk-hotkey-info.h"
31 #include "gtk-hotkey-error.h"
32
33 G_BEGIN_DECLS
34
35
36 #define GTK_HOTKEY_TYPE_STORAGE (gtk_hotkey_registry_get_type ())
37 #define GTK_HOTKEY_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_HOTKEY_TYPE_STORAGE, GtkHotkeyRegistry))
38 #define GTK_HOTKEY_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_HOTKEY_TYPE_STORAGE, GtkHotkeyRegistryClass))
39 #define GTK_HOTKEY_IS_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_HOTKEY_TYPE_STORAGE))
40 #define GTK_HOTKEY_IS_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_HOTKEY_TYPE_STORAGE))
41 #define GTK_HOTKEY_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_HOTKEY_TYPE_STORAGE, GtkHotkeyRegistryClass))
42
43 typedef struct _GtkHotkeyRegistry GtkHotkeyRegistry;
44 typedef struct _GtkHotkeyRegistryClass GtkHotkeyRegistryClass;
45 typedef struct _GtkHotkeyRegistryPrivate GtkHotkeyRegistryPrivate;
46
47 struct _GtkHotkeyRegistry {
48         GObject parent;
49         GtkHotkeyRegistryPrivate * priv;
50 };
51 struct _GtkHotkeyRegistryClass {
52         GObjectClass    parent;
53         GtkHotkeyInfo*  (*get_hotkey)                                   (GtkHotkeyRegistry   *self,
54                                                                                                          const char                     *app_id,
55                                                                                                          const char                     *key_id,
56                                                                                                          GError                         **error);
57         GList*                  (*get_application_hotkeys)              (GtkHotkeyRegistry   *self,
58                                                                                                          const char                     *app_id,
59                                                                                                          GError                         **error);
60         GList*                  (*get_all_hotkeys)                              (GtkHotkeyRegistry   *self);
61         gboolean                (*store_hotkey)                                 (GtkHotkeyRegistry   *self,
62                                                                                                          GtkHotkeyInfo          *info,
63                                                                                                          GError                         **error);
64         gboolean                (*delete_hotkey)                                (GtkHotkeyRegistry   *self,
65                                                                                                          const gchar            *app_id,
66                                                                                                          const gchar            *key_id,
67                                                                                                          GError                         **error);
68         gboolean                (*has_hotkey)                                   (GtkHotkeyRegistry   *self,
69                                                                                                          const gchar            *app_id,
70                                                                                                          const gchar            *key_id);
71         void                    (*hotkey_stored)                                (GtkHotkeyRegistry   *self,
72                                                                                                          GtkHotkeyInfo          *info);
73         void                    (*hotkey_deleted)                               (GtkHotkeyRegistry   *self,
74                                                                                                          GtkHotkeyInfo          *info);
75 };
76
77 GtkHotkeyRegistry*              gtk_hotkey_registry_get_default         (void);
78
79 GtkHotkeyInfo*                  gtk_hotkey_registry_get_hotkey          (GtkHotkeyRegistry              *self,
80                                                                                                                          const char                             *app_id,
81                                                                                                                          const char                             *key_id,
82                                                                                                                          GError                                 **error);
83                                                                                                                          
84 GList*                                  gtk_hotkey_registry_get_application_hotkeys
85                                                                                                                         (GtkHotkeyRegistry              *self,
86                                                                                                                          const char                             *app_id,
87                                                                                                                          GError                                 **error);
88                                                                                                                          
89 GList*                                  gtk_hotkey_registry_get_all_hotkeys  (GtkHotkeyRegistry         *self);
90
91 gboolean                                gtk_hotkey_registry_store_hotkey                (GtkHotkeyRegistry              *self,
92                                                                                                                          GtkHotkeyInfo                  *info,
93                                                                                                                          GError                                 **error);
94
95 gboolean                                gtk_hotkey_registry_delete_hotkey       (GtkHotkeyRegistry              *self,
96                                                                                                                          const gchar                    *app_id,
97                                                                                                                          const gchar                    *key_id,
98                                                                                                                          GError                                 **error);
99                                                                                                                          
100 gboolean                                gtk_hotkey_registry_has_hotkey          (GtkHotkeyRegistry              *self,
101                                                                                                                          const gchar                    *app_id,
102                                                                                                                          const gchar                    *key_id);
103
104 void                                    gtk_hotkey_registry_hotkey_stored       (GtkHotkeyRegistry              *self,
105                                                                                                                          GtkHotkeyInfo                  *hotkey);
106
107 void                                    gtk_hotkey_registry_hotkey_deleted      (GtkHotkeyRegistry              *self,
108                                                                                                                          GtkHotkeyInfo                  *hotkey);
109
110 GType                                   gtk_hotkey_registry_get_type                    (void);
111
112 G_END_DECLS
113
114 #endif