File: MirMousePointerInterface.h

package info (click to toggle)
lomiri-api 0.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,248 kB
  • sloc: cpp: 6,415; python: 264; ansic: 96; makefile: 29; sh: 17
file content (77 lines) | stat: -rw-r--r-- 2,306 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * Copyright (C) 2015-2016 Canonical, Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License version 3, as published by
 * the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MIR_MOUSE_POINTER_INTERFACE_H
#define MIR_MOUSE_POINTER_INTERFACE_H

#include <QQuickItem>

/**
 * @brief The QML mouse pointer
 *
 * FIXME: Get this out of lomiri-api
 *
 * This QML item drives the position of the Mir mouse pointer on the scene
 */
class MirMousePointerInterface : public QQuickItem {
    Q_OBJECT

    /**
     * @brief Name of the cursor
     * Defines the look of the mouse pointer along with themeName
     */
    Q_PROPERTY(QString cursorName READ cursorName NOTIFY cursorNameChanged)

    /**
     * @brief Name of the cursor theme
     * Defines the look of the mouse pointer along with cursorName
     * Its default value is "default".
     */
    Q_PROPERTY(QString themeName READ themeName NOTIFY themeNameChanged)

public:
    /**
     * @brief The constructor
     */
    MirMousePointerInterface(QQuickItem *parent = nullptr) : QQuickItem(parent) {}

    /// @cond
    virtual void setCursorName(const QString &cursorName) = 0;
    virtual QString cursorName() const = 0;

    virtual void setThemeName(const QString &themeName) = 0;
    virtual QString themeName() const = 0;

    virtual void moveTo(const QPoint& position) = 0;
    /// @endcond

    /**
     * @brief Sets the custom cursor
     *
     * If it's not a pixmap cursor it will be ignored.
     *
     * To use it, cursorName must be set to "custom". themeName is ignored in this case.
     */
    virtual void setCustomCursor(const QCursor &) = 0;

Q_SIGNALS:
    /// @cond
    void cursorNameChanged(QString name);
    void themeNameChanged(QString name);
    /// @endcond
};

#endif // MIR_MOUSE_POINTER_INTERFACE_H