123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #ifndef FREEVIRTUALKEYBOARDINPUTCONTEXT_H
- #define FREEVIRTUALKEYBOARDINPUTCONTEXT_H
- //============================================================================
- // INCLUDES
- //============================================================================
- #include <QRectF>
- #include <qpa/qplatforminputcontext.h>
- //============================================================================
- // FORWARD DECLARATIONS
- //============================================================================
- class QQmlEngine;
- class QJSEngine;
- class FreeVirtualKeyboardInputContextPrivate;
- /**
- * Implementation of QPlatformInputContext
- */
- class FreeVirtualKeyboardInputContext : public QPlatformInputContext
- {
- Q_OBJECT
- private:
- /**
- * The input contet creates the InputEngine object and provides it
- * as a singleton to the QML context
- */
- static QObject* inputEngineProvider(QQmlEngine *engine, QJSEngine *scriptEngine);
- protected:
- /**
- * Protected constructor - use instance function to get the one and only
- * object
- */
- FreeVirtualKeyboardInputContext();
- public:
- /**
- * Virtual destructor
- */
- virtual ~FreeVirtualKeyboardInputContext();
- /**
- * Returns input context validity. Deriving implementations should
- * return true - so we simply return true
- */
- virtual bool isValid() const;
- /**
- * This function can be reimplemented to return virtual keyboard rectangle
- * in currently active window coordinates. Default implementation returns
- * invalid rectangle.
- */
- virtual QRectF keyboardRect() const;
- /**
- * Simply calls the emitInputPanelVisibleChanged() function
- */
- virtual void showInputPanel();
- /**
- * Simply calls the emitInputPanelVisibleChanged() function
- */
- virtual void hideInputPanel();
- /**
- * Returns input panel visibility status.
- * This value will be available in QGuiApplication::inputMethod()->isVisible()
- */
- virtual bool isInputPanelVisible() const;
- /**
- * This function returns true whenever input method is animating
- * shown or hidden.
- */
- virtual bool isAnimating() const;
- /**
- * This virtual method gets called to notify updated focus to object.
- * \warning Input methods must not call this function directly.
- * This function does the main work. It sets the input mode of the
- * InputEngine singleton and it ensures that the focused QML object is
- * visible if it is a child item of a Flickable
- */
- virtual void setFocusObject(QObject *object);
- /**
- * Use this static instance function to access the singleton input context
- * instance
- */
- static FreeVirtualKeyboardInputContext* instance();
- private:
- FreeVirtualKeyboardInputContextPrivate *d;
- private slots:
- /**
- * This function scrolls the QML item into visible area if the focused
- * QML item is child of a flickable
- */
- void ensureFocusedObjectVisible();
- }; // FreeVirtualKeyboardInputContext
- //------------------------------------------------------------------------------
- #endif // FREEVIRTUALKEYBOARDINPUTCONTEXT_H
|