summaryrefslogtreecommitdiffstats
path: root/panels/keyboard/cc-keyboard-item.h
blob: 2f4194dc0ee6955558cff3db7707acd620cc923a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2011 Red Hat, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 *
 */

#pragma once

#include <glib-object.h>
#include <gtk/gtk.h>

G_BEGIN_DECLS

#define CC_TYPE_KEYBOARD_ITEM (cc_keyboard_item_get_type ())
G_DECLARE_FINAL_TYPE (CcKeyboardItem, cc_keyboard_item, CC, KEYBOARD_ITEM, GObject)

typedef enum
{
  BINDING_GROUP_SYSTEM,
  BINDING_GROUP_APPS,
  BINDING_GROUP_SEPARATOR,
  BINDING_GROUP_USER,
} BindingGroupType;

typedef enum
{
  CC_KEYBOARD_ITEM_TYPE_NONE = 0,
  CC_KEYBOARD_ITEM_TYPE_GSETTINGS_PATH,
  CC_KEYBOARD_ITEM_TYPE_GSETTINGS
} CcKeyboardItemType;

typedef struct
{
  guint           keyval;
  guint           keycode;
  GdkModifierType mask;
} CcKeyCombo;

CcKeyboardItem*    cc_keyboard_item_new                      (CcKeyboardItemType  type);

gboolean           cc_keyboard_item_load_from_gsettings_path (CcKeyboardItem     *item,
                                                              const char         *path,
                                                              gboolean            reset);

gboolean           cc_keyboard_item_load_from_gsettings      (CcKeyboardItem     *item,
                                                              const char         *description,
                                                              const char         *schema,
                                                              const char         *key);

const char*        cc_keyboard_item_get_description          (CcKeyboardItem     *item);

gboolean           cc_keyboard_item_get_desc_editable        (CcKeyboardItem     *item);

const char*        cc_keyboard_item_get_command              (CcKeyboardItem     *item);

gboolean           cc_keyboard_item_get_cmd_editable         (CcKeyboardItem     *item);

gboolean           cc_keyboard_item_equal                    (CcKeyboardItem     *a,
                                                              CcKeyboardItem     *b);

void               cc_keyboard_item_add_reverse_item         (CcKeyboardItem     *item,
                                                              CcKeyboardItem     *reverse_item,
                                                              gboolean            is_reversed);

CcKeyboardItem*    cc_keyboard_item_get_reverse_item         (CcKeyboardItem     *item);

void               cc_keyboard_item_set_hidden               (CcKeyboardItem     *item,
                                                              gboolean            hidden);

gboolean           cc_keyboard_item_is_hidden                (CcKeyboardItem     *item);

gboolean           cc_keyboard_item_is_value_default         (CcKeyboardItem     *self);

void               cc_keyboard_item_reset                    (CcKeyboardItem     *self);

GList*             cc_keyboard_item_get_key_combos           (CcKeyboardItem     *self);

GList*             cc_keyboard_item_get_default_combos       (CcKeyboardItem     *self);

CcKeyCombo         cc_keyboard_item_get_primary_combo        (CcKeyboardItem     *self);

const gchar*       cc_keyboard_item_get_key                  (CcKeyboardItem     *self);

CcKeyboardItemType cc_keyboard_item_get_item_type            (CcKeyboardItem     *self);

const gchar*       cc_keyboard_item_get_gsettings_path       (CcKeyboardItem     *self);

GSettings*         cc_keyboard_item_get_settings             (CcKeyboardItem     *self);

gboolean           cc_keyboard_item_can_set_multiple         (CcKeyboardItem     *self);

void               cc_keyboard_item_add_key_combo            (CcKeyboardItem     *self,
                                                              CcKeyCombo         *combo);

void               cc_keyboard_item_remove_key_combo         (CcKeyboardItem     *self,
                                                              CcKeyCombo         *combo);
void               cc_keyboard_item_disable                  (CcKeyboardItem     *self);

G_END_DECLS