Combined platform input contexts in tests into one shared
[profile/ivi/qtdeclarative.git] / tests / auto / qtquick1 / qdeclarativetextinput / tst_qdeclarativetextinput.cpp
index aaee4ec..f13cbf4 100644 (file)
@@ -51,6 +51,7 @@
 #include <QtCore/qmath.h>
 #include <private/qapplication_p.h>
 #include <private/qinputpanel_p.h>
+#include "../../shared/platforminputcontext.h"
 
 #include "qplatformdefs.h"
 
@@ -82,60 +83,6 @@ void sendPreeditText(const QString &text, int cursor)
 }
 
 
-class PlatformInputContext : public QPlatformInputContext
-{
-public:
-    PlatformInputContext()
-        : m_visible(false), m_action(QInputPanel::Click), m_cursorPosition(0),
-          m_invokeActionCallCount(0), m_showInputPanelCallCount(0), m_hideInputPanelCallCount(0),
-          m_updateCallCount(0)
-    {
-    }
-
-    virtual void showInputPanel()
-    {
-        m_visible = true;
-        m_showInputPanelCallCount++;
-    }
-    virtual void hideInputPanel()
-    {
-        m_visible = false;
-        m_hideInputPanelCallCount++;
-    }
-    virtual bool isInputPanelVisible() const
-    {
-        return m_visible;
-    }
-    virtual void invokeAction(QInputPanel::Action action, int cursorPosition)
-    {
-        m_invokeActionCallCount++;
-        m_action = action;
-        m_cursorPosition = cursorPosition;
-    }
-    virtual void update(Qt::InputMethodQueries)
-    {
-        m_updateCallCount++;
-    }
-
-    void clear() {
-        m_cursorPosition = 0;
-        m_invokeActionCallCount = 0;
-        m_visible = false;
-        m_showInputPanelCallCount = 0;
-        m_hideInputPanelCallCount = 0;
-        m_updateCallCount = 0;
-    }
-
-    bool m_visible;
-    QInputPanel::Action m_action;
-    int m_cursorPosition;
-    int m_invokeActionCallCount;
-    int m_showInputPanelCallCount;
-    int m_hideInputPanelCallCount;
-    int m_updateCallCount;
-};
-
-
 class tst_qdeclarativetextinput : public QObject
 
 {