Qt 4.8
qximinputcontext_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 /****************************************************************************
43 **
44 ** Definition of QXIMInputContext class
45 **
46 ** Copyright (C) 2003-2004 immodule for Qt Project. All rights reserved.
47 **
48 ** This file is written to contribute to Nokia Corporation and/or its subsidiary(-ies) under their own
49 ** license. You may use this file under your Qt license. Following
50 ** description is copied from their original file headers. Contact
51 ** immodule-qt@freedesktop.org if any conditions of this licensing are
52 ** not clear to you.
53 **
54 ****************************************************************************/
55 
56 #ifndef QXIMINPUTCONTEXT_P_H
57 #define QXIMINPUTCONTEXT_P_H
58 
59 //
60 // W A R N I N G
61 // -------------
62 //
63 // This file is not part of the Qt API. It exists purely as an
64 // implementation detail. This header file may change from version to
65 // version without notice, or even be removed.
66 //
67 // We mean it.
68 //
69 #include <qconfig.h>
70 #ifndef QT_NO_IM
71 
72 #include "QtCore/qglobal.h"
73 #include "QtGui/qinputcontext.h"
74 #include "QtGui/qfont.h"
75 #include "QtCore/qhash.h"
76 #ifdef Q_WS_X11
77 #include "QtCore/qlist.h"
78 #include "QtCore/qbitarray.h"
79 #include "QtGui/qwindowdefs.h"
80 #include "private/qt_x11_p.h"
81 #endif
82 
84 
85 class QKeyEvent;
86 class QWidget;
87 class QFont;
88 class QString;
89 
91 {
92  Q_OBJECT
93 public:
94  struct ICData {
95  XIC ic;
96  XFontSet fontset;
100  bool composing;
102  void clear();
103  };
104 
107 
109  QString language();
110 
111  void reset();
112 
113  void mouseHandler( int x, QMouseEvent *event);
114  bool isComposing() const;
115 
116  void setFocusWidget( QWidget *w );
117  void widgetDestroyed(QWidget *w);
118 
119  void create_xim();
120  void close_xim();
121 
122  void update();
123 
124  ICData *icData() const;
125 protected:
126  bool x11FilterEvent( QWidget *keywidget, XEvent *event );
127 
128 private:
129  static XIMStyle xim_style;
130 
132  XIM xim;
134 
136 };
137 
139 
140 #endif // Q_NO_IM
141 
142 #endif // QXIMINPUTCONTEXT_P_H
The QKeyEvent class describes a key event.
Definition: qevent.h:224
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
void reset()
This function can be reimplemented in a subclass to reset the state of the input method.
void mouseHandler(int x, QMouseEvent *event)
This function can be reimplemented in a subclass to handle mouse press, release, double-click, and move events within the preedit text.
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
union _XEvent XEvent
Definition: qwindowdefs.h:116
bool x11FilterEvent(QWidget *keywidget, XEvent *event)
This function may be overridden only if input method is depending on X11 and you need raw XEvent...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QString language()
This function must be implemented in any subclasses to return a language code (e. ...
void widgetDestroyed(QWidget *w)
This virtual function is called when the specified widget is destroyed.
ICData * createICData(QWidget *w)
#define Q_OBJECT
Definition: qobjectdefs.h:157
bool isComposing() const
This function indicates whether InputMethodStart event had been sent to the current focus widget...
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
The QBitArray class provides an array of bits.
Definition: qbitarray.h:54
QHash< WId, ICData * > ximData
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
void setFocusWidget(QWidget *w)
Sets the widget that has an input focus for this input context.
The QInputContext class abstracts the input method dependent data and composing state.
Definition: qinputcontext.h:83
QString identifierName()
This function must be implemented in any subclasses to return the identifier name of the input method...
void update()
This virtual function is called when a state in the focus widget has changed.
static XIMStyle xim_style
ICData * icData() const