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 <qibusinputcontext.h>
30
class IBusInputContext : public QInputContext {
33
IBusInputContext (const BusPointer &bus);
37
bool filterEvent (const QEvent *event);
38
QFont font (void) const;
39
QString identifierName (void);
40
bool isComposing (void) const;
41
QString language (void);
42
void mouseHandler (int x, QMouseEvent *event);
45
void setFocusWidget (QWidget *widget );
46
void widgetDestroyed (QWidget *widget);
48
bool x11FilterEvent (QWidget *keywidget, XEvent *event);
51
void slotCommitText (const TextPointer &text);
52
void slotUpdatePreeditText (const TextPointer &text, uint cursor_pos, bool visible);
53
void slotShowPreeditText (void);
54
void slotHidePreeditText (void);
55
void slotConnected (void);
56
void slotDisconnected (void);
59
void createInputContext (void);
60
void deleteInputContext (void);
61
void displayPreeditText (const TextPointer &text, uint cursor_pos, bool visible);
65
InputContextPointer m_context;
66
TextPointer m_preedit;
67
bool m_preedit_visible;
68
uint m_preedit_cursor_pos;
73
#endif //__IBUS_INPUT_CONTEXT_H_