Clean spec file for yocto compliance.
[platform/upstream/ibus.git] / src / ibuspanelservice.h
1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
2 /* vim:set et sts=4: */
3 /* ibus - The Input Bus
4  * Copyright (c) 2009-2013 Google Inc. All rights reserved.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
19  * USA
20  */
21
22 #if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
23 #error "Only <ibus.h> can be included directly"
24 #endif
25
26 #ifndef __IBUS_PANEL_SERVICE_H_
27 #define __IBUS_PANEL_SERVICE_H_
28
29 /**
30  * SECTION: ibuspanelservice
31  * @short_description: Panel service back-end.
32  * @stability: Stable
33  *
34  * An IBusPanelService is a base class for UI services.
35  * Developers can "extend" this class for panel UI development.
36  */
37 #include "ibuslookuptable.h"
38 #include "ibusservice.h"
39 #include "ibusproplist.h"
40
41 /*
42  * Type macros.
43  */
44
45 /* define GOBJECT macros */
46 #define IBUS_TYPE_PANEL_SERVICE                \
47     (ibus_panel_service_get_type ())
48 #define IBUS_PANEL_SERVICE(obj)                        \
49     (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PANEL_SERVICE, IBusPanelService))
50 #define IBUS_PANEL_SERVICE_CLASS(klass)        \
51     (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PANEL_SERVICE, IBusPanelServiceClass))
52 #define IBUS_IS_PANEL_SERVICE(obj)                     \
53     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PANEL_SERVICE))
54 #define IBUS_IS_PANEL_SERVICE_CLASS(klass)             \
55     (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PANEL_SERVICE))
56 #define IBUS_PANEL_SERVICE_GET_CLASS(obj)      \
57     (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PANEL_SERVICE, IBusPanelServiceClass))
58
59 G_BEGIN_DECLS
60
61 typedef struct _IBusPanelService IBusPanelService;
62 typedef struct _IBusPanelServiceClass IBusPanelServiceClass;
63
64 /**
65  * IBusPanelService:
66  *
67  * An opaque data type representing an IBusPanelService.
68  */
69 struct _IBusPanelService {
70     IBusService parent;
71     /* instance members */
72 };
73
74 struct _IBusPanelServiceClass {
75     IBusServiceClass parent;
76
77     /* class members */
78     void     (* focus_in)                  (IBusPanelService       *panel,
79                                             const gchar
80                                                    *input_context_path);
81     void     (* focus_out)                 (IBusPanelService       *panel,
82                                             const gchar
83                                                    *input_context_path);
84     void     (* register_properties)       (IBusPanelService       *panel,
85                                             IBusPropList           *prop_list);
86     void     (* set_cursor_location)       (IBusPanelService       *panel,
87                                             gint                    x,
88                                             gint                    y,
89                                             gint                    w,
90                                             gint                    h);
91     void     (* update_auxiliary_text)     (IBusPanelService       *panel,
92                                             IBusText               *text,
93                                             gboolean                visible);
94     void     (* update_lookup_table)       (IBusPanelService       *panel,
95                                             IBusLookupTable        *lookup_table,
96                                             gboolean                visible);
97     void     (* update_preedit_text)       (IBusPanelService       *panel,
98                                             IBusText               *text,
99                                             guint                  cursor_pos,
100                                             gboolean               visible);
101     void     (* update_property)           (IBusPanelService       *panel,
102                                             IBusProperty           *prop);
103     void     (* cursor_down_lookup_table)  (IBusPanelService       *panel);
104     void     (* cursor_up_lookup_table)    (IBusPanelService       *panel);
105     void     (* hide_auxiliary_text)       (IBusPanelService       *panel);
106     void     (* hide_language_bar)         (IBusPanelService       *panel);
107     void     (* hide_lookup_table)         (IBusPanelService       *panel);
108     void     (* hide_preedit_text)         (IBusPanelService       *panel);
109     void     (* page_down_lookup_table)    (IBusPanelService       *panel);
110     void     (* page_up_lookup_table)      (IBusPanelService       *panel);
111     void     (* reset)                     (IBusPanelService       *panel);
112     void     (* show_auxiliary_text)       (IBusPanelService       *panel);
113     void     (* show_language_bar)         (IBusPanelService       *panel);
114     void     (* show_lookup_table)         (IBusPanelService       *panel);
115     void     (* show_preedit_text)         (IBusPanelService       *panel);
116     void     (* start_setup)               (IBusPanelService       *panel);
117     void     (* state_changed)             (IBusPanelService       *panel);
118     void     (* destroy_context)           (IBusPanelService       *panel,
119                                             const gchar
120                                                    *input_context_path);
121
122     /*< private >*/
123     /* padding */
124     gpointer pdummy[7];  // We can add 8 pointers without breaking the ABI.
125 };
126
127 GType            ibus_panel_service_get_type  (void);
128
129 /**
130  * ibus_panel_service_new:
131  * @connection: An GDBusConnection.
132  * @returns: A newly allocated IBusPanelService.
133  *
134  * New an IBusPanelService from an GDBusConnection.
135  */
136 IBusPanelService *ibus_panel_service_new (GDBusConnection    *connection);
137
138 /**
139  * ibus_panel_service_candidate_clicked:
140  * @panel: An IBusPanelService
141  * @index: Index in the Lookup table
142  * @button: GdkEventButton::button (1: left button, etc.)
143  * @state: GdkEventButton::state (key modifier flags)
144  *
145  * Notify that a candidate is clicked
146  * by sending a "CandidateClicked" to IBus service.
147  */
148 void ibus_panel_service_candidate_clicked (IBusPanelService *panel,
149                                            guint             index,
150                                            guint             button,
151                                            guint             state);
152
153 /**
154  * ibus_panel_service_cursor_down:
155  * @panel: An IBusPanelService
156  *
157  * Notify that the cursor is down
158  * by sending a "CursorDown" to IBus service.
159  */
160 void ibus_panel_service_cursor_down       (IBusPanelService *panel);
161
162 /**
163  * ibus_panel_service_cursor_up:
164  * @panel: An IBusPanelService
165  *
166  * Notify that the cursor is up
167  * by sending a "CursorUp" to IBus service.
168  */
169 void ibus_panel_service_cursor_up         (IBusPanelService *panel);
170
171 /**
172  * ibus_panel_service_page_down:
173  * @panel: An IBusPanelService
174  *
175  * Notify that the page is down
176  * by sending a "PageDown" to IBus service.
177  */
178 void ibus_panel_service_page_down         (IBusPanelService *panel);
179
180 /**
181  * ibus_panel_service_page_up:
182  * @panel: An IBusPanelService
183  *
184  * Notify that the page is up
185  * by sending a "PageUp" to IBus service.
186  */
187 void ibus_panel_service_page_up           (IBusPanelService *panel);
188
189 /**
190  * ibus_panel_service_property_activate:
191  * @panel: An IBusPanelService
192  * @prop_name: A property name
193  * @prop_state: State of the property
194  *
195  * Notify that a property is active
196  * by sending a "PropertyActivate" message to IBus service.
197  */
198 void ibus_panel_service_property_activate (IBusPanelService *panel,
199                                            const gchar      *prop_name,
200                                            guint             prop_state);
201 /**
202  * ibus_panel_service_property_show:
203  * @panel: An IBusPanelService
204  * @prop_name: A property name
205  *
206  * Notify that a property is shown
207  * by sending a "ValueChanged" message to IBus service.
208  */
209 void ibus_panel_service_property_show     (IBusPanelService *panel,
210                                            const gchar      *prop_name);
211
212 /**
213  * ibus_panel_service_property_hide:
214  * @panel: An IBusPanelService
215  * @prop_name: A property name
216  *
217  * Notify that a property is hidden
218  * by sending a "ValueChanged" message to IBus service.
219  */
220 void ibus_panel_service_property_hide     (IBusPanelService *panel,
221                                            const gchar      *prop_name);
222
223
224 G_END_DECLS
225 #endif