00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef INPUTCONTEXT_H
00022 #define INPUTCONTEXT_H
00023
00024 #include <QWidget>
00025 typedef struct _XIMS *XIMS;
00026
00027 class InputContext : public QObject
00028 {
00029 Q_OBJECT
00030 Q_DISABLE_COPY(InputContext)
00031 Q_PROPERTY(quint16 connectId READ connectId WRITE setConnectId)
00032 Q_PROPERTY(qint32 inputStyle READ inputStyle WRITE setInputStyle)
00033 Q_PROPERTY(unsigned long clientWindow READ clientWindow WRITE setClientWindow)
00034 Q_PROPERTY(unsigned long focusWindow READ focusWindow WRITE setFocusWindow)
00035 Q_PROPERTY(QRect area READ area WRITE setArea)
00036 Q_PROPERTY(QRect areaNeeded READ areaNeeded WRITE setAreaNeeded)
00037 Q_PROPERTY(QPoint spotLocation READ spotLocation WRITE setSpotLocation)
00038 Q_PROPERTY(unsigned long colorMap READ colorMap WRITE setColorMap)
00039 Q_PROPERTY(unsigned long stdColorMap READ stdColorMap WRITE setStdColorMap)
00040 Q_PROPERTY(unsigned long foreground READ foreground WRITE setForeground)
00041 Q_PROPERTY(unsigned long background READ background WRITE setBackground)
00042 Q_PROPERTY(unsigned long backgroundPixmap READ backgroundPixmap WRITE setBackgroundPixmap)
00043 Q_PROPERTY(QString fontSet READ fontSet WRITE setFontSet)
00044 Q_PROPERTY(unsigned long lineSpace READ lineSpace WRITE setLineSpace)
00045 Q_PROPERTY(unsigned long cursor READ cursor WRITE setCursor)
00046 Q_PROPERTY(bool hasFocus READ hasFocus WRITE setFocus)
00047
00048 public:
00049 explicit InputContext(XIMS xims, QObject *parent = 0);
00050 ~InputContext();
00051
00052 void sendCommitString(const QString &commitString);
00053 void sendPreeditString(const QString &preeditString, int cursorPosition, int selectionLength = 0);
00054
00055 unsigned long id() const;
00056 quint16 connectId() const;
00057 void setConnectId(quint16 connectId);
00058
00059 qint32 inputStyle() const;
00060 void setInputStyle(qint32 inputStyle);
00061
00062 unsigned long clientWindow() const;
00063 void setClientWindow(unsigned long clientWindow);
00064
00065 unsigned long focusWindow() const;
00066 void setFocusWindow(unsigned long focusWindow);
00067
00068 QRect area() const;
00069 void setArea(const QRect &area);
00070
00071 QRect areaNeeded() const;
00072 void setAreaNeeded(const QRect &areaNeeded);
00073
00074 const QPoint &spotLocation() const;
00075 void setSpotLocation(const QPoint &spotLocation);
00076
00077 unsigned long colorMap() const;
00078 void setColorMap(unsigned long colorMap);
00079
00080 unsigned long stdColorMap() const;
00081 void setStdColorMap(unsigned long stdColorMap);
00082
00083 unsigned long foreground() const;
00084 void setForeground(unsigned long foreground);
00085
00086 unsigned long background() const;
00087 void setBackground(unsigned long background);
00088
00089 unsigned long backgroundPixmap() const;
00090 void setBackgroundPixmap(unsigned long backgroundPixmap);
00091
00092 const QString &fontSet() const;
00093 void setFontSet(const QString &fontSet);
00094
00095 unsigned long lineSpace() const;
00096 void setLineSpace(unsigned long lineSpace);
00097
00098 unsigned long cursor() const;
00099 void setCursor(unsigned long cursor);
00100
00101 bool hasFocus() const;
00102 void setFocus(bool focus);
00103
00104 Qt::KeyboardModifiers modifiers() const;
00105 void setModifiers(Qt::KeyboardModifiers modifiers);
00106 void setModifier(Qt::KeyboardModifier modifier, bool on);
00107
00108 void reset();
00109
00110 private:
00111 class Private;
00112 Private *d;
00113 };
00114
00115 #endif // INPUTCONTEXT_H