|
OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 #ifndef UI_BASE_TOUCH_MULTI_TOUCH_DEVICE_H_ | |
tfarina
2012/03/28 16:19:47
add a blank line above.
| |
5 #define UI_BASE_TOUCH_MULTI_TOUCH_DEVICE_H_ | |
6 | |
tfarina
2012/03/28 16:19:47
add #pragma once
| |
7 #include "ui/base/touch/axis.h" | |
8 | |
9 #include <map> | |
10 #include <string> | |
11 #include <vector> | |
tfarina
2012/03/28 16:19:47
remove this unused include
| |
12 | |
13 namespace ui { | |
14 | |
15 class MultiTouchDevice { | |
16 public: | |
17 typedef std::map<Axis::Type, Axis> Axes; | |
18 | |
19 enum Type { | |
20 DIRECT_TOUCH_DEVICE_TYPE, | |
21 DEPENDENT_TOUCH_DEVICE_TYPE, | |
22 INDEPENDENT_TOUCH_DEVICE_TYPE, | |
23 SEMI_MULTI_TOUCH_DEVICE_TYPE, | |
24 UNKNOWN_TOUCH_DEVICE_TYPE | |
25 }; | |
26 | |
27 MultiTouchDevice() | |
28 : id_(-1), | |
tfarina
2012/03/28 16:19:47
initialize these members in source file instead.
| |
29 name_("Invalid touch device"), | |
30 type_(UNKNOWN_TOUCH_DEVICE_TYPE), | |
31 max_num_touches_(0), | |
32 window_resolution_x_(0.f), | |
33 window_resolution_y_(0.f) { | |
34 } | |
35 | |
Elliot Glaysher
2012/03/28 17:49:00
Please define a dtor and put the implementation in
| |
36 int id() const { return id_; } | |
37 void set_id(int id) { id_ = id; } | |
38 | |
39 const std::string & name() const { return name_; } | |
40 void set_name(const std::string& name) { name_ = name; } | |
41 | |
42 Type type() const { return type_; } | |
43 void set_type(Type type) { type_ = type; } | |
44 | |
45 uint32_t max_num_touches() const { return max_num_touches_; } | |
46 void set_max_num_touches(uint32_t num) { max_num_touches_ = num; } | |
47 | |
48 uint32_t num_axes() const { return axes_.size(); } | |
49 | |
50 const Axes & axes() const { return axes_; } | |
51 void set_axes(const Axes & axes) { axes_ = axes; } | |
52 | |
53 float window_resolution_x() const { return window_resolution_x_; } | |
54 void set_window_resolution_x(float res) { window_resolution_x_ = res; } | |
55 | |
56 float window_resolution_y() const { return window_resolution_y_; } | |
57 void set_window_resolution_y(float res) { window_resolution_y_ = res; } | |
58 | |
59 private: | |
60 int id_; | |
61 std::string name_; | |
62 Type type_; | |
63 uint32_t max_num_touches_; | |
64 Axes axes_; | |
65 float window_resolution_x_; | |
66 float window_resolution_y_; | |
67 | |
68 // TODO(tvoss): Rework handling of devices to rely on shared ptr's. | |
tfarina
2012/03/28 16:19:47
What is this TODO for?
| |
69 // DISALLOW_COPY_AND_ASSIGN(MultiTouchDevice); | |
tfarina
2012/03/28 16:19:47
add basictypes.h include for this. Also why is it
| |
70 }; | |
71 } | |
tfarina
2012/03/28 16:19:47
add a blank line above.
tfarina
2012/03/28 16:19:47
} // namespace ui
| |
72 #endif // UI_BASE_TOUCH_MULTI_TOUCH_DEVICE_H_ | |
OLD | NEW |