26#include <lomiri/shell/application/MirMousePointerInterface.h>
28class MousePointer :
public MirMousePointerInterface {
30 Q_PROPERTY(QQuickItem* confiningItem READ confiningItem WRITE setConfiningItem NOTIFY confiningItemChanged)
31 Q_PROPERTY(
int topBoundaryOffset READ topBoundaryOffset WRITE setTopBoundaryOffset NOTIFY topBoundaryOffsetChanged)
32 Q_PROPERTY(
bool active READ isActive WRITE setActive NOTIFY activeChanged)
35 MousePointer(QQuickItem *parent =
nullptr);
38 void setCursorName(
const QString &qtCursorName)
override;
39 QString cursorName()
const override {
return m_cursorName; }
41 void setThemeName(
const QString &themeName)
override;
42 QString themeName()
const override {
return m_themeName; }
44 void moveTo(
const QPoint& position)
override;
46 void setCustomCursor(
const QCursor &)
override;
48 QQuickItem* confiningItem()
const;
49 void setConfiningItem(QQuickItem*);
51 int topBoundaryOffset()
const;
52 void setTopBoundaryOffset(
int topBoundaryOffset);
54 QScreen* screen()
const {
return m_registeredScreen; }
56 bool isActive() {
return m_active; }
57 void setActive(
bool value);
59 bool centerAdjust() {
return m_centerAdjust; }
60 void setCenterAdjust(
bool value);
63 void pushedLeftBoundary(qreal amount, Qt::MouseButtons buttons);
64 void pushedRightBoundary(qreal amount, Qt::MouseButtons buttons);
65 void pushedTopBoundary(qreal amount, Qt::MouseButtons buttons);
66 void pushedTopLeftCorner(qreal amount, Qt::MouseButtons buttons);
67 void pushedTopRightCorner(qreal amount, Qt::MouseButtons buttons);
68 void pushedBottomLeftCorner(qreal amount, Qt::MouseButtons buttons);
69 void pushedBottomRightCorner(qreal amount, Qt::MouseButtons buttons);
72 void confiningItemChanged();
74 void topBoundaryOffsetChanged(
int topBoundaryOffset);
79 void itemChange(ItemChange change,
const ItemChangeData &value)
override;
82 void registerScreen(QScreen *screen);
85 void registerWindow(QWindow *window);
86 void applyItemConfinement(qreal &newX, qreal &newY);
88 QPointer<QWindow> m_registeredWindow;
89 QPointer<QScreen> m_registeredScreen;
96 QPointF m_accumulatedMovement;
98 QPointer<QQuickItem> m_confiningItem;
100 int m_topBoundaryOffset{0};
101 bool m_pushing{
false};