diff options
author | Antti Hölttä <AHoelttae@luxoft.com> | 2018-11-06 15:39:36 +0100 |
---|---|---|
committer | Antti Hölttä <AHoelttae@luxoft.com> | 2019-03-18 16:31:43 +0100 |
commit | fbe75056a6ca179504b33c74d741c540f5b22dcd (patch) | |
tree | c535cd55d285b8e2e6b9a450a88a8e316e5ba12f /plugin/cursornavigation.h | |
parent | 00fa5d9215d32124292fe3e45372acebac7b9d31 (diff) |
More on scopes, works to some extent in the test program
Scope may be entered and escaped. Navigable items may have escape targets
defined
Diffstat (limited to 'plugin/cursornavigation.h')
-rw-r--r-- | plugin/cursornavigation.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugin/cursornavigation.h b/plugin/cursornavigation.h index 7e61ee9..12468e4 100644 --- a/plugin/cursornavigation.h +++ b/plugin/cursornavigation.h @@ -2,12 +2,12 @@ #define CURSORNAVIGATION_H #include "cursornavigationattached.h" -#include "itemregister.h" #include "inputtypes.h" #include "inputadapter.h" #include <QObject> #include <qqml.h> +#include <QStack> class QQuickItem; class CursorNavigationAlgorithm; @@ -19,7 +19,9 @@ class CursorNavigation : public QObject public: CursorNavigation(QQuickWindow *parent); - bool inputCommand(CursorNavigationCommand cmd); + bool inputCommand(const CursorNavigationCommand &cmd); + void move(QVector2D moveVector); + void action(); static CursorNavigationAttached *qmlAttachedProperties(QObject *object); @@ -33,6 +35,9 @@ private: void registerItem(CursorNavigationAttached* item); void unregisterItem(CursorNavigationAttached* item); + bool handleDirectionCommand(const CursorNavigationCommand &cmd); + bool handleActionCommand(const CursorNavigationCommand &cmd); + private: static const char windowPropertyName[]; QQuickWindow *m_window; @@ -40,7 +45,8 @@ private: CursorNavigationAttached *m_currentItem; //item that currently has the cursor QList<CursorNavigationAlgorithm*> m_algorithms; //a root item that is not tied to any actual QQuickItem - CursorNavigationAttached m_rootItem; + CursorNavigationAttached *m_rootItem; + QStack<CursorNavigationAttached*> m_scopeStack; friend class CursorNavigationAttached; }; |