1 /* dzl-shortcut-theme.h
2  *
3  * Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 2 of the License, or
8  * (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
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef DZL_SHORTCUT_THEME_H
20 #define DZL_SHORTCUT_THEME_H
21 
22 #include <gtk/gtk.h>
23 
24 #include "dzl-version-macros.h"
25 
26 #include "shortcuts/dzl-shortcut-chord.h"
27 #include "shortcuts/dzl-shortcut-context.h"
28 #include "shortcuts/dzl-shortcut-phase.h"
29 
30 G_BEGIN_DECLS
31 
32 #define DZL_TYPE_SHORTCUT_THEME (dzl_shortcut_theme_get_type())
33 
34 DZL_AVAILABLE_IN_ALL
35 G_DECLARE_DERIVABLE_TYPE (DzlShortcutTheme, dzl_shortcut_theme, DZL, SHORTCUT_THEME, GObject)
36 
37 struct _DzlShortcutThemeClass
38 {
39   GObjectClass parent_class;
40 
41   gpointer _reserved1;
42   gpointer _reserved2;
43   gpointer _reserved3;
44   gpointer _reserved4;
45   gpointer _reserved5;
46   gpointer _reserved6;
47   gpointer _reserved7;
48   gpointer _reserved8;
49 };
50 
51 DZL_AVAILABLE_IN_ALL
52 DzlShortcutTheme       *dzl_shortcut_theme_new                   (const gchar             *name);
53 DZL_AVAILABLE_IN_ALL
54 const gchar            *dzl_shortcut_theme_get_name              (DzlShortcutTheme        *self);
55 DZL_AVAILABLE_IN_ALL
56 const gchar            *dzl_shortcut_theme_get_title             (DzlShortcutTheme        *self);
57 DZL_AVAILABLE_IN_ALL
58 const gchar            *dzl_shortcut_theme_get_subtitle          (DzlShortcutTheme        *self);
59 DZL_AVAILABLE_IN_ALL
60 DzlShortcutTheme       *dzl_shortcut_theme_get_parent            (DzlShortcutTheme        *self);
61 DZL_AVAILABLE_IN_ALL
62 const gchar            *dzl_shortcut_theme_get_parent_name       (DzlShortcutTheme        *self);
63 DZL_AVAILABLE_IN_ALL
64 void                    dzl_shortcut_theme_set_parent_name       (DzlShortcutTheme        *self,
65                                                                   const gchar             *parent_name);
66 DZL_AVAILABLE_IN_ALL
67 DzlShortcutContext     *dzl_shortcut_theme_find_default_context  (DzlShortcutTheme        *self,
68                                                                   GtkWidget               *widget);
69 DZL_AVAILABLE_IN_ALL
70 DzlShortcutContext     *dzl_shortcut_theme_find_context_by_name  (DzlShortcutTheme        *self,
71                                                                   const gchar             *name);
72 DZL_AVAILABLE_IN_ALL
73 void                    dzl_shortcut_theme_add_command           (DzlShortcutTheme        *self,
74                                                                   const gchar             *accelerator,
75                                                                   const gchar             *command);
76 DZL_AVAILABLE_IN_ALL
77 void                    dzl_shortcut_theme_add_context           (DzlShortcutTheme        *self,
78                                                                   DzlShortcutContext      *context);
79 DZL_AVAILABLE_IN_ALL
80 void                    dzl_shortcut_theme_set_chord_for_action  (DzlShortcutTheme        *self,
81                                                                   const gchar             *detailed_action_name,
82                                                                   const DzlShortcutChord  *chord,
83                                                                   DzlShortcutPhase         phase);
84 DZL_AVAILABLE_IN_ALL
85 const DzlShortcutChord *dzl_shortcut_theme_get_chord_for_action  (DzlShortcutTheme        *self,
86                                                                   const gchar             *detailed_action_name);
87 DZL_AVAILABLE_IN_ALL
88 void                    dzl_shortcut_theme_set_accel_for_action  (DzlShortcutTheme        *self,
89                                                                   const gchar             *detailed_action_name,
90                                                                   const gchar             *accel,
91                                                                   DzlShortcutPhase         phase);
92 DZL_AVAILABLE_IN_ALL
93 void                    dzl_shortcut_theme_set_chord_for_command (DzlShortcutTheme        *self,
94                                                                   const gchar             *command,
95                                                                   const DzlShortcutChord  *chord,
96                                                                   DzlShortcutPhase         phase);
97 DZL_AVAILABLE_IN_ALL
98 const DzlShortcutChord *dzl_shortcut_theme_get_chord_for_command (DzlShortcutTheme        *self,
99                                                                   const gchar             *command);
100 DZL_AVAILABLE_IN_ALL
101 void                    dzl_shortcut_theme_set_accel_for_command (DzlShortcutTheme        *self,
102                                                                   const gchar             *command,
103                                                                   const gchar             *accel,
104                                                                   DzlShortcutPhase         phase);
105 DZL_AVAILABLE_IN_ALL
106 gboolean                dzl_shortcut_theme_load_from_data        (DzlShortcutTheme        *self,
107                                                                   const gchar             *data,
108                                                                   gssize                   len,
109                                                                   GError                 **error);
110 DZL_AVAILABLE_IN_ALL
111 gboolean                dzl_shortcut_theme_load_from_file        (DzlShortcutTheme        *self,
112                                                                   GFile                   *file,
113                                                                   GCancellable            *cancellable,
114                                                                   GError                 **error);
115 DZL_AVAILABLE_IN_ALL
116 gboolean                dzl_shortcut_theme_load_from_path        (DzlShortcutTheme        *self,
117                                                                   const gchar             *path,
118                                                                   GCancellable            *cancellable,
119                                                                   GError                 **error);
120 DZL_AVAILABLE_IN_ALL
121 gboolean                dzl_shortcut_theme_save_to_file          (DzlShortcutTheme        *self,
122                                                                   GFile                   *file,
123                                                                   GCancellable            *cancellable,
124                                                                   GError                 **error);
125 DZL_AVAILABLE_IN_ALL
126 gboolean                dzl_shortcut_theme_save_to_stream        (DzlShortcutTheme        *self,
127                                                                   GOutputStream           *stream,
128                                                                   GCancellable            *cancellable,
129                                                                   GError                 **error);
130 DZL_AVAILABLE_IN_ALL
131 gboolean                dzl_shortcut_theme_save_to_path          (DzlShortcutTheme        *self,
132                                                                   const gchar             *path,
133                                                                   GCancellable            *cancellable,
134                                                                   GError                 **error);
135 DZL_AVAILABLE_IN_ALL
136 void                    dzl_shortcut_theme_add_css_resource      (DzlShortcutTheme        *self,
137                                                                   const gchar             *path);
138 DZL_AVAILABLE_IN_ALL
139 void                    dzl_shortcut_theme_remove_css_resource   (DzlShortcutTheme        *self,
140                                                                   const gchar             *path);
141 
142 G_END_DECLS
143 
144 #endif /* DZL_SHORTCUT_THEME_H */
145