~ubuntu-branches/ubuntu/trusty/unity-control-center/trusty

« back to all changes in this revision

Viewing changes to panels/region/cc-region-keyboard-item.h

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2014-01-08 16:29:18 UTC
  • Revision ID: package-import@ubuntu.com-20140108162918-g29dd08tr913y2qh
Tags: upstream-14.04.0
ImportĀ upstreamĀ versionĀ 14.04.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2011 Red Hat, Inc.
 
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, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef __CC_REGION_KEYBOARD_ITEM_H
 
22
#define __CC_REGION_KEYBOARD_ITEM_H
 
23
 
 
24
#include <glib-object.h>
 
25
 
 
26
G_BEGIN_DECLS
 
27
 
 
28
#define CC_TYPE_REGION_KEYBOARD_ITEM         (cc_region_keyboard_item_get_type ())
 
29
#define CC_REGION_KEYBOARD_ITEM(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), CC_TYPE_REGION_KEYBOARD_ITEM, CcRegionKeyboardItem))
 
30
#define CC_REGION_KEYBOARD_ITEM_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), CC_TYPE_REGION_KEYBOARD_ITEM, CcRegionKeyboardItemClass))
 
31
#define CC_IS_REGION_KEYBOARD_ITEM(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), CC_TYPE_REGION_KEYBOARD_ITEM))
 
32
#define CC_IS_REGION_KEYBOARD_ITEM_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), CC_TYPE_REGION_KEYBOARD_ITEM))
 
33
#define CC_REGION_KEYBOARD_ITEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CC_TYPE_REGION_KEYBOARD_ITEM, CcRegionKeyboardItemClass))
 
34
 
 
35
typedef enum
 
36
{
 
37
  BINDING_GROUP_SYSTEM,
 
38
  BINDING_GROUP_APPS,
 
39
  BINDING_GROUP_SEPARATOR,
 
40
  BINDING_GROUP_USER,
 
41
} BindingGroupType;
 
42
 
 
43
typedef enum {
 
44
        CC_REGION_KEYBOARD_ITEM_TYPE_NONE = 0,
 
45
        CC_REGION_KEYBOARD_ITEM_TYPE_GSETTINGS_PATH,
 
46
        CC_REGION_KEYBOARD_ITEM_TYPE_GSETTINGS
 
47
} CcRegionKeyboardItemType;
 
48
 
 
49
typedef struct CcRegionKeyboardItemPrivate CcRegionKeyboardItemPrivate;
 
50
 
 
51
typedef struct
 
52
{
 
53
  GObject                parent;
 
54
  CcRegionKeyboardItemPrivate *priv;
 
55
 
 
56
  /* Move to priv */
 
57
  CcRegionKeyboardItemType type;
 
58
 
 
59
  /* common */
 
60
  /* FIXME move to priv? */
 
61
  guint keyval;
 
62
  guint keycode;
 
63
  GdkModifierType mask;
 
64
  BindingGroupType group;
 
65
  GtkTreeModel *model;
 
66
  char *description;
 
67
  char *gettext_package;
 
68
  char *binding;
 
69
  gboolean editable;
 
70
 
 
71
  /* GSettings path */
 
72
  char *gsettings_path;
 
73
  gboolean desc_editable;
 
74
  char *command;
 
75
  gboolean cmd_editable;
 
76
 
 
77
  /* GSettings */
 
78
  char *schema;
 
79
  char *key;
 
80
  GSettings *settings;
 
81
} CcRegionKeyboardItem;
 
82
 
 
83
typedef struct
 
84
{
 
85
  GObjectClass   parent_class;
 
86
} CcRegionKeyboardItemClass;
 
87
 
 
88
GType                  cc_region_keyboard_item_get_type                 (void);
 
89
 
 
90
CcRegionKeyboardItem * cc_region_keyboard_item_new                      (CcRegionKeyboardItemType  type);
 
91
gboolean               cc_region_keyboard_item_load_from_gsettings_path (CcRegionKeyboardItem     *item,
 
92
                                                                         const char               *path,
 
93
                                                                         gboolean                  reset);
 
94
gboolean               cc_region_keyboard_item_load_from_gsettings      (CcRegionKeyboardItem     *item,
 
95
                                                                         const char               *description,
 
96
                                                                         const char               *schema,
 
97
                                                                         const char               *key);
 
98
 
 
99
const char *           cc_region_keyboard_item_get_description          (CcRegionKeyboardItem     *item);
 
100
const char *           cc_region_keyboard_item_get_binding              (CcRegionKeyboardItem     *item);
 
101
const char *           cc_region_keyboard_item_get_command              (CcRegionKeyboardItem     *item);
 
102
 
 
103
gboolean               cc_region_keyboard_item_equal                    (CcRegionKeyboardItem     *a,
 
104
                                                                         CcRegionKeyboardItem     *b);
 
105
 
 
106
G_END_DECLS
 
107
 
 
108
#endif /* __CC_REGION_KEYBOARD_ITEM_H */