Touchgui/plugins/org.apache.cordova.vibration/src/ubuntu/vibration.h

Thu, 04 Jun 2015 14:50:33 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 04 Jun 2015 14:50:33 +0200
changeset 0
e8ccd40d0ef6
permissions
-rw-r--r--

Genesis of lecture sources for Droidcon Berlin 2015 in Postbahnhof.

     1 /*
     2  *
     3  * Copyright 2013 Canonical Ltd.
     4  *
     5  * Licensed under the Apache License, Version 2.0 (the "License");
     6  * you may not use this file except in compliance with the License.
     7  * You may obtain a copy of the License at
     8  *
     9  *   http://www.apache.org/licenses/LICENSE-2.0
    10  *
    11  * Unless required by applicable law or agreed to in writing,
    12  * software distributed under the License is distributed on an
    13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    14  * KIND, either express or implied.  See the License for the
    15  * specific language governing permissions and limitations
    16  * under the License.
    17  *
    18 */
    20 #ifndef _VIBRATION_H_SFAFKNVX3456
    21 #define _VIBRATION_H_SFAFKNVX3456
    23 #include <QtCore>
    24 #include <QFeedbackHapticsEffect>
    25 #include <cplugin.h>
    27 class Vibration: public CPlugin {
    28     Q_OBJECT
    29 public:
    30     explicit Vibration(Cordova *cordova): CPlugin(cordova) {
    31     }
    33     virtual const QString fullName() override {
    34         return Vibration::fullID();
    35     }
    37     virtual const QString shortName() override {
    38         return "Vibration";
    39     }
    41     static const QString fullID() {
    42         return "Vibration";
    43     }
    44 public slots:
    45     void vibrate(int, int, int mills);
    46     void cancelVibration(int, int);
    47     void vibrateWithPattern(int, int, const QList<int> &pattern, int);
    49 private:
    50     QList<QSharedPointer<QFeedbackEffect>> _effects;
    51     QList<QSharedPointer<QTimer>> _timers;
    52 };
    54 #endif

mercurial