diff options
Diffstat (limited to 'plugin/cursornavigation.h')
-rw-r--r-- | plugin/cursornavigation.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/plugin/cursornavigation.h b/plugin/cursornavigation.h new file mode 100644 index 0000000..a9309fb --- /dev/null +++ b/plugin/cursornavigation.h @@ -0,0 +1,45 @@ +#ifndef CURSORNAVIGATION_H +#define CURSORNAVIGATION_H + +#include "cursornavigationattached.h" +#include "itemregister.h" +#include "inputtypes.h" +#include "inputadapter.h" + +#include <QObject> +#include <qqml.h> + +class QQuickItem; +class CursorNavigationAlgorithm; + +class CursorNavigation : public QObject +{ + Q_OBJECT + +public: + CursorNavigation(QQuickWindow *parent); + + bool inputCommand(CursorNavigationCommand cmd); + + static CursorNavigationAttached *qmlAttachedProperties(QObject *object); + + static CursorNavigation *cursorNavigationForWindow(QQuickWindow *window); + +private: + void setCursorOnItem(QQuickItem *item); + static CursorNavigationAttached *cursorNavigationAttachment(QQuickItem *item); + +private: + static const char windowPropertyName[]; + InputAdapter m_inputAdapter; + QQuickItem *m_currentItem; //item that currently has the cursor + QList<CursorNavigationAlgorithm*> m_algorithms; + ItemRegister m_itemRegister; + + + friend class CursorNavigationAttached; +}; + +QML_DECLARE_TYPEINFO(CursorNavigation, QML_HAS_ATTACHED_PROPERTIES) + +#endif // CURSORNAVIGATION_H |