Fix make rpm errors due to ibus-dconf and pygobject override
[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, 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 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
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, 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            *input_context_path);
80     void     (* focus_out)                 (IBusPanelService       *panel,
81                                             const gchar            *input_context_path);
82     void     (* register_properties)       (IBusPanelService       *panel,
83                                             IBusPropList           *prop_list);
84     void     (* set_cursor_location)       (IBusPanelService       *panel,
85                                             gint                    x,
86                                             gint                    y,
87                                             gint                    w,
88                                             gint                    h);
89     void     (* update_auxiliary_text)     (IBusPanelService       *panel,
90                                             IBusText               *text,
91                                             gboolean                visible);
92     void     (* update_lookup_table)       (IBusPanelService       *panel,
93                                             IBusLookupTable        *lookup_table,
94                                             gboolean                visible);
95     void     (* update_preedit_text)       (IBusPanelService       *panel,
96                                             IBusText              *text,
97                                             guint                  cursor_pos,
98                                             gboolean               visible);
99     void     (* update_property)           (IBusPanelService       *panel,
100                                             IBusProperty           *prop);
101     void     (* cursor_down_lookup_table)  (IBusPanelService       *panel);
102     void     (* cursor_up_lookup_table)    (IBusPanelService       *panel);
103     void     (* hide_auxiliary_text)       (IBusPanelService       *panel);
104     void     (* hide_language_bar)         (IBusPanelService       *panel);
105     void     (* hide_lookup_table)         (IBusPanelService       *panel);
106     void     (* hide_preedit_text)         (IBusPanelService       *panel);
107     void     (* page_down_lookup_table)    (IBusPanelService       *panel);
108     void     (* page_up_lookup_table)      (IBusPanelService       *panel);
109     void     (* reset)                     (IBusPanelService       *panel);
110     void     (* show_auxiliary_text)       (IBusPanelService       *panel);
111     void     (* show_language_bar)         (IBusPanelService       *panel);
112     void     (* show_lookup_table)         (IBusPanelService       *panel);
113     void     (* show_preedit_text)         (IBusPanelService       *panel);
114     void     (* start_setup)               (IBusPanelService       *panel);
115     void     (* state_changed)             (IBusPanelService       *panel);
116
117     /*< private >*/
118     /* padding */
119     gpointer pdummy[8];  // We can add 8 pointers without breaking the ABI.
120 };
121
122 GType            ibus_panel_service_get_type  (void);
123
124 /**
125  * ibus_panel_service_new:
126  * @connection: An GDBusConnection.
127  * @returns: A newly allocated IBusPanelService.
128  *
129  * New an IBusPanelService from an GDBusConnection.
130  */
131 IBusPanelService *ibus_panel_service_new (GDBusConnection    *connection);
132
133 /**
134  * ibus_panel_service_candidate_clicked:
135  * @panel: An IBusPanelService
136  * @index: Index in the Lookup table
137  * @button: GdkEventButton::button (1: left button, etc.)
138  * @state: GdkEventButton::state (key modifier flags)
139  *
140  * Notify that a candidate is clicked
141  * by sending a "CandidateClicked" to IBus service.
142  */
143 void ibus_panel_service_candidate_clicked (IBusPanelService *panel,
144                                            guint             index,
145                                            guint             button,
146                                            guint             state);
147
148 /**
149  * ibus_panel_service_cursor_down:
150  * @panel: An IBusPanelService
151  *
152  * Notify that the cursor is down
153  * by sending a "CursorDown" to IBus service.
154  */
155 void ibus_panel_service_cursor_down       (IBusPanelService *panel);
156
157 /**
158  * ibus_panel_service_cursor_up:
159  * @panel: An IBusPanelService
160  *
161  * Notify that the cursor is up
162  * by sending a "CursorUp" to IBus service.
163  */
164 void ibus_panel_service_cursor_up         (IBusPanelService *panel);
165
166 /**
167  * ibus_panel_service_page_down:
168  * @panel: An IBusPanelService
169  *
170  * Notify that the page is down
171  * by sending a "PageDown" to IBus service.
172  */
173 void ibus_panel_service_page_down         (IBusPanelService *panel);
174
175 /**
176  * ibus_panel_service_page_up:
177  * @panel: An IBusPanelService
178  *
179  * Notify that the page is up
180  * by sending a "PageUp" to IBus service.
181  */
182 void ibus_panel_service_page_up           (IBusPanelService *panel);
183
184 /**
185  * ibus_panel_service_property_activate:
186  * @panel: An IBusPanelService
187  * @prop_name: A property name
188  * @prop_state: State of the property
189  *
190  * Notify that a property is active
191  * by sending a "PropertyActivate" message to IBus service.
192  */
193 void ibus_panel_service_property_activate (IBusPanelService *panel,
194                                            const gchar      *prop_name,
195                                            guint             prop_state);
196 /**
197  * ibus_panel_service_property_show:
198  * @panel: An IBusPanelService
199  * @prop_name: A property name
200  *
201  * Notify that a property is shown
202  * by sending a "ValueChanged" message to IBus service.
203  */
204 void ibus_panel_service_property_show     (IBusPanelService *panel,
205                                            const gchar      *prop_name);
206
207 /**
208  * ibus_panel_service_property_hide:
209  * @panel: An IBusPanelService
210  * @prop_name: A property name
211  *
212  * Notify that a property is hidden
213  * by sending a "ValueChanged" message to IBus service.
214  */
215 void ibus_panel_service_property_hide     (IBusPanelService *panel,
216                                            const gchar      *prop_name);
217
218
219 G_END_DECLS
220 #endif