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.

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

mercurial