~ubuntu-branches/ubuntu/trusty/qtubuntu-sensors/trusty

« back to all changes in this revision

Viewing changes to feedback/qfeedback.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Robert Bruce Park, Christian Dywan, Ubuntu daily release
  • Date: 2013-10-24 22:03:14 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20131024220314-0sldpxx3ovyl0yir
Tags: 0.6+14.04.20131024.4-0ubuntu1
[ Robert Bruce Park ]
* Stop depending on transitional package.

[ Christian Dywan ]
* Add Ubuntu feedback plugin backend. (LP: #1214404)

[ Ubuntu daily release ]
* Automatic snapshot from revision 39

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013 Canonical Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Author: Christian Dywan <christian.dywan@canonical.com>
 
17
 */
 
18
 
 
19
#ifndef QFEEDBACK_MIR_H
 
20
#define QFEEDBACK_MIR_H
 
21
 
 
22
#include <QtCore/QList>
 
23
#include <QtCore/QVector>
 
24
#include <QtCore/QHash>
 
25
#include <QtCore/QObject>
 
26
#include <QtCore/QMutex>
 
27
#include <QtCore/QTimer>
 
28
 
 
29
#include <qfeedbackplugininterfaces.h>
 
30
 
 
31
QT_BEGIN_HEADER
 
32
QT_USE_NAMESPACE
 
33
 
 
34
class QFeedbackMir : public QObject, public QFeedbackHapticsInterface, public QFeedbackFileInterface, public QFeedbackThemeInterface
 
35
{
 
36
    Q_OBJECT
 
37
    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtFeedbackPlugin" FILE "feedback.json")
 
38
 
 
39
    Q_INTERFACES(QFeedbackHapticsInterface)
 
40
    Q_INTERFACES(QFeedbackFileInterface)
 
41
    Q_INTERFACES(QFeedbackThemeInterface)
 
42
 
 
43
public:
 
44
    QFeedbackMir();
 
45
    virtual ~QFeedbackMir();
 
46
 
 
47
    virtual PluginPriority pluginPriority();
 
48
    virtual QList<QFeedbackActuator*> actuators();
 
49
 
 
50
    //for actuator handling
 
51
    virtual void setActuatorProperty(const QFeedbackActuator &, ActuatorProperty, const QVariant &);
 
52
    virtual QVariant actuatorProperty(const QFeedbackActuator &, ActuatorProperty);
 
53
    virtual bool isActuatorCapabilitySupported(const QFeedbackActuator &, QFeedbackActuator::Capability);
 
54
 
 
55
    virtual void updateEffectProperty(const QFeedbackHapticsEffect *, EffectProperty);
 
56
    virtual void setEffectState(const QFeedbackHapticsEffect *, QFeedbackEffect::State);
 
57
    virtual QFeedbackEffect::State effectState(const QFeedbackHapticsEffect *);
 
58
 
 
59
    //for loading files
 
60
    virtual void setLoaded(QFeedbackFileEffect*, bool);
 
61
    virtual void setEffectState(QFeedbackFileEffect *, QFeedbackEffect::State);
 
62
    virtual QFeedbackEffect::State effectState(const QFeedbackFileEffect *);
 
63
    virtual int effectDuration(const QFeedbackFileEffect *);
 
64
    virtual QStringList supportedMimeTypes();
 
65
 
 
66
    // theming
 
67
    virtual bool play(QFeedbackEffect::Effect);
 
68
private:
 
69
    QList<QFeedbackActuator*> actuatorList;
 
70
 
 
71
    void vibrateOnce(const QFeedbackEffect* effect);
 
72
};
 
73
 
 
74
QT_END_HEADER
 
75
 
 
76
#endif // QFEEDBACK_MIR_H