-rw-r--r-- | core/launcher/inputmethods.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/launcher/inputmethods.h b/core/launcher/inputmethods.h index 246661a..55ac020 100644 --- a/core/launcher/inputmethods.h +++ b/core/launcher/inputmethods.h | |||
@@ -28,85 +28,86 @@ | |||
28 | #include <qvaluelist.h> | 28 | #include <qvaluelist.h> |
29 | 29 | ||
30 | class QToolButton; | 30 | class QToolButton; |
31 | class QWidgetStack; | 31 | class QWidgetStack; |
32 | 32 | ||
33 | struct InputMethod | 33 | struct InputMethod |
34 | { | 34 | { |
35 | #ifndef QT_NO_COMPONENT | 35 | #ifndef QT_NO_COMPONENT |
36 | QLibrary *library; | 36 | QLibrary *library; |
37 | #endif | 37 | #endif |
38 | QWidget *widget; | 38 | QWidget *widget; |
39 | QString libName; | 39 | QString libName; |
40 | bool newIM; | 40 | bool newIM; |
41 | union { | 41 | union { |
42 | InputMethodInterface *interface; | 42 | InputMethodInterface *interface; |
43 | ExtInputMethodInterface *extInterface; | 43 | ExtInputMethodInterface *extInterface; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | inline void releaseInterface() { | 46 | inline void releaseInterface() { |
47 | newIM ? (void)extInterface->release() : (void)interface->release(); | 47 | newIM ? (void)extInterface->release() : (void)interface->release(); |
48 | library->unload(); | 48 | library->unload(); |
49 | delete library; library = 0l; | 49 | delete library; library = 0l; |
50 | } | 50 | } |
51 | inline QString name() const { return newIM ? extInterface->name() : interface->name(); } | 51 | inline QString name() const { return newIM ? extInterface->name() : interface->name(); } |
52 | inline QPixmap *icon() const { return newIM ? extInterface->icon() : interface->icon(); } | 52 | inline QPixmap *icon() const { return newIM ? extInterface->icon() : interface->icon(); } |
53 | inline QUnknownInterface *iface() { return newIM ? (QUnknownInterface *)extInterface : (QUnknownInterface *)interface; } | 53 | inline QUnknownInterface *iface() { return newIM ? (QUnknownInterface *)extInterface : (QUnknownInterface *)interface; } |
54 | inline void resetState() { if ( !newIM ) interface->resetState(); } | 54 | inline void resetState() { if ( !newIM ) interface->resetState(); } |
55 | 55 | ||
56 | int operator <(const InputMethod& o) const; | 56 | int operator <(const InputMethod& o) const; |
57 | int operator >(const InputMethod& o) const; | 57 | int operator >(const InputMethod& o) const; |
58 | int operator <=(const InputMethod& o) const; | 58 | int operator <=(const InputMethod& o) const; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | class InputMethods : public QWidget | 61 | class InputMethods : public QWidget |
62 | { | 62 | { |
63 | Q_OBJECT | 63 | Q_OBJECT |
64 | public: | 64 | public: |
65 | InputMethods( QWidget * ); | 65 | InputMethods( QWidget * ); |
66 | ~InputMethods(); | 66 | ~InputMethods(); |
67 | 67 | ||
68 | QRect inputRect() const; | 68 | QRect inputRect() const; |
69 | bool shown() const; | 69 | bool shown() const; |
70 | QString currentShown() const; // name of interface | 70 | QString currentShown() const; // name of interface |
71 | void showInputMethod(const QString& id); | 71 | void showInputMethod(const QString& id); |
72 | void showInputMethod(); | 72 | void showInputMethod(); |
73 | void hideInputMethod(); | 73 | void hideInputMethod(); |
74 | void unloadInputMethods(); | 74 | void unloadInputMethods(); |
75 | void loadInputMethods(); | 75 | void loadInputMethods(); |
76 | virtual bool eventFilter( QObject *, QEvent * ); | ||
76 | 77 | ||
77 | signals: | 78 | signals: |
78 | void inputToggled( bool on ); | 79 | void inputToggled( bool on ); |
79 | 80 | ||
80 | private slots: | 81 | private slots: |
81 | void chooseKbd(); | 82 | void chooseKbd(); |
82 | void chooseIm(); | 83 | void chooseIm(); |
83 | void showKbd( bool ); | 84 | void showKbd( bool ); |
84 | void resetStates(); | 85 | void resetStates(); |
85 | void sendKey( ushort unicode, ushort scancode, ushort modifiers, bool, bool ); | 86 | void sendKey( ushort unicode, ushort scancode, ushort modifiers, bool, bool ); |
86 | void qcopReceive( const QCString &msg, const QByteArray &data ); | 87 | void qcopReceive( const QCString &msg, const QByteArray &data ); |
87 | 88 | ||
88 | private: | 89 | private: |
89 | void setPreferedHandlers(); | 90 | void setPreferedHandlers(); |
90 | /*static */QStringList plugins()const; | 91 | /*static */QStringList plugins()const; |
91 | /*static */void installTranslator( const QString& ); | 92 | /*static */void installTranslator( const QString& ); |
92 | void unloadMethod( QValueList<InputMethod>& ); | 93 | void unloadMethod( QValueList<InputMethod>& ); |
93 | void chooseMethod(InputMethod* im); | 94 | void chooseMethod(InputMethod* im); |
94 | void chooseKeyboard(InputMethod* im); | 95 | void chooseKeyboard(InputMethod* im); |
95 | void updateKeyboards(InputMethod *im); | 96 | void updateKeyboards(InputMethod *im); |
96 | 97 | ||
97 | private: | 98 | private: |
98 | QToolButton *kbdButton; | 99 | QToolButton *kbdButton; |
99 | QToolButton *kbdChoice; | 100 | QToolButton *kbdChoice; |
100 | QWidgetStack *imButton; // later will be widget stack | 101 | QWidgetStack *imButton; // later will be widget stack |
101 | QToolButton *imChoice; | 102 | QToolButton *imChoice; |
102 | InputMethod *mkeyboard; | 103 | InputMethod *mkeyboard; |
103 | InputMethod *imethod; | 104 | InputMethod *imethod; |
104 | QValueList<InputMethod> inputMethodList; | 105 | QValueList<InputMethod> inputMethodList; |
105 | QValueList<InputMethod> inputModifierList; | 106 | QValueList<InputMethod> inputModifierList; |
106 | int inputWidgetStyle; | 107 | int inputWidgetStyle; |
107 | int inputWidgetWidth; | 108 | int inputWidgetWidth; |
108 | }; | 109 | }; |
109 | 110 | ||
110 | 111 | ||
111 | #endif // __INPUT_METHODS_H__ | 112 | #endif // __INPUT_METHODS_H__ |
112 | 113 | ||