tizen 2.3.1 release
[framework/web/wearable/wrt-plugins-tizen.git] / src / HumanActivityMonitor / PedometerInfo.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2014 Samsung Electronics Co., 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, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 #ifndef __TIZEN_PEDOMETER_INFO_H__
19 #define __TIZEN_PEDOMETER_INFO_H__
20
21 #include <MultiCallbackUserData.h>
22 #include "ContextTypes.h"
23
24 using namespace DeviceAPI::Common;
25
26 namespace DeviceAPI {
27 namespace HumanActivityMonitor {
28
29 class PedometerInfo
30 {
31 public:
32     PedometerInfo();
33     virtual ~PedometerInfo();
34
35     int getStepStatus() const;
36     char* getStepStatusString() const;
37     void setStepStatus(int stepStatus);
38
39     double getSpeed() const;
40     void setSpeed(double speed);
41
42     double getWalkingFrequency() const;
43     void setWalkingFrequency(double walkingFrequency);
44
45     double getCumulativeDistance() const;
46     void setCumulativeDistance(double cumulativeDistance);
47
48     double getCumulativeCalorie() const;
49     void setCumulativeCalorie(double cumulativeCalorie);
50
51     double getCumulativeTotalStepCount() const;
52     void setCumulativeTotalStepCount(double cumulativeTotalStepCount);
53
54     double getCumulativeWalkStepCount() const;
55     void setCumulativeWalkStepCount(double cumulativeWalkStepCount);
56
57     double getCumulativeRunStepCount() const;
58     void setCumulativeRunStepCount(double cumulativeRunStepCount);
59
60     void setStepDifference(int* stepDiff);
61     int* getStepDifference() const;
62
63     void setTimeStamp(int64_t* timsStamp);
64     int64_t* getTimeStamp() const;
65
66     void setTimeStampLength(int timsStampLength);
67     int getTimeStampLength() const;
68
69     void setContext(JSContextRef ctx);
70     JSContextRef getContext();
71
72     double convertSimpleDouble(double origin);
73
74     JSValueRef m_jSStepDiffrence;
75     JSContextRef m_JSContext;
76
77 private:
78     int m_stepStatus;
79     double m_speed;
80     double m_walkingFrequency;
81     double m_cumulativeDistance;
82     double m_cumulativeCalorie;
83     double m_cumulativeTotalStepCount;
84     double m_cumulativeWalkStepCount;
85     double m_cumulativeRunStepCount;
86     int* m_stepDifference;
87     int m_timeStampLength;
88     int64_t* m_timeStamp;
89
90 };
91
92 class HRMInfo
93 {
94 public:
95     HRMInfo(int heartRate, int rrInterval);
96     virtual ~HRMInfo();
97
98     int getHeartRate() const;
99     void setHeartRate(int heartRate);
100
101     int getRRInterval() const;
102     void setRRInterval(int rrInterval);
103
104 private:
105     int m_heartRate;
106     int m_RRInterval;
107 };
108
109
110 class GPSInfo
111 {
112 public:
113     GPSInfo(double latitude, double longitude, double altitude, double speed, double errorRange, int64_t timeStamp);
114     virtual ~GPSInfo();
115
116     double getLatitude() const;
117     void setLatitude(double latitude);
118
119     double getLongitude() const;
120     void setLongitude(double longitude);
121
122     double getAltitude() const;
123     void setAltitude(double altitude);
124
125     double getSpeed() const;
126     void setSpeed(double speed);
127
128     int64_t getTimeStamp() const;
129     void setTimeStamp(int64_t timeStamp);
130
131     double getErrorRange() const;
132     void setErrorRange(double errorRange);
133
134
135     double convertSimpleDouble(double origin);
136
137 private:
138     double m_latitude;
139     double m_longitude;
140     double m_altitude;
141     double m_speed;
142     double m_errorRange;
143     int64_t m_timeStamp;
144 };
145
146 class StepDifferenceInfo
147 {
148 public:
149     StepDifferenceInfo(int stepDifference, int64_t timeStamp);
150     virtual ~StepDifferenceInfo();
151
152     void setStepDifference(int stepDifference);
153     int getStepDifference() const;
154
155     int64_t getTimeStamp() const;
156     void setTimeStamp(int64_t timeStamp);
157
158     double convertSimpleDouble(double origin);
159
160 private:
161     int m_stepDifference;
162     int64_t m_timeStamp;
163 };
164
165 typedef std::shared_ptr<StepDifferenceInfo> StepDifferenceInfoPtr;
166
167 } // Pedometer
168 } // DeviceAPI
169
170 #endif // __TIZEN_PEDOMETER_INFO_H__