]> Pileus Git - ~andy/gtk/blob - gtk/gactionobserver.h
eb15c3ab4034012b2d86361ccf830aeb96860905
[~andy/gtk] / gtk / gactionobserver.h
1 /*
2  * Copyright © 2011 Canonical Limited
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * licence or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
17  * USA.
18  *
19  * Authors: Ryan Lortie <desrt@desrt.ca>
20  */
21
22 #ifndef __G_ACTION_OBSERVER_H__
23 #define __G_ACTION_OBSERVER_H__
24
25 #include <gio/gio.h>
26
27 G_BEGIN_DECLS
28
29 #define G_TYPE_ACTION_OBSERVER                              (g_action_observer_get_type ())
30 #define G_ACTION_OBSERVER(inst)                             (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
31                                                              G_TYPE_ACTION_OBSERVER, GActionObserver))
32 #define G_IS_ACTION_OBSERVER(inst)                          (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
33                                                              G_TYPE_ACTION_OBSERVER))
34 #define G_ACTION_OBSERVER_GET_IFACE(inst)                   (G_TYPE_INSTANCE_GET_INTERFACE ((inst),                  \
35                                                              G_TYPE_ACTION_OBSERVER, GActionObserverInterface))
36
37 typedef struct _GActionObserverInterface                    GActionObserverInterface;
38 typedef struct _GActionObservable                           GActionObservable;
39 typedef struct _GActionObserver                             GActionObserver;
40
41 struct _GActionObserverInterface
42 {
43   GTypeInterface g_iface;
44
45   void (* action_added)           (GActionObserver    *observer,
46                                    GActionObservable  *observable,
47                                    const gchar        *action_name,
48                                    const GVariantType *parameter_type,
49                                    gboolean            enabled,
50                                    GVariant           *state);
51   void (* action_enabled_changed) (GActionObserver    *observer,
52                                    GActionObservable  *observable,
53                                    const gchar        *action_name,
54                                    gboolean            enabled);
55   void (* action_state_changed)   (GActionObserver    *observer,
56                                    GActionObservable  *observable,
57                                    const gchar        *action_name,
58                                    GVariant           *state);
59   void (* action_removed)         (GActionObserver    *observer,
60                                    GActionObservable  *observable,
61                                    const gchar        *action_name);
62 };
63
64 G_GNUC_INTERNAL
65 GType                   g_action_observer_get_type                      (void);
66 G_GNUC_INTERNAL
67 void                    g_action_observer_action_added                  (GActionObserver    *observer,
68                                                                          GActionObservable  *observable,
69                                                                          const gchar        *action_name,
70                                                                          const GVariantType *parameter_type,
71                                                                          gboolean            enabled,
72                                                                          GVariant           *state);
73 G_GNUC_INTERNAL
74 void                    g_action_observer_action_enabled_changed        (GActionObserver    *observer,
75                                                                          GActionObservable  *observable,
76                                                                          const gchar        *action_name,
77                                                                          gboolean            enabled);
78 G_GNUC_INTERNAL
79 void                    g_action_observer_action_state_changed          (GActionObserver    *observer,
80                                                                          GActionObservable  *observable,
81                                                                          const gchar        *action_name,
82                                                                          GVariant           *state);
83 G_GNUC_INTERNAL
84 void                    g_action_observer_action_removed                (GActionObserver    *observer,
85                                                                          GActionObservable  *observable,
86                                                                          const gchar        *action_name);
87
88 G_END_DECLS
89
90 #endif /* __G_ACTION_OBSERVER_H__ */