Lomiri Action API
action-publisher.h
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of either or both of the following licences:
6  *
7  * 1) the GNU Lesser General Public License version 3, as published by
8  * the Free Software Foundation; and/or
9  * 2) the GNU Lesser General Public License version 2.1, as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranties of
14  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the applicable version of the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of both the GNU Lesser General Public
19  * License version 3 and version 2.1 along with this program. If not,
20  * see <http://www.gnu.org/licenses/>
21  *
22  * Author: Ryan Lortie <desrt@desrt.ca>
23  */
24 
25 #if !defined (_HUD_H_INSIDE) && !defined (HUD_COMPILATION)
26 #error "Only <hud.h> can be included directly."
27 #endif
28 
29 #ifndef __HUD_ACTION_PUBLISHER_H__
30 #define __HUD_ACTION_PUBLISHER_H__
31 
32 #include <gio/gio.h>
33 
34 G_BEGIN_DECLS
35 
36 #define HUD_TYPE_ACTION_PUBLISHER (hud_action_publisher_get_type ())
37 #define HUD_ACTION_PUBLISHER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
38  HUD_TYPE_ACTION_PUBLISHER, HudActionPublisher))
39 #define HUD_IS_ACTION_PUBLISHER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
40  HUD_TYPE_ACTION_PUBLISHER))
41 
47 #define HUD_ACTION_PUBLISHER_SIGNAL_ACTION_GROUP_ADDED "action-group-added"
48 
53 #define HUD_ACTION_PUBLISHER_SIGNAL_ACTION_GROUP_REMOVED "action-group-removed"
54 
55 GType hud_action_description_get_type (void);
56 
57 #define HUD_TYPE_ACTION_DESCRIPTION (hud_action_description_get_type ())
58 #define HUD_ACTION_DESCRIPTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
59  HUD_TYPE_ACTION_DESCRIPTION, HudActionDescription))
60 #define HUD_IS_ACTION_DESCRIPTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
61  HUD_TYPE_ACTION_DESCRIPTION))
62 
69 #define HUD_ACTION_PUBLISHER_NO_CONTEXT (NULL)
70 
76 #define HUD_ACTION_PUBLISHER_ALL_WINDOWS (0)
77 
79 typedef struct _HudActionPublisher HudActionPublisher;
81 
99  gchar * prefix;
100  gchar * path;
101 };
102 
103 GType hud_action_publisher_get_type (void) G_GNUC_CONST;
104 
105 HudActionPublisher * hud_action_publisher_new (guint window_id,
106  const gchar * context_id);
107 
108 HudActionPublisher * hud_action_publisher_new_for_application (GApplication *application);
109 
110 void hud_action_publisher_add_description (HudActionPublisher *publisher,
111  HudActionDescription *description);
112 
113 void hud_action_publisher_add_action_group (HudActionPublisher *publisher,
114  const gchar *prefix,
115  const gchar *object_path);
116 void hud_action_publisher_remove_action_group (HudActionPublisher *publisher,
117  const gchar *prefix,
118  GVariant *identifier);
119 guint hud_action_publisher_get_window_id (HudActionPublisher *publisher);
120 const gchar * hud_action_publisher_get_context_id (HudActionPublisher *publisher);
121 GList * hud_action_publisher_get_action_groups (HudActionPublisher *publisher);
122 const gchar * hud_action_publisher_get_description_path (HudActionPublisher *publisher);
123 
124 /* Description */
125 HudActionDescription * hud_action_description_new (const gchar *action_name,
126  GVariant *action_target);
127 HudActionDescription * hud_action_description_ref (HudActionDescription *description);
128 void hud_action_description_unref (HudActionDescription *description);
129 const gchar * hud_action_description_get_action_name (HudActionDescription *description);
130 GVariant * hud_action_description_get_action_target (HudActionDescription *description);
131 void hud_action_description_set_attribute_value (HudActionDescription *description,
132  const gchar *attribute_name,
133  GVariant *value);
134 void hud_action_description_set_attribute (HudActionDescription *description,
135  const gchar *attribute_name,
136  const gchar *format_string,
137  ...);
138 void hud_action_description_set_parameterized (HudActionDescription *parent,
139  GMenuModel *child);
140 
165 G_END_DECLS
166 
167 #endif /* __HUD_ACTION_PUBLISHER_H__ */
_HudActionDescription
Definition: action-publisher.c:80
_HudActionPublisherActionGroupSet
Definition: action-publisher.h:98