~ubuntu-branches/ubuntu/raring/frame/raring

« back to all changes in this revision

Viewing changes to src/touch.h

  • Committer: Package Import Robot
  • Author(s): Francis Ginther
  • Date: 2012-07-27 10:36:59 UTC
  • Revision ID: package-import@ubuntu.com-20120727103659-lzgo2n21df0g4udi
Tags: upstream-2.2.4
ImportĀ upstreamĀ versionĀ 2.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 *
 
3
 * frame - Touch Frame Library
 
4
 *
 
5
 * Copyright (C) 2011-2012 Canonical Ltd.
 
6
 *
 
7
 * This library is free software: you can redistribute it and/or modify it 
 
8
 * under the terms of the GNU Lesser General Public License version 3
 
9
 * as published by the Free Software Foundation.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful, but 
 
12
 * WITHOUT ANY WARRANTY; without even the implied warranties of 
 
13
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
 
14
 * PURPOSE.  See the GNU Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public License
 
17
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
18
 *
 
19
 ****************************************************************************/
 
20
 
 
21
#ifndef FRAME_TOUCH_H_
 
22
#define FRAME_TOUCH_H_
 
23
 
 
24
#include <stdint.h>
 
25
 
 
26
#include <map>
 
27
#include <memory>
 
28
 
 
29
#include "oif/frame.h"
 
30
#include "property.h"
 
31
#include "typedefs.h"
 
32
 
 
33
struct UFTouch_ {
 
34
  virtual ~UFTouch_() {}
 
35
};
 
36
 
 
37
namespace oif {
 
38
namespace frame {
 
39
 
 
40
class UFTouch : public UFTouch_, public Property<UFTouchProperty> {
 
41
 public:
 
42
  UFTouch(UFTouchState state, UFTouchId id, float x, float y,
 
43
           uint64_t time);
 
44
  UFTouch(const UFTouch& touch, UFTouchState new_state);
 
45
 
 
46
  UFTouchId id() const { return id_; }
 
47
  UFTouchState state() const { return state_; }
 
48
 
 
49
  void SetValue(UFAxisType type, float value);
 
50
  UFStatus GetValue(UFAxisType type, float* value) const;
 
51
 
 
52
  UFTouch(const UFTouch&) = delete;
 
53
  UFTouch& operator=(const UFTouch&) = delete;
 
54
 
 
55
 private:
 
56
  const UFTouchId id_;
 
57
  const UFTouchState state_;
 
58
  std::map<UFAxisType, float> values_;
 
59
};
 
60
 
 
61
} // namespace frame
 
62
} // namespace oif
 
63
 
 
64
#endif // FRAME_TOUCH_H_