Position the popup menu.
[ibus.git] / qt4 / ibus-input-context.h
blob6aac46bfecb23927a44a972a7b41b2abd76a0c6e
1 /* vim:set noet ts=4: */
2 /*
3 * ibus - The Input Bus
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>
25 #include <QList>
26 #include "ibus-client.h"
28 class IBusClient;
30 class IBusInputContext : public QInputContext {
31 Q_OBJECT
32 public:
33 IBusInputContext (QObject *parent, IBusClient *client, QString &ic);
34 ~IBusInputContext ();
36 public:
37 bool filterEvent (const QEvent *event);
38 QFont font () const;
39 QString identifierName ();
40 bool isComposing() const;
41 QString language();
42 void mouseHandler (int x, QMouseEvent *event);
43 void reset();
44 void update ();
45 void setFocusWidget (QWidget *widget );
46 void widgetDestroyed (QWidget *widget);
47 #ifdef Q_WS_X11
48 bool x11FilterEvent (QWidget *keywidget, XEvent *event);
49 #endif
50 void setIC (QString ic);
51 QString getIC ();
53 void commitString (QString text);
54 void updatePreedit (QString text, QList <QList <quint32> > attr_list, int cursor_pos, bool show);
57 private:
58 IBusClient *client;
59 QString ic;
60 QString preedit_string;
61 bool preedit_visible;
62 int preedit_cursor_pos;
63 QRect cursor_location;
66 #endif //__IBUS_INPUT_CONTEXT_H_