00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef QINPUTCONTEXT_P_H
00037 #define QINPUTCONTEXT_P_H
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #include <qglobal.h>
00053
00054 class QKeyEvent;
00055 class QWidget;
00056 class QFont;
00057 class QString;
00058
00059
00060 #ifdef Q_WS_X11
00061 #include "qarray.h"
00062 #include "qwindowdefs.h"
00063 #include "qt_x11.h"
00064 #endif
00065
00066 #ifdef Q_WS_WIN
00067 #include <qt_windows.h>
00068 #endif
00069
00070 #ifdef Q_WS_QWS
00071 class QWSIMEvent;
00072 #endif
00073
00074 class QInputContext
00075 {
00076 public:
00077 #ifdef Q_WS_X11
00078 QInputContext(QWidget *);
00079 ~QInputContext();
00080
00081 void setFocus();
00082 void setComposePosition(int, int);
00083 void setComposeArea(int, int, int, int);
00084 void reset();
00085
00086 int lookupString(XKeyEvent *, QCString &, KeySym *, Status *) const;
00087 void setXFontSet(const QFont &);
00088
00089 void *ic;
00090 QString text;
00091 QWidget *focusWidget;
00092 bool composing;
00093 QFont font;
00094 XFontSet fontset;
00095 QMemArray<bool> selectedChars;
00096 #endif // Q_WS_X11
00097
00098 #ifdef Q_WS_QWS
00099 static void translateIMEvent( QWSIMEvent *, QWidget * );
00100 static void reset();
00101 private:
00102 static QWidget* focusWidget;
00103 static QString* composition;
00104 #endif //Q_WS_QWS
00105
00106 #ifdef Q_WS_WIN
00107 static void init();
00108 static void shutdown();
00109
00110 static void TranslateMessage( const MSG *msg);
00111 static LRESULT DefWindowProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
00112
00113 static void setFont( const QWidget *w, const QFont & );
00114 static void setFocusHint( int x, int y, int w, int h, const QWidget *widget );
00115 static bool startComposition();
00116 static bool endComposition( QWidget *fw = 0 );
00117 static bool composition( LPARAM lparam );
00118
00119 static void accept( QWidget *fw = 0 );
00120 static void enable( bool );
00121 #endif
00122 };
00123
00124 #endif // QINPUTCONTEXT_P_H