From c59c8ddf1f98938441925e01d9931c3c1eb3f5cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 25 Nov 2014 15:08:04 +0100 Subject: iOS: Refactor QIOSKeyboardListener implementation and usage QIOSKeyboardListener takes care of both maintaining the virtual keyboard state, and acting as a gesture recognizer for the hide keyboard gesture. We make this explicit though a union in QIOSInputContext, so that we can access each 'mode' separately. This improved code readability and allows later refactoring of the state and gesture into separate classes without changing the call sites. Change-Id: Icc60f4a542983cda7ca0fd6622963d32d1e90db9 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosinputcontext.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/ios/qiosinputcontext.h') diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h index b4ff695f1a..174c44751c 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.h +++ b/src/plugins/platforms/ios/qiosinputcontext.h @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE @class QIOSKeyboardListener; @class QIOSTextInputResponder; +@protocol KeyboardState; struct ImeState { @@ -90,7 +91,10 @@ public: static QIOSInputContext *instance(); private: - QIOSKeyboardListener *m_keyboardListener; + union { + QIOSKeyboardListener *m_keyboardHideGesture; + id m_keyboardState; + }; QIOSTextInputResponder *m_textResponder; ImeState m_imeState; }; -- cgit v1.2.3