~abreu-alexandre/oxide/vibrate

« back to all changes in this revision

Viewing changes to qt/core/browser/oxide_qt_vibration_manager.h

  • Committer: Alexandre Abreu
  • Date: 2016-02-01 20:17:09 UTC
  • mfrom: (1272.4.2 vibrate)
  • Revision ID: alexandre.abreu@canonical.com-20160201201709-opshbr8b12s1gw9r
VibrationĀ APIĀ support

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vim:expandtab:shiftwidth=2:tabstop=2:
 
2
// Copyright (C) 2015 Canonical Ltd.
 
3
 
 
4
// This library is free software; you can redistribute it and/or
 
5
// modify it under the terms of the GNU Lesser General Public
 
6
// License as published by the Free Software Foundation; either
 
7
// version 2.1 of the License, or (at your option) any later version.
 
8
 
 
9
// This library is distributed in the hope that it will be useful,
 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
// Lesser General Public License for more details.
 
13
 
 
14
// You should have received a copy of the GNU Lesser General Public
 
15
// License along with this library; if not, write to the Free Software
 
16
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 
 
18
#ifndef _OXIDE_QT_CORE_BROWSER_VIBRATION_MANAGER_H_
 
19
#define _OXIDE_QT_CORE_BROWSER_VIBRATION_MANAGER_H_
 
20
 
 
21
#include <QtGlobal>
 
22
 
 
23
#include "base/macros.h"
 
24
#include "base/memory/scoped_ptr.h"
 
25
 
 
26
#include "mojo/public/cpp/bindings/strong_binding.h"
 
27
 
 
28
#include "device/vibration/vibration_manager_impl.h"
 
29
 
 
30
QT_BEGIN_NAMESPACE
 
31
class QFeedbackHapticsEffect;
 
32
QT_END_NAMESPACE
 
33
 
 
34
namespace oxide {
 
35
namespace qt {
 
36
 
 
37
class VibrationManager : public device::VibrationManager {
 
38
 public:
 
39
  static void Create(mojo::InterfaceRequest<device::VibrationManager> request);
 
40
 
 
41
  void Vibrate(int64_t milliseconds) override;
 
42
  void Cancel() override;
 
43
 
 
44
 private:
 
45
  VibrationManager(mojo::InterfaceRequest<device::VibrationManager> request);
 
46
  ~VibrationManager() override;
 
47
 
 
48
  mojo::StrongBinding<device::VibrationManager> binding_;
 
49
  scoped_ptr<QFeedbackHapticsEffect> vibration_;
 
50
};
 
51
 
 
52
} // namespace qt
 
53
} // namespace oxide
 
54
 
 
55
#endif // _OXIDE_QT_CORE_BROWSER_VIBRATION_MANAGER_H_
 
56