1 /* vim:set noet ts=4: */
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 #ifndef __IBUS_INPUT_CONTEXT_H_
23 #define __IBUS_INPUT_CONTEXT_H_
24 #include <QInputContext>
26 #include "ibus-client.h"
30 class IBusInputContext
: public QInputContext
{
33 IBusInputContext (QObject
*parent
, IBusClient
*client
, QString
&ic
);
37 bool filterEvent (const QEvent
*event
);
39 QString
identifierName ();
40 bool isComposing() const;
42 void mouseHandler (int x
, QMouseEvent
*event
);
45 void setFocusWidget (QWidget
*widget
);
46 void widgetDestroyed (QWidget
*widget
);
48 bool x11FilterEvent (QWidget
*keywidget
, XEvent
*event
);
50 void setIC (QString ic
);
53 void commitString (QString text
);
54 void updatePreedit (QString text
, QList
<QList
<quint32
> > attr_list
, int cursor_pos
, bool show
);
60 QString preedit_string
;
62 int preedit_cursor_pos
;
63 QRect cursor_location
;
66 #endif //__IBUS_INPUT_CONTEXT_H_