diff options
Diffstat (limited to 'plugin/cursornavigationattached.h')
-rw-r--r-- | plugin/cursornavigationattached.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/plugin/cursornavigationattached.h b/plugin/cursornavigationattached.h index a005d7c..25a6769 100644 --- a/plugin/cursornavigationattached.h +++ b/plugin/cursornavigationattached.h @@ -49,10 +49,13 @@ class CursorNavigation; class QQuickItem; class QQuickWindow; +class QVector2D; class CursorNavigationAttached : public QObject { Q_OBJECT + //is used to add offsets to any directional movement of the cursor navigation + Q_PROPERTY(double angleOffset READ angleOffset WRITE setAngleOffset NOTIFY angleOffsetChanged) //is included for cursor navigation Q_PROPERTY(bool acceptsCursor READ acceptsCursor WRITE setAcceptsCursor NOTIFY acceptsCursorChanged) //indicates if item is currently selected, indicated also by activeFocus property @@ -67,6 +70,7 @@ public: CursorNavigationAttached(QQuickItem *parent); ~CursorNavigationAttached(); + double angleOffset() const; bool acceptsCursor() const; bool hasCursor() const; bool trapsCursor() const; @@ -82,6 +86,7 @@ public: QQuickItem *item() const; public slots: + void setAngleOffset(double angleOffset); void setAcceptsCursor(bool acceptsCursor); void setTrapsCursor(bool trapsCursor); void setEscapeTarget(QQuickItem * escapeTarget); @@ -90,14 +95,14 @@ public slots: * events are received by the item that currently has the cursor */ void setMagnitude(qreal angle, qreal magnitude); - void setMagnitude(QVector2D vector); + void setMagnitude(const QVector2D &vector); void move(qreal angle, qreal tolerance = 0); - void move(QVector2D vector, qreal tolerance = 0); + void move(const QVector2D &vector, qreal tolerance = 0); //find the next item with this move, without moving QQuickItem *find(qreal angle, qreal tolerance = 0); - QQuickItem *find(QVector2D vector, qreal tolerance = 0); + QQuickItem *find(const QVector2D &vector, qreal tolerance = 0); void moveUp(); void moveDown(); @@ -107,9 +112,12 @@ public slots: void moveForward(); void moveBack(); void escape(); - + /* Returns the item that currently has the cursor + */ + QQuickItem *currentItem(); signals: + void angleOffsetChanged(double angleOffset); void acceptsCursorChanged(bool acceptsCursor); void hasCursorChanged(bool hasCursor); void trapsCursorChanged(bool trapsCursor); @@ -142,6 +150,7 @@ private: CursorNavigationAttached *m_parentNavigable; QList<CursorNavigationAttached*> m_children; + double m_angleOffset; bool m_acceptsCursor; bool m_hasCursor; bool m_trapsCursor; |