fix bug non PutChar with fail shift+space
[platform/core/uifw/ise-engine-unikey.git] / src / scimkeyselection.h
1 #ifndef __SCIM_KEY_SELECTION_H__
2 #define __SCIM_KEY_SELECTION_H__
3
4 #include <gtk/gtk.h>
5 #include <scim.h>
6
7 G_BEGIN_DECLS
8
9 #define SCIM_TYPE_KEY_SELECTION            (scim_key_selection_get_type ())
10 #define SCIM_KEY_SELECTION(obj)            (GTK_CHECK_CAST ((obj), SCIM_TYPE_KEY_SELECTION, ScimKeySelection))
11 #define SCIM_KEY_SELECTION_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), SCIM_TYPE_KEY_SELECTION, ScimKeySelectionClass))
12 #define SCIM_IS_KEY_SELECTION(obj)         (GTK_CHECK_TYPE ((obj), SCIM_TYPE_KEY_SELECTION))
13 #define SCIM_IS_KEY_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SCIM_TYPE_KEY_SELECTION))
14 #define SCIM_KEY_SELECTION_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), SCIM_TYPE_KEY_SELECTION, ScimKeySelectionClass))
15
16 #define SCIM_TYPE_KEY_SELECTION_DIALOG            (scim_key_selection_dialog_get_type ())
17 #define SCIM_KEY_SELECTION_DIALOG(obj)            (GTK_CHECK_CAST ((obj), SCIM_TYPE_KEY_SELECTION_DIALOG, ScimKeySelectionDialog))
18 #define SCIM_KEY_SELECTION_DIALOG_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), SCIM_TYPE_KEY_SELECTION_DIALOG, ScimKeySelectionDialogClass))
19 #define SCIM_IS_KEY_SELECTION_DIALOG(obj)         (GTK_CHECK_TYPE ((obj), SCIM_TYPE_KEY_SELECTION_DIALOG))
20 #define SCIM_IS_KEY_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SCIM_TYPE_KEY_SELECTION_DIALOG))
21 #define SCIM_KEY_SELECTION_DIALOG_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), SCIM_TYPE_KEY_SELECTION_DIALOG, ScimKeySelectionDialogClass))
22
23 typedef struct _ScimKeySelection       ScimKeySelection;
24 typedef struct _ScimKeySelectionClass  ScimKeySelectionClass;
25
26 typedef struct _ScimKeySelectionDialog       ScimKeySelectionDialog;
27 typedef struct _ScimKeySelectionDialogClass  ScimKeySelectionDialogClass;
28
29 struct _ScimKeySelection
30 {
31     GtkVBox  vbox;
32
33     GtkWidget *toggle_ctrl;
34     GtkWidget *toggle_alt;
35     GtkWidget *toggle_shift;
36     GtkWidget *toggle_meta;
37     GtkWidget *toggle_super;
38     GtkWidget *toggle_hyper;
39     GtkWidget *toggle_release;
40     GtkWidget *key_code;
41
42     GtkWidget        *list_view;
43     GtkTreeSelection *list_selection;
44     GtkListStore     *list_model;
45
46     gchar            *keys;
47 };
48
49 struct _ScimKeySelectionClass
50 {
51     GtkVBoxClass parent_class;
52
53     void (*changed) (ScimKeySelection *keyselection);
54 };
55
56 struct _ScimKeySelectionDialog
57 {
58     GtkDialog parent_instance;
59
60     GtkWidget *keysel;
61
62     GtkWidget *main_vbox;
63     GtkWidget *action_area;
64
65     GtkWidget *ok_button;
66     GtkWidget *cancel_button;
67 };
68
69 struct _ScimKeySelectionDialogClass
70 {
71     GtkDialogClass parent_class;
72
73     /* Padding for future expansion */
74     void (*_gtk_reserved1) (void);
75     void (*_gtk_reserved2) (void);
76     void (*_gtk_reserved3) (void);
77     void (*_gtk_reserved4) (void);
78 };
79
80 GType                 scim_key_selection_get_type        (void) G_GNUC_CONST;
81
82 GtkWidget*            scim_key_selection_new             (void);
83
84 void                  scim_key_selection_set_keys        (ScimKeySelection       *keyselection,
85                                                           const gchar            *keys);
86
87 void                  scim_key_selection_append_keys     (ScimKeySelection       *keyselection,
88                                                           const gchar            *keys);
89
90
91 G_CONST_RETURN gchar* scim_key_selection_get_keys        (ScimKeySelection       *keyselection);
92
93
94 GType                 scim_key_selection_dialog_get_type (void) G_GNUC_CONST;
95 GtkWidget*            scim_key_selection_dialog_new      (const gchar            *title);
96 void                  scim_key_selection_dialog_set_keys (ScimKeySelectionDialog *ksd,
97                                                           const gchar            *keys);
98 G_CONST_RETURN gchar* scim_key_selection_dialog_get_keys (ScimKeySelectionDialog *ksd);
99
100 G_END_DECLS
101
102 #endif /* __GTK_KEY_SELECTION_H__ */
103
104 /*
105 vi:ts=4:nowrap:ai:expandtab
106 */