summaryrefslogtreecommitdiffstats
path: root/examples/widgets/symbianvibration/xqvibra.h
blob: 5520d08a06bfc7fc8045c3b4eaa4009c8c2780b4 (plain)
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
#ifndef XQVIBRA_H
#define XQVIBRA_H

// INCLUDES
#include <QObject>

// FORWARD DECLARATIONS
class XQVibraPrivate;

// CLASS DECLARATION
//! [0]
class XQVibra : public QObject
{
    Q_OBJECT

public:
    static const int InfiniteDuration = 0;
    static const int MaxIntensity = 100;
    static const int MinIntensity = -100;

    enum Error {
        NoError = 0,
        OutOfMemoryError,
        ArgumentError,
        VibraInUseError,
        HardwareError,
        TimeOutError,
        VibraLockedError,
        AccessDeniedError,
        UnknownError = -1
    };

    enum Status {
        StatusNotAllowed = 0,
        StatusOff,
        StatusOn
    };

    XQVibra(QObject *parent = 0);
    ~XQVibra();

    XQVibra::Status currentStatus() const;
    XQVibra::Error error() const;

Q_SIGNALS:
    void statusChanged(XQVibra::Status status);

public Q_SLOTS:
    bool start(int duration = InfiniteDuration);
    bool stop();
    bool setIntensity(int intensity);

private:
    friend class XQVibraPrivate;
    XQVibraPrivate *d;
};
//! [0]

#endif // XQVIBRA_H

// End of file