20 ** |
20 ** |
21 ** If you have questions regarding the use of this file, please contact |
21 ** If you have questions regarding the use of this file, please contact |
22 ** Nokia at developer.feedback@nokia.com. |
22 ** Nokia at developer.feedback@nokia.com. |
23 ** |
23 ** |
24 ****************************************************************************/ |
24 ****************************************************************************/ |
|
25 #include "hbinputvkbhostbridge.h" |
|
26 |
25 #include <QVariant> |
27 #include <QVariant> |
26 #include <QPointer> |
28 #include <QPointer> |
27 |
|
28 #include "hbinputvkbhostbridge.h" |
|
29 |
29 |
30 /*! |
30 /*! |
31 \proto |
31 \proto |
32 \class HbVkbHostBridge |
32 \class HbVkbHostBridge |
33 \brief Provides one connection point to receive signals from all the virtual keyboard hosts. |
33 \brief Provides one connection point to receive signals from all the virtual keyboard hosts. |
73 } |
73 } |
74 |
74 |
75 /*! |
75 /*! |
76 \reimp |
76 \reimp |
77 */ |
77 */ |
78 void HbVkbHostBridge::openKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner, bool animationAllowed) |
78 void HbVkbHostBridge::openKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner, bool animationAllowed) |
79 { |
79 { |
80 Q_D(HbVkbHostBridge); |
80 Q_D(HbVkbHostBridge); |
81 if (d->mActiveHost) { |
81 if (d->mActiveHost) { |
82 d->mActiveHost->openKeypad(vkb, owner, animationAllowed); |
82 d->mActiveHost->openKeypad(vkb, owner, animationAllowed); |
83 } |
83 } |
84 } |
84 } |
85 |
85 |
86 /*! |
86 /*! |
87 \reimp |
87 \reimp |
88 */ |
88 */ |
89 void HbVkbHostBridge::openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner) |
89 void HbVkbHostBridge::openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner) |
90 { |
90 { |
91 Q_D(HbVkbHostBridge); |
91 Q_D(HbVkbHostBridge); |
92 if (d->mActiveHost) { |
92 if (d->mActiveHost) { |
93 d->mActiveHost->openMinimizedKeypad(vkb, owner); |
93 d->mActiveHost->openMinimizedKeypad(vkb, owner); |
94 } |
94 } |
201 */ |
201 */ |
202 bool HbVkbHostBridge::connectHost(HbVkbHost *host) |
202 bool HbVkbHostBridge::connectHost(HbVkbHost *host) |
203 { |
203 { |
204 Q_D(HbVkbHostBridge); |
204 Q_D(HbVkbHostBridge); |
205 |
205 |
206 if (d->mActiveHost && d->mActiveHost->stateTransitionOngoing()) { |
206 if (d->mActiveHost && d->mActiveHost->stateTransitionOngoing()) { |
207 return false; |
207 return false; |
208 } |
208 } |
209 |
209 |
210 if (d->mActiveHost != host) { |
210 if (d->mActiveHost != host) { |
211 if (d->mActiveHost) { |
211 if (d->mActiveHost) { |
212 // Closing the previous vkb hosts keypad so that if necessary can be launched again for that same vkb host. |
212 // Closing the previous vkb hosts keypad so that if necessary can be launched again for that same vkb host. |
213 d->mActiveHost->closeKeypad(false); |
213 d->mActiveHost->closeKeypad(false); |
214 disconnect(d->mActiveHost, SIGNAL(aboutToOpen()), this, SIGNAL(aboutToOpen())); |
214 disconnect(d->mActiveHost, SIGNAL(aboutToOpen()), this, SIGNAL(aboutToOpen())); |
215 disconnect(d->mActiveHost, SIGNAL(aboutToClose()), this, SIGNAL(aboutToClose())); |
215 disconnect(d->mActiveHost, SIGNAL(aboutToClose()), this, SIGNAL(aboutToClose())); |
216 disconnect(d->mActiveHost, SIGNAL(keypadOpened()), this, SIGNAL(keypadOpened())); |
216 disconnect(d->mActiveHost, SIGNAL(keypadOpened()), this, SIGNAL(keypadOpened())); |
217 disconnect(d->mActiveHost, SIGNAL(keypadClosed()), this, SIGNAL(keypadClosed())); |
217 disconnect(d->mActiveHost, SIGNAL(keypadClosed()), this, SIGNAL(keypadClosed())); |
218 disconnect(d->mActiveHost, SIGNAL(keypadOpened()), this, SIGNAL(stateTransitionCompleted())); |
218 disconnect(d->mActiveHost, SIGNAL(keypadOpened()), this, SIGNAL(stateTransitionCompleted())); |
219 disconnect(d->mActiveHost, SIGNAL(keypadClosed()), this, SIGNAL(stateTransitionCompleted())); |
219 disconnect(d->mActiveHost, SIGNAL(keypadClosed()), this, SIGNAL(stateTransitionCompleted())); |
220 } |
220 } |
221 |
221 |
222 d->mActiveHost = host; |
222 d->mActiveHost = host; |
223 if (d->mActiveHost) { |
223 if (d->mActiveHost) { |
224 connect(d->mActiveHost, SIGNAL(aboutToOpen()), this, SIGNAL(aboutToOpen())); |
224 connect(d->mActiveHost, SIGNAL(aboutToOpen()), this, SIGNAL(aboutToOpen())); |
225 connect(d->mActiveHost, SIGNAL(aboutToClose()), this, SIGNAL(aboutToClose())); |
225 connect(d->mActiveHost, SIGNAL(aboutToClose()), this, SIGNAL(aboutToClose())); |