5 # Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program; if not, write to the
19 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 # Boston, MA 02111-1307 USA
22 __all__
= ("IEngine", )
25 from ibus
.common
import \
28 class IEngine (dbus
.service
.Object
):
29 # define method decorator.
30 method
= lambda **args
: \
31 dbus
.service
.method (dbus_interface
= IBUS_ENGINE_IFACE
, \
34 # define signal decorator.
35 signal
= lambda **args
: \
36 dbus
.service
.signal (dbus_interface
= IBUS_ENGINE_IFACE
, \
39 # define async method decorator.
40 async_method
= lambda **args
: \
41 dbus
.service
.method (dbus_interface
= IBUS_ENGINE_IFACE
, \
42 async_callbacks
= ("reply_cb", "error_cb"), \
45 @method (in_signature
= "ubu", out_signature
= "b")
46 def ProcessKeyEvent (self
, keyval
, is_press
, state
):
49 @method (in_signature
= "iiii")
50 def SetCursorLocation (self
, x
, y
, w
, h
): pass
53 def FocusIn (self
): pass
56 def FocusOut (self
): pass
59 def Reset (self
): pass
61 # signals for lookup table
63 def PageUp (self
): pass
66 def PageDown (self
): pass
69 def CursorUp (self
): pass
72 def CursorDown (self
): pass
74 @method (in_signature
= "b")
75 def SetEnable (self
, enable
): pass
77 @method (in_signature
= "si")
78 def PropertyActivate (self
, prop_name
, prop_state
): pass
80 @method (in_signature
= "s")
81 def PropertyShow (self
, prop_name
): pass
83 @method (in_signature
= "s")
84 def PropertyHide (self
, prop_name
): pass
87 def Destroy (self
): pass
89 @signal (signature
="s")
90 def CommitString (self
, text
): pass
92 @signal (signature
="ubu")
93 def ForwardKeyEvent (self
, keyval
, is_press
, state
): pass
95 @signal (signature
="saauib")
96 def UpdatePreedit (self
, text
, attrs
, cursor_pos
, visible
): pass
98 @signal (signature
="svb")
99 def UpdateAuxString (self
, text
, attrs
, visible
): pass
101 @signal (signature
="vb")
102 def UpdateLookupTable (self
, lookup_table
, visible
): pass
104 @signal (signature
="v")
105 def RegisterProperties (self
, props
): pass
107 @signal (signature
="v")
108 def UpdateProperty (self
, prop
): pass