|
| 1 | +/* |
| 2 | + * This file is free software; you can redistribute it and/or modify it |
| 3 | + * under the terms of the GNU Lesser General Public License as |
| 4 | + * published by the Free Software Foundation, version 3.0 of the |
| 5 | + * License. |
| 6 | + * |
| 7 | + * This file is distributed in the hope that it will be useful, but |
| 8 | + * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 10 | + * Lesser General Public License for more details. |
| 11 | + * |
| 12 | + * You should have received a copy of the GNU Lesser General Public |
| 13 | + * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 14 | + * |
| 15 | + * SPDX-License-Identifier: LGPL-3.0-only |
| 16 | + */ |
| 17 | + |
| 18 | +#pragma once |
| 19 | + |
| 20 | +#include <libportal/portal-helpers.h> |
| 21 | +#include <libportal/session.h> |
| 22 | + |
| 23 | +G_BEGIN_DECLS |
| 24 | + |
| 25 | +#define XDP_TYPE_GLOBAL_SHORTCUTS_SESSION (xdp_global_shortcuts_session_get_type ()) |
| 26 | + |
| 27 | +XDP_PUBLIC |
| 28 | +G_DECLARE_FINAL_TYPE (XdpGlobalShortcutsSession, |
| 29 | + xdp_global_shortcuts_session, |
| 30 | + XDP, |
| 31 | + GLOBAL_SHORTCUTS_SESSION, |
| 32 | + GObject) |
| 33 | + |
| 34 | +#define XDP_TYPE_GLOBAL_SHORTCUT (xdp_global_shortcut_get_type ()) |
| 35 | +#define XDP_TYPE_GLOBAL_SHORTCUT_ASSIGNED (xdp_global_shortcut_assigned_get_type ()) |
| 36 | + |
| 37 | +typedef struct _XdpGlobalShortcut XdpGlobalShortcut; |
| 38 | +typedef struct _XdpGlobalShortcutAssigned XdpGlobalShortcutAssigned; |
| 39 | + |
| 40 | +XDP_PUBLIC |
| 41 | +GType xdp_global_shortcut_get_type (void) G_GNUC_CONST; |
| 42 | + |
| 43 | +XDP_PUBLIC |
| 44 | +XdpGlobalShortcut *xdp_global_shortcut_new (const char *shortcut_id, |
| 45 | + const char *description, |
| 46 | + const char *preferred_trigger); |
| 47 | + |
| 48 | +XDP_PUBLIC |
| 49 | +XdpGlobalShortcut *xdp_global_shortcut_copy (const XdpGlobalShortcut *shortcut); |
| 50 | + |
| 51 | +XDP_PUBLIC |
| 52 | +void xdp_global_shortcut_free (XdpGlobalShortcut *shortcut); |
| 53 | + |
| 54 | +XDP_PUBLIC |
| 55 | +const char *xdp_global_shortcut_get_shortcut_id (const XdpGlobalShortcut *shortcut); |
| 56 | + |
| 57 | +XDP_PUBLIC |
| 58 | +const char *xdp_global_shortcut_get_description (const XdpGlobalShortcut *shortcut); |
| 59 | + |
| 60 | +XDP_PUBLIC |
| 61 | +const char *xdp_global_shortcut_get_preferred_trigger (const XdpGlobalShortcut *shortcut); |
| 62 | + |
| 63 | +XDP_PUBLIC |
| 64 | +void xdp_global_shortcut_set_description (XdpGlobalShortcut *shortcut, |
| 65 | + const char *description); |
| 66 | + |
| 67 | +XDP_PUBLIC |
| 68 | +void xdp_global_shortcut_set_preferred_trigger (XdpGlobalShortcut *shortcut, |
| 69 | + const char *preferred_trigger); |
| 70 | + |
| 71 | +XDP_PUBLIC |
| 72 | +GType xdp_global_shortcut_assigned_get_type (void) G_GNUC_CONST; |
| 73 | + |
| 74 | +XDP_PUBLIC |
| 75 | +XdpGlobalShortcutAssigned *xdp_global_shortcut_assigned_copy (const XdpGlobalShortcutAssigned *shortcut); |
| 76 | + |
| 77 | +XDP_PUBLIC |
| 78 | +void xdp_global_shortcut_assigned_free (XdpGlobalShortcutAssigned *shortcut); |
| 79 | + |
| 80 | +XDP_PUBLIC |
| 81 | +const char *xdp_global_shortcut_assigned_get_shortcut_id (const XdpGlobalShortcutAssigned *shortcut); |
| 82 | + |
| 83 | +XDP_PUBLIC |
| 84 | +const char *xdp_global_shortcut_assigned_get_description (const XdpGlobalShortcutAssigned *shortcut); |
| 85 | + |
| 86 | +XDP_PUBLIC |
| 87 | +const char *xdp_global_shortcut_assigned_get_trigger_description (const XdpGlobalShortcutAssigned *shortcut); |
| 88 | + |
| 89 | +G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdpGlobalShortcut, xdp_global_shortcut_free) |
| 90 | +G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdpGlobalShortcutAssigned, xdp_global_shortcut_assigned_free) |
| 91 | + |
| 92 | +XDP_PUBLIC |
| 93 | +void xdp_portal_create_global_shortcuts_session (XdpPortal *portal, |
| 94 | + GCancellable *cancellable, |
| 95 | + GAsyncReadyCallback callback, |
| 96 | + gpointer data); |
| 97 | + |
| 98 | +XDP_PUBLIC |
| 99 | +XdpGlobalShortcutsSession *xdp_portal_create_global_shortcuts_session_finish (XdpPortal *portal, |
| 100 | + GAsyncResult *result, |
| 101 | + GError **error); |
| 102 | + |
| 103 | +XDP_PUBLIC |
| 104 | +XdpSession *xdp_global_shortcuts_session_get_session (XdpGlobalShortcutsSession *session); |
| 105 | + |
| 106 | +XDP_PUBLIC |
| 107 | +void xdp_global_shortcuts_session_close (XdpGlobalShortcutsSession *session); |
| 108 | + |
| 109 | +XDP_PUBLIC |
| 110 | +void xdp_global_shortcuts_session_bind_shortcuts (XdpGlobalShortcutsSession *session, |
| 111 | + GPtrArray *shortcuts, |
| 112 | + const char *parent_window, |
| 113 | + GCancellable *cancellable, |
| 114 | + GAsyncReadyCallback callback, |
| 115 | + gpointer data); |
| 116 | + |
| 117 | +XDP_PUBLIC |
| 118 | +GPtrArray *xdp_global_shortcuts_session_bind_shortcuts_finish (XdpGlobalShortcutsSession *session, |
| 119 | + GAsyncResult *result, |
| 120 | + GError **error); |
| 121 | + |
| 122 | +XDP_PUBLIC |
| 123 | +void xdp_global_shortcuts_session_list_shortcuts (XdpGlobalShortcutsSession *session, |
| 124 | + GCancellable *cancellable, |
| 125 | + GAsyncReadyCallback callback, |
| 126 | + gpointer data); |
| 127 | + |
| 128 | +XDP_PUBLIC |
| 129 | +GPtrArray *xdp_global_shortcuts_session_list_shortcuts_finish (XdpGlobalShortcutsSession *session, |
| 130 | + GAsyncResult *result, |
| 131 | + GError **error); |
| 132 | + |
| 133 | +XDP_PUBLIC |
| 134 | +void xdp_global_shortcuts_session_configure_shortcuts (XdpGlobalShortcutsSession *session, |
| 135 | + const char *parent_window, |
| 136 | + const char *activation_token, |
| 137 | + GCancellable *cancellable, |
| 138 | + GAsyncReadyCallback callback, |
| 139 | + gpointer data); |
| 140 | + |
| 141 | +XDP_PUBLIC |
| 142 | +gboolean xdp_global_shortcuts_session_configure_shortcuts_finish (XdpGlobalShortcutsSession *session, |
| 143 | + GAsyncResult *result, |
| 144 | + GError **error); |
| 145 | + |
| 146 | +G_END_DECLS |
0 commit comments