merge with master
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:17:32 +0000 (01:17 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:17:32 +0000 (01:17 +0900)
32 files changed:
CMakeLists.txt
inc/FUixSensor.h
inc/FUixSensorAccelerationSensorData.h
inc/FUixSensorDeviceOrientationSensorData.h [new file with mode: 0644]
inc/FUixSensorGravitySensorData.h [new file with mode: 0644]
inc/FUixSensorGyroSensorData.h
inc/FUixSensorIMotionEventListener.h
inc/FUixSensorLightSensorData.h
inc/FUixSensorMagneticSensorData.h
inc/FUixSensorMotion.h
inc/FUixSensorMotionCommon.h
inc/FUixSensorProximitySensorData.h
inc/FUixSensorSensorManager.h
inc/FUixSensorSensorTypes.h
inc/FUixSensorTiltSensorData.h
inc/FUixSensorUserAccelerationSensorData.h [new file with mode: 0644]
packaging/osp-uix.spec
src/FUixSensorAccelerationSensorData.cpp
src/FUixSensorDeviceOrientationSensorData.cpp [new file with mode: 0644]
src/FUixSensorGravitySensorData.cpp [new file with mode: 0644]
src/FUixSensorGyroSensorData.cpp
src/FUixSensorLightSensorData.cpp
src/FUixSensorMagneticSensorData.cpp
src/FUixSensorProximitySensorData.cpp
src/FUixSensorSensorData.cpp
src/FUixSensorTiltSensorData.cpp
src/FUixSensorUserAccelerationSensorData.cpp [new file with mode: 0644]
src/FUixSensor_ISensorCore.cpp
src/FUixSensor_MotionImpl.cpp
src/FUixSensor_SensorCoreEventTypes.h
src/FUixSensor_SensorEventDeliverer.cpp
src/FUixSensor_SensorManagerImpl.cpp

index 8806f25..64bc1a1 100755 (executable)
@@ -25,6 +25,9 @@ SET (${this_target}_SOURCE_FILES
        src/FUixSensorTiltSensorData.cpp
        src/FUixSensorGyroSensorData.cpp
        src/FUixSensorLightSensorData.cpp
+       src/FUixSensorGravitySensorData.cpp
+       src/FUixSensorUserAccelerationSensorData.cpp
+       src/FUixSensorDeviceOrientationSensorData.cpp
        src/FUixSensorSensorManager.cpp
        src/FUixSensor_ISensorCore.cpp
        src/FUixSensor_SensorUtil.cpp
index 307d037..7023ddf 100755 (executable)
@@ -32,6 +32,9 @@
 #include <FUixSensorTiltSensorData.h>
 #include <FUixSensorGyroSensorData.h>
 #include <FUixSensorLightSensorData.h>
+#include <FUixSensorGravitySensorData.h>
+#include <FUixSensorUserAccelerationSensorData.h>
+#include <FUixSensorDeviceOrientationSensorData.h>
 #include <FUixSensorISensorEventListener.h>
 #include <FUixSensorMotion.h>
 #include <FUixSensorSensorManager.h>
index f1a087c..da6b829 100644 (file)
@@ -61,6 +61,47 @@ public:
         */
        virtual ~AccelerationSensorData(void);
 
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %AccelerationSensorData
+        */
+       AccelerationSensorData(const AccelerationSensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %AccelerationSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %AccelerationSensorData
+        */
+       AccelerationSensorData& operator =(const AccelerationSensorData& rhs);
+
+
 private:
        virtual result GetValue(SensorDataKey dataKey, long& value) const;
        virtual result GetValue(SensorDataKey dataKey, float& value) const;
diff --git a/inc/FUixSensorDeviceOrientationSensorData.h b/inc/FUixSensorDeviceOrientationSensorData.h
new file mode 100644 (file)
index 0000000..85181d3
--- /dev/null
@@ -0,0 +1,137 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file     FUixSensorDeviceOrientationSensorData.h
+ * @brief    This is the header file for the %DeviceOrientationSensorData class.
+ *
+ * This header file contains the declarations of the %DeviceOrientationSensorData class.
+ */
+
+#ifndef _FUIX_SENSOR_DEVICE_ORIENTATION_SENSOR_DATA_H_
+#define _FUIX_SENSOR_DEVICE_ORIENTATION_SENSOR_DATA_H_
+
+#include <FOspConfig.h>
+#include <FUixSensorSensorData.h>
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+/**
+ * @class    DeviceOrientationSensorData
+ * @brief    This class stores device-orientation sensor data, including a time stamp.
+ *
+ * @since 2.1
+ *
+ * @remarks      @b Header @b %file: @b \#include @b <FUix.h> @n
+ *               @b Library : @b osp-uix
+ *
+ * The %DeviceOrientationSensorData class stores device-orientation sensor data, including a time stamp.
+ * @n
+ * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/sensor_manager.htm">Sensor Manager</a>.
+ */
+class _OSP_EXPORT_ DeviceOrientationSensorData
+       : public Tizen::Uix::Sensor::SensorData
+{
+public:
+       /**
+        * This is the default constructor for this class.
+        *
+        * @since 2.1
+        */
+               DeviceOrientationSensorData(void);
+
+       /**
+        * This is the destructor for this class.
+        *
+        * @since 2.1
+        */
+       virtual ~DeviceOrientationSensorData(void);
+
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %DeviceOrientationSensorData
+        */
+       DeviceOrientationSensorData(const DeviceOrientationSensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %DeviceOrientationSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %DeviceOrientationSensorData
+        */
+       DeviceOrientationSensorData& operator =(const DeviceOrientationSensorData& rhs);
+
+
+
+private:
+       virtual result GetValue(SensorDataKey dataKey, long& value) const;
+       virtual result GetValue(SensorDataKey dataKey, float& value) const;
+       virtual result GetValue(SensorDataKey dataKey, bool& value) const;
+
+public:
+       /**
+        * The yaw value of the device-orientation sensor data
+        *
+        * @since 2.1
+        */
+       float yaw;
+
+       /**
+        * The roll value of the device-orientation sensor data
+        *
+        * @since 2.1
+        */
+       float roll;
+
+       /**
+        * The pitch value of the device-orientation sensor data
+        *
+        * @since 2.1
+        */
+       float pitch;
+
+
+}; // DeviceOrientationSensorData
+} } }// Tizen::Uix::Sensor
+
+#endif // _FUIX_SENSOR_DEVICE_ORIENTATION_SENSOR_DATA_H_
diff --git a/inc/FUixSensorGravitySensorData.h b/inc/FUixSensorGravitySensorData.h
new file mode 100644 (file)
index 0000000..00a4f7c
--- /dev/null
@@ -0,0 +1,135 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file     FUixSensorGravitySensorData.h
+ * @brief    This is the header file for the %GravitySensorData class.
+ *
+ * This header file contains the declarations of the %GravitySensorData class.
+ */
+
+#ifndef _FUIX_SENSOR_GRAVITY_SENSOR_DATA_H_
+#define _FUIX_SENSOR_GRAVITY_SENSOR_DATA_H_
+
+#include <FOspConfig.h>
+#include <FUixSensorSensorData.h>
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+/**
+ * @class    GravitySensorData
+ * @brief    This class stores gravity sensor data, including a time stamp.
+ *
+ * @since 2.1
+ *
+ * @remarks      @b Header @b %file: @b \#include @b <FUix.h> @n
+ *               @b Library : @b osp-uix
+ *
+ * The %GravitySensorData class stores gravity sensor data, including a time stamp.
+ * @n
+ * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/sensor_manager.htm">Sensor Manager</a>.
+ */
+class _OSP_EXPORT_ GravitySensorData
+       : public Tizen::Uix::Sensor::SensorData
+{
+public:
+       /**
+        * This is the default constructor for this class.
+        *
+        * @since 2.1
+        */
+       GravitySensorData(void);
+
+       /**
+        * This is the destructor for this class.
+        *
+        * @since 2.1
+        */
+       virtual ~GravitySensorData(void);
+
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %GravitySensorData
+        */
+       GravitySensorData(const GravitySensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %GravitySensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %GravitySensorData
+        */
+       GravitySensorData& operator =(const GravitySensorData& rhs);
+
+
+
+private:
+       virtual result GetValue(SensorDataKey dataKey, long& value) const;
+       virtual result GetValue(SensorDataKey dataKey, float& value) const;
+       virtual result GetValue(SensorDataKey dataKey, bool& value) const;
+
+public:
+       /**
+        * The x-axis value of the gravity sensor data
+        *
+        * @since 2.1
+        */
+       float x;
+
+       /**
+        * The y-axis value of the gravity sensor data
+        *
+        * @since 2.1
+        */
+       float y;
+
+       /**
+        * The z-axis value of the gravity sensor data
+        *
+        * @since 2.1
+        */
+       float z;
+}; // GravitySensorData
+} } } // Tizen::Uix::Sensor
+
+#endif // _FUIX_SENSOR_GRAVITY_SENSOR_DATA_H_
index 8aa2b6a..6ad5038 100644 (file)
@@ -61,6 +61,48 @@ public:
         */
        virtual ~GyroSensorData(void);
 
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %GyroSensorData
+        */
+       GyroSensorData(const GyroSensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %GyroSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %GyroSensorData
+        */
+       GyroSensorData& operator =(const GyroSensorData& rhs);
+
+
+
 private:
        virtual result GetValue(SensorDataKey dataKey, long& value) const;
        virtual result GetValue(SensorDataKey dataKey, float& value) const;
index a69c931..fddad1b 100644 (file)
@@ -74,7 +74,7 @@ public:
         *
         * @since   2.0
         *
-        * @see     Tizen::Uix::Sensor::MotionSnapType
+        * @see     Tizen::Uix::Sensor::MotionType
         */
        virtual void OnDoubleTapDetected(void) = 0;
 
@@ -89,6 +89,17 @@ public:
         */
        virtual void OnShakeDetected(MotionState motionState) = 0;
 
+       /**
+               * Called when the move-to-ear event is detected. @n
+               * When a move-to-ear event occurs, and if its type is registered by an application, then the event is triggered.
+               *
+               * @since   2.1
+               *
+               * @see     Tizen::Uix::Sensor::MotionType
+               */
+
+           virtual void OnMoveToEarDetected(void) {}
+
 protected:
 
     //
@@ -102,12 +113,6 @@ protected:
     // and consistency-related issues in the application.
     //
     virtual void IMotionEventListener_Reserved2(void) {}
-
-    //
-    // This method is for internal use only. Using this method can cause behavioral, security-related,
-    // and consistency-related issues in the application.
-    //
-    virtual void IMotionEventListener_Reserved3(void) {}
 }; // IMotionEventListener
 
 } } } // Tizen::Uix::Sensor
index a6fa297..2bd795d 100644 (file)
@@ -61,6 +61,46 @@ public:
         */
        virtual ~LightSensorData(void);
 
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %LightSensorData
+        */
+       LightSensorData(const LightSensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %LightSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %LightSensorData
+        */
+       LightSensorData& operator =(const LightSensorData& rhs);
+
 private:
        virtual result GetValue(SensorDataKey dataKey, long& value) const;
        virtual result GetValue(SensorDataKey dataKey, float& value) const;
index 77f735c..ac9cd6a 100644 (file)
@@ -61,6 +61,46 @@ public:
         */
        virtual ~MagneticSensorData(void);
 
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %MagneticSensorData
+        */
+       MagneticSensorData(const MagneticSensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %MagneticSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %MagneticSensorData
+        */
+       MagneticSensorData& operator =(const MagneticSensorData& rhs);
+
 private:
        virtual result GetValue(SensorDataKey dataKey, long& value) const;
        virtual result GetValue(SensorDataKey dataKey, float& value) const;
index ec8fbcf..43d436d 100644 (file)
@@ -142,7 +142,7 @@ public:
         *                                  Multiple motion types of type Tizen::Uix::Sensor::MotionType can be combined using the logical OR operator.
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_STATE     This instance has not been constructed as yet.
-        * @exception   E_INVALID_ARG       A specified input parameter is invalid.  @if OSPCOMPAT @b Since: @b 2.0 @endif
+        * @exception   E_INVALID_ARG       A specified input parameter is invalid.
         * @remarks     The specific error code can be accessed using the GetLastResult() method.
         */
        void SetEnabled(unsigned long type);
index 75c5228..a73ef39 100644 (file)
@@ -43,6 +43,7 @@ enum MotionType
        MOTION_TYPE_SNAP = 0x0001,      /**< The motion type: Snap */
        MOTION_TYPE_SHAKE = 0x0002,     /**< The motion type: Shake */
        MOTION_TYPE_DOUBLETAP = 0x0004, /**< The motion type: Tap */
+       MOTION_TYPE_MOVE_TO_EAR = 0x0008, /**< The motion type: Move to ear @b Since: @b 2.1 */
        MOTION_TYPE_ALL = 0xFFFF,       /**< The motion type: All */
 };
 
@@ -61,7 +62,7 @@ enum MotionState
        MOTION_STARTED,     /**< The specified motion has just started */
        MOTION_INPROGRESS,  /**< The specified motion is happening */
        MOTION_ENDED,       /**< The specified motion has just ended */
-       MOTION_CANCELLED,   /**< Reserved */
+       MOTION_CANCELLED,   /**< The specified motion has just canceled */
 };
 
 /**
index 18ad0ef..0307f64 100644 (file)
@@ -71,6 +71,46 @@ public:
         */
        bool IsObjectDetected(void) const;
 
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %ProximitySensorData
+        */
+       ProximitySensorData(const ProximitySensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %ProximitySensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %ProximitySensorData
+        */
+       ProximitySensorData& operator =(const ProximitySensorData& rhs);
+
 private:
        virtual result GetValue(SensorDataKey dataKey, long& value) const;
        virtual result GetValue(SensorDataKey dataKey, float& value) const;
index 6178266..d02853e 100644 (file)
@@ -179,7 +179,7 @@ public:
        * @exception    E_OUT_OF_MEMORY              The memory is insufficient.
        * @exception    E_INVALID_ARG                An interval must be greater than the maximum interval or less than the minimum interval or the sensor type is invalid.
        * @exception    E_OPERATION_FAILED         The operation has failed to add a sensor listener.
-       * @exception    E_USER_ALREADY_REGISTERED    The specified listener is already registered for the specified sensor type.
+       * @exception    E_USER_ALREADY_REGISTERED    The specified @c listener is already registered for the specified sensor type.
        * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
        */
 
@@ -656,7 +656,7 @@ public:
        * @exception    E_OPERATION_FAILED         The operation has failed.
        * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
        * @remarks      The wake up feature is automatically disabled by the system as soon as the calling application is terminated.
-       * @remarks              This method cannot be tested on the Emulator. It always returns E_SUCCESS on the Emulator.
+       * @remarks              This method cannot be tested on the Emulator. It always returns @c E_SUCCESS on the Emulator.
        */
        result SetWakeupEnabled(SensorType sensorType, bool enable);
 
@@ -693,7 +693,7 @@ public:
        * @exception    E_OPERATION_FAILED         The operation has failed.
        * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
        * @remarks      The specific error code can be accessed using the GetLastResult() method.
-       * @remarks              This method cannot be tested on the Emulator. It always returns true on the Emulator.
+       * @remarks              This method cannot be tested on the Emulator. It always returns @c true on the Emulator.
        */
        bool IsWakeupEnabled(SensorType sensorType) const;
 
index 66a2494..388b779 100644 (file)
@@ -43,6 +43,9 @@ enum SensorType
        SENSOR_TYPE_TILT,                /**< The tilt sensor type */
        SENSOR_TYPE_GYRO,                /**< The gyro sensor type */
        SENSOR_TYPE_LIGHT,               /**< The light sensor type */
+       SENSOR_TYPE_GRAVITY,             /**< The gravity sensor type @b Since: @b 2.1 */
+       SENSOR_TYPE_USER_ACCELERATION,   /**< The user-acceleration sensor type @b Since: @b 2.1 */
+       SENSOR_TYPE_DEVICE_ORIENTATION,  /**< The device-orientation sensor type @b Since: @b 2.1 */
        SENSOR_TYPE_MAX,                 // This enum value is for internal use only.
                                         // Using this enum value can cause behavioral,
                                         // security-related, and consistency-related
index faa7389..24fab84 100644 (file)
@@ -61,6 +61,48 @@ public:
         */
        virtual ~TiltSensorData(void);
 
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %TiltSensorData
+        */
+       TiltSensorData(const TiltSensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %TiltSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %TiltSensorData
+        */
+       TiltSensorData& operator =(const TiltSensorData& rhs);
+
+
+
 private:
        virtual result GetValue(SensorDataKey dataKey, long& value) const;
        virtual result GetValue(SensorDataKey dataKey, float& value) const;
diff --git a/inc/FUixSensorUserAccelerationSensorData.h b/inc/FUixSensorUserAccelerationSensorData.h
new file mode 100644 (file)
index 0000000..b1b4d74
--- /dev/null
@@ -0,0 +1,133 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file     FUixSensorUserAccelerationSensorData.h
+ * @brief    This is the header file for the %UserAccelerationSensorData class.
+ *
+ * This header file contains the declarations of the %UserAccelerationSensorData class.
+ */
+
+#ifndef _FUIX_SENSOR_USER_ACCELERATION_SENSOR_DATA_H_
+#define _FUIX_SENSOR_USER_ACCELERATION_SENSOR_DATA_H_
+
+#include <FOspConfig.h>
+#include <FUixSensorSensorData.h>
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+/**
+ * @class    UserAccelerationSensorData
+ * @brief    This class stores user-acceleration sensor data, including a time stamp.
+ *
+ * @since 2.1
+ *
+ * @remarks      @b Header @b %file: @b \#include @b <FUix.h> @n
+ *               @b Library : @b osp-uix
+ *
+ * The %UserAccelerationSensorData class stores user-acceleration sensor data, including a time stamp.
+ * @n
+ * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/sensor_manager.htm">Sensor Manager</a>.
+ */
+class _OSP_EXPORT_ UserAccelerationSensorData
+       : public Tizen::Uix::Sensor::SensorData
+{
+public:
+       /**
+        * This is the default constructor for this class.
+        *
+        * @since 2.1
+        */
+               UserAccelerationSensorData(void);
+
+       /**
+        * This is the destructor for this class.
+        *
+        * @since 2.1
+        */
+       virtual ~UserAccelerationSensorData(void);
+
+       /**
+        * Copying of objects using this copy constructor is allowed.
+        *
+        * @since               2.1
+        *
+        * @param[in]   rhs     An instance of %UserAccelerationSensorData
+        */
+       UserAccelerationSensorData(const UserAccelerationSensorData& rhs);
+
+       /**
+        * Compares the equality of values between two %UserAccelerationSensorData objects by overriding the Tizen::Base::Object::Equals() method.
+        *
+        * @since          2.1
+        *
+        * @return         @c true if all the fields in the objects are equal, @n
+        *                     else @c false
+        * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
+        * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
+        */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+        * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
+        *
+        * @since         2.1
+        *
+        * @return        The hash value of the current instance
+        */
+       virtual int GetHashCode(void) const;
+
+       /**
+        * Copying of objects using this copy assignment operator is allowed.
+        *
+        * @since          2.1
+        *
+        * @return         A reference to this instance
+        * @param[in]    rhs An instance of %UserAccelerationSensorData
+        */
+       UserAccelerationSensorData& operator =(const UserAccelerationSensorData& rhs);
+
+private:
+       virtual result GetValue(SensorDataKey dataKey, long& value) const;
+       virtual result GetValue(SensorDataKey dataKey, float& value) const;
+       virtual result GetValue(SensorDataKey dataKey, bool& value) const;
+
+public:
+       /**
+        * The x-axis value of the user-acceleration sensor data
+        *
+        * @since 2.1
+        */
+       float x;
+
+       /**
+        * The y-axis value of the user-acceleration sensor data
+        *
+        * @since 2.1
+        */
+       float y;
+
+       /**
+        * The z-axis value of the user-acceleration sensor data
+        *
+        * @since 2.1
+        */
+       float z;
+}; // UserAccelerationSensorData
+} } } // Tizen::Uix::Sensor
+
+#endif // _FUIX_SENSOR_USER_ACCELERATION_SENSOR_DATA_H_
index 79f928c..75f4ff4 100755 (executable)
@@ -3,7 +3,7 @@
 
 Name:          osp-uix
 Summary:       osp uix library
-Version:       1.2.0.0
+Version:       1.2.1.0
 Release:       2
 Group:         System/Libraries
 License:       TO_BE/FILLED_IN
index b3f1e05..685f02a 100644 (file)
 // Includes
 #include <FBaseErrors.h>
 #include <FBaseSysLog.h>
-
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
 #include <FUixSensorAccelerationSensorData.h>
 #include "FUixSensor_SensorUtil.h"
 
+using namespace Tizen::Base;
+
 namespace Tizen { namespace Uix { namespace Sensor
 {
 namespace
@@ -49,6 +52,75 @@ AccelerationSensorData::~AccelerationSensorData(void)
 
 }
 
+AccelerationSensorData::AccelerationSensorData(const AccelerationSensorData& rhs)
+       :x(rhs.x)
+       ,y(rhs.y)
+       ,z(rhs.z)
+{
+
+}
+
+AccelerationSensorData&
+AccelerationSensorData::operator =(const AccelerationSensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               x = rhs.x;
+               y = rhs.y;
+               z = rhs.z;
+       }
+
+       return *this;
+}
+
+int
+AccelerationSensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->x);
+               hash += Float::GetHashCode(this->y);
+               hash += Float::GetHashCode(this->z);
+
+               return hash;
+}
+
+bool
+AccelerationSensorData::Equals(const Object& rhs) const
+{
+       const AccelerationSensorData* pRhs = dynamic_cast <const AccelerationSensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->x != pRhs->x)
+       {
+               return false;
+       }
+
+       if (this->y != pRhs->y)
+       {
+               return false;
+       }
+
+       if (this->z != pRhs->z)
+       {
+               return false;
+       }
+
+
+       return true;
+}
+
 result
 AccelerationSensorData::GetValue(SensorDataKey dataKey, long& value) const
 {
diff --git a/src/FUixSensorDeviceOrientationSensorData.cpp b/src/FUixSensorDeviceOrientationSensorData.cpp
new file mode 100644 (file)
index 0000000..86c3b49
--- /dev/null
@@ -0,0 +1,143 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file     FUixSensorDeviceOrientationSensorData.cpp
+ * @brief    This is the implementation file for the %DeviceOrientationSensorData class.
+ *
+ * This files contains implementation of the %TiltSensorData class.
+ */
+
+// Includes
+#include <FBaseErrors.h>
+#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
+
+#include <FUixSensorDeviceOrientationSensorData.h>
+#include "FUixSensor_SensorUtil.h"
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+namespace
+{
+static const wchar_t W_MSG_INVALID_SENSOR_DATA_KEY[] = L"A data matching the specified key and data type cannot be found.";
+} // Anonymous
+
+DeviceOrientationSensorData::DeviceOrientationSensorData(void)
+       : yaw(0.0F)
+       , roll(0.0F)
+       , pitch(0.0F)
+{
+
+}
+
+DeviceOrientationSensorData::~DeviceOrientationSensorData(void)
+{
+
+}
+
+DeviceOrientationSensorData::DeviceOrientationSensorData(const DeviceOrientationSensorData& rhs)
+       :yaw(rhs.yaw)
+       ,roll(rhs.roll)
+       ,pitch(rhs.pitch)
+{
+
+}
+
+DeviceOrientationSensorData&
+DeviceOrientationSensorData::operator =(const DeviceOrientationSensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               yaw = rhs.yaw;
+               roll = rhs.roll;
+               pitch = rhs.pitch;
+       }
+
+       return *this;
+}
+
+int
+DeviceOrientationSensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->yaw);
+               hash += Float::GetHashCode(this->roll);
+               hash += Float::GetHashCode(this->pitch);
+
+               return hash;
+}
+
+bool
+DeviceOrientationSensorData::Equals(const Object& rhs) const
+{
+       const DeviceOrientationSensorData* pRhs = dynamic_cast <const DeviceOrientationSensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->roll != pRhs->roll)
+       {
+               return false;
+       }
+
+       if (this->roll != pRhs->roll)
+       {
+               return false;
+       }
+
+       if (this->pitch != pRhs->pitch)
+       {
+               return false;
+       }
+       return true;
+}
+
+result
+DeviceOrientationSensorData::GetValue(SensorDataKey dataKey, long& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+
+result
+DeviceOrientationSensorData::GetValue(SensorDataKey dataKey, float& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+
+result
+DeviceOrientationSensorData::GetValue(SensorDataKey dataKey, bool& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+} } }// Tizen::Uix::Sensor
diff --git a/src/FUixSensorGravitySensorData.cpp b/src/FUixSensorGravitySensorData.cpp
new file mode 100644 (file)
index 0000000..9f8286e
--- /dev/null
@@ -0,0 +1,143 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file     FUixSensorGravitySensorData.cpp
+ * @brief    This is the implementation file for the %GravitySensorData class.
+ *
+ * This files contains implementation of the %GravitySensorData class.
+ */
+
+// Includes
+#include <FBaseErrors.h>
+#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
+
+#include <FUixSensorGravitySensorData.h>
+#include "FUixSensor_SensorUtil.h"
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+namespace
+{
+static const wchar_t W_MSG_INVALID_SENSOR_DATA_KEY[] = L"A data matching the specified key and data type cannot be found.";
+} // Anonymous
+
+GravitySensorData::GravitySensorData(void)
+       : x(0.0F)
+       , y(0.0F)
+       , z(0.0F)
+{
+
+}
+
+GravitySensorData::~GravitySensorData(void)
+{
+
+}
+
+GravitySensorData::GravitySensorData(const GravitySensorData& rhs)
+       :x(rhs.x)
+       ,y(rhs.y)
+       ,z(rhs.z)
+{
+
+}
+
+GravitySensorData&
+GravitySensorData::operator =(const GravitySensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               x = rhs.x;
+               y = rhs.y;
+               z = rhs.z;
+       }
+
+       return *this;
+}
+
+int
+GravitySensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->x);
+               hash += Float::GetHashCode(this->y);
+               hash += Float::GetHashCode(this->z);
+
+               return hash;
+}
+
+bool
+GravitySensorData::Equals(const Object& rhs) const
+{
+       const GravitySensorData* pRhs = dynamic_cast <const GravitySensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->x != pRhs->x)
+       {
+               return false;
+       }
+
+       if (this->y != pRhs->y)
+       {
+               return false;
+       }
+
+       if (this->z != pRhs->z)
+       {
+               return false;
+       }
+       return true;
+}
+
+result
+GravitySensorData::GetValue(SensorDataKey dataKey, long& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+
+result
+GravitySensorData::GetValue(SensorDataKey dataKey, float& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+
+result
+GravitySensorData::GetValue(SensorDataKey dataKey, bool& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+} } } // Tizen::Uix::Sensor
index 61246a4..75c46c0 100644 (file)
 // Includes
 #include <FBaseErrors.h>
 #include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
 
 #include <FUixSensorGyroSensorData.h>
 
+using namespace Tizen::Base;
+
 namespace Tizen { namespace Uix { namespace Sensor
 {
 namespace
@@ -48,6 +52,74 @@ GyroSensorData::~GyroSensorData(void)
 
 }
 
+GyroSensorData::GyroSensorData(const GyroSensorData& rhs)
+       :x(rhs.x)
+       ,y(rhs.y)
+       ,z(rhs.z)
+{
+
+}
+
+GyroSensorData&
+GyroSensorData::operator =(const GyroSensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               x = rhs.x;
+               y = rhs.y;
+               z = rhs.z;
+       }
+
+       return *this;
+}
+
+int
+GyroSensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->x);
+               hash += Float::GetHashCode(this->y);
+               hash += Float::GetHashCode(this->z);
+
+               return hash;
+}
+
+bool
+GyroSensorData::Equals(const Object& rhs) const
+{
+       const GyroSensorData* pRhs = dynamic_cast <const GyroSensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->x != pRhs->x)
+       {
+               return false;
+       }
+
+       if (this->y != pRhs->y)
+       {
+               return false;
+       }
+
+       if (this->z != pRhs->z)
+       {
+               return false;
+       }
+
+       return true;
+}
+
 result
 GyroSensorData::GetValue(SensorDataKey dataKey, long& value) const
 {
index 906faa6..8ad4426 100644 (file)
 // Includes
 #include <FBaseErrors.h>
 #include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
 
 #include <FUixSensorLightSensorData.h>
 
+using namespace Tizen::Base;
+
 namespace Tizen { namespace Uix { namespace Sensor
 {
 namespace
@@ -46,6 +50,57 @@ LightSensorData::~LightSensorData(void)
 
 }
 
+LightSensorData::LightSensorData(const LightSensorData& rhs)
+       :level(rhs.level)
+{
+
+}
+
+LightSensorData&
+LightSensorData::operator =(const LightSensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               level = rhs.level;
+       }
+
+       return *this;
+}
+
+int
+LightSensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->level);
+
+               return hash;
+}
+
+bool
+LightSensorData::Equals(const Object& rhs) const
+{
+       const LightSensorData* pRhs = dynamic_cast <const LightSensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->level != pRhs->level)
+       {
+               return false;
+       }
+
+       return true;
+}
 result
 LightSensorData::GetValue(SensorDataKey dataKey, long& value) const
 {
index 229b01c..a7ca4ac 100644 (file)
 // Includes
 #include <FBaseErrors.h>
 #include <FBaseSysLog.h>
-
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
 #include <FUixSensorMagneticSensorData.h>
 #include "FUixSensor_SensorUtil.h"
 
+using namespace Tizen::Base;
+
 namespace Tizen { namespace Uix { namespace Sensor
 {
 namespace
@@ -49,6 +52,74 @@ MagneticSensorData::~MagneticSensorData(void)
 
 }
 
+MagneticSensorData::MagneticSensorData(const MagneticSensorData& rhs)
+       :x(rhs.x)
+       ,y(rhs.y)
+       ,z(rhs.z)
+{
+
+}
+
+MagneticSensorData&
+MagneticSensorData::operator =(const MagneticSensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               x = rhs.x;
+               y = rhs.y;
+               z = rhs.z;
+       }
+
+       return *this;
+}
+
+int
+MagneticSensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->x);
+               hash += Float::GetHashCode(this->y);
+               hash += Float::GetHashCode(this->z);
+
+               return hash;
+}
+
+bool
+MagneticSensorData::Equals(const Object& rhs) const
+{
+       const MagneticSensorData* pRhs = dynamic_cast <const MagneticSensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->x != pRhs->x)
+       {
+               return false;
+       }
+
+       if (this->y != pRhs->y)
+       {
+               return false;
+       }
+
+       if (this->z != pRhs->z)
+       {
+               return false;
+       }
+
+
+       return true;
+}
 result
 MagneticSensorData::GetValue(SensorDataKey dataKey, long& value) const
 {
index 77ca4c5..d91d5cd 100644 (file)
 // Includes
 #include <FBaseErrors.h>
 #include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
 
 #include <FUixSensorProximitySensorData.h>
 #include "FUixSensor_SensorUtil.h"
 
+using namespace Tizen::Base;
+
 namespace Tizen { namespace Uix { namespace Sensor
 {
 namespace
@@ -47,6 +51,59 @@ ProximitySensorData::~ProximitySensorData(void)
 
 }
 
+
+ProximitySensorData::ProximitySensorData(const ProximitySensorData& rhs)
+       :distance(rhs.distance)
+{
+
+}
+
+ProximitySensorData&
+ProximitySensorData::operator =(const ProximitySensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               distance = rhs.distance;
+       }
+
+       return *this;
+}
+
+int
+ProximitySensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->distance);
+
+               return hash;
+}
+
+bool
+ProximitySensorData::Equals(const Object& rhs) const
+{
+       const ProximitySensorData* pRhs = dynamic_cast <const ProximitySensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->distance != pRhs->distance)
+       {
+               return false;
+       }
+
+       return true;
+}
+
 result
 ProximitySensorData::GetValue(SensorDataKey dataKey, long& value) const
 {
index c40e70c..616844c 100644 (file)
@@ -25,7 +25,6 @@
 // Includes
 #include <FBaseErrors.h>
 #include <FBaseSysLog.h>
-
 #include <FUixSensorSensorData.h>
 
 namespace Tizen { namespace Uix { namespace Sensor
index 59357f3..c99828d 100644 (file)
 // Includes
 #include <FBaseErrors.h>
 #include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
 
 #include <FUixSensorTiltSensorData.h>
 #include "FUixSensor_SensorUtil.h"
 
+using namespace Tizen::Base;
+
 namespace Tizen { namespace Uix { namespace Sensor
 {
 namespace
@@ -49,6 +53,75 @@ TiltSensorData::~TiltSensorData(void)
 
 }
 
+TiltSensorData::TiltSensorData(const TiltSensorData& rhs)
+       :azimuth(rhs.azimuth)
+       ,roll(rhs.roll)
+       ,pitch(rhs.pitch)
+{
+
+}
+
+TiltSensorData&
+TiltSensorData::operator =(const TiltSensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               azimuth = rhs.azimuth;
+               roll = rhs.roll;
+               pitch = rhs.pitch;
+       }
+
+       return *this;
+}
+
+int
+TiltSensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->azimuth);
+               hash += Float::GetHashCode(this->roll);
+               hash += Float::GetHashCode(this->pitch);
+
+               return hash;
+}
+
+bool
+TiltSensorData::Equals(const Object& rhs) const
+{
+       const TiltSensorData* pRhs = dynamic_cast <const TiltSensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->azimuth != pRhs->azimuth)
+       {
+               return false;
+       }
+
+       if (this->roll != pRhs->roll)
+       {
+               return false;
+       }
+
+       if (this->pitch != pRhs->pitch)
+       {
+               return false;
+       }
+
+
+       return true;
+}
+
 result
 TiltSensorData::GetValue(SensorDataKey dataKey, long& value) const
 {
diff --git a/src/FUixSensorUserAccelerationSensorData.cpp b/src/FUixSensorUserAccelerationSensorData.cpp
new file mode 100644 (file)
index 0000000..8139a4c
--- /dev/null
@@ -0,0 +1,144 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file     FUixSensorUserAccelerationSensorData.cpp
+ * @brief    This is the implementation file for the %UserAccelerationSensorData class.
+ *
+ * This files contains implementation of the %GravitySensorData class.
+ */
+
+// Includes
+#include <FBaseErrors.h>
+#include <FBaseSysLog.h>
+#include <FBaseFloat.h>
+#include <FBaseLongLong.h>
+
+#include <FUixSensorUserAccelerationSensorData.h>
+#include "FUixSensor_SensorUtil.h"
+
+using namespace Tizen::Base;
+
+
+namespace Tizen { namespace Uix { namespace Sensor
+{
+namespace
+{
+static const wchar_t W_MSG_INVALID_SENSOR_DATA_KEY[] = L"A data matching the specified key and data type cannot be found.";
+} // Anonymous
+
+UserAccelerationSensorData::UserAccelerationSensorData(void)
+       : x(0.0F)
+       , y(0.0F)
+       , z(0.0F)
+{
+
+}
+
+UserAccelerationSensorData::~UserAccelerationSensorData(void)
+{
+
+}
+
+UserAccelerationSensorData::UserAccelerationSensorData(const UserAccelerationSensorData& rhs)
+       :x(rhs.x)
+       ,y(rhs.y)
+       ,z(rhs.z)
+{
+
+}
+
+UserAccelerationSensorData&
+UserAccelerationSensorData::operator =(const UserAccelerationSensorData& rhs)
+{
+       // check for self-assignment
+       if (this != &rhs)
+       {
+               timestamp = rhs.timestamp;
+               x = rhs.x;
+               y = rhs.y;
+               z = rhs.z;
+       }
+
+       return *this;
+}
+
+int
+UserAccelerationSensorData::GetHashCode(void) const
+{
+       int hash = 0;
+
+               hash += LongLong::GetHashCode(this->timestamp);
+               hash += Float::GetHashCode(this->x);
+               hash += Float::GetHashCode(this->y);
+               hash += Float::GetHashCode(this->z);
+
+               return hash;
+}
+
+bool
+UserAccelerationSensorData::Equals(const Object& rhs) const
+{
+       const UserAccelerationSensorData* pRhs = dynamic_cast <const UserAccelerationSensorData*>(&rhs);
+       if (pRhs == null)
+       {
+               return false;
+       }
+
+       if (this->timestamp != pRhs->timestamp)
+       {
+               return false;
+       }
+
+       if (this->x != pRhs->x)
+       {
+               return false;
+       }
+
+       if (this->y != pRhs->y)
+       {
+               return false;
+       }
+
+       if (this->z != pRhs->z)
+       {
+               return false;
+       }
+       return true;
+}
+
+result
+UserAccelerationSensorData::GetValue(SensorDataKey dataKey, long& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+
+result
+UserAccelerationSensorData::GetValue(SensorDataKey dataKey, float& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+
+result
+UserAccelerationSensorData::GetValue(SensorDataKey dataKey, bool& value) const
+{
+       SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
+       return E_INVALID_ARG;
+}
+} } } // Tizen::Uix::Sensor
index b0f0c4b..7e887cd 100644 (file)
@@ -50,6 +50,9 @@ static const long SENSOR_MIN_INTERVALS[] = {
        20L,  // SENSOR_TYPE_TILT
        20L,  // SENSOR_TYPE_GYRO
        100L, // SENSOR_TYPE_LIGHT
+       20L, // SENSOR_TYPE_GRAVITY
+       20L, // SENSOR_TYPE_USER_ACCELERATION
+       20L, // SENSOR_TYPE_DEVICE_ORIENTATION
 };
 static const long SENSOR_MAX_INTERVALS[] = {
        100L,  // SENSOR_TYPE_ACCELERATION
@@ -58,6 +61,9 @@ static const long SENSOR_MAX_INTERVALS[] = {
        1000L, // SENSOR_TYPE_TILT
        100L,  // SENSOR_TYPE_GYRO
        5000L, // SENSOR_TYPE_LIGHT
+       100L, // SENSOR_TYPE_GRAVITY
+       100L, // SENSOR_TYPE_USER_ACCELERATION
+       100L, // SENSOR_TYPE_DEVICE_ORIENTATION
 };
 static const float MIN_VALUE_TILT = 0.0F;
 static const float MAX_VALUE_TILT = 360.0F;
@@ -87,6 +93,12 @@ ConvertToSensorTypeEFromSensorType(SensorType sensorType)
                return SENSOR_GYROSCOPE;
        case SENSOR_TYPE_LIGHT:
                return SENSOR_LIGHT;
+       case SENSOR_TYPE_GRAVITY:
+               return SENSOR_GRAVITY;
+       case SENSOR_TYPE_USER_ACCELERATION:
+               return SENSOR_LINEAR_ACCELERATION;
+       case SENSOR_TYPE_DEVICE_ORIENTATION:
+               return SENSOR_DEVICE_ORIENTATION;
        default:
                SysAssertf(false, "ConvertToSensorTypeEFromSensorType() > Invalid SensorType [sensorType:%d]", sensorType);
                SetLastResult(E_INVALID_ARG);
@@ -122,6 +134,12 @@ GetSensorTypeEFromSensorCoreEventType(_SensorCoreEventType eventType)
                return SENSOR_GYROSCOPE;
        case _SENSOR_CORE_EVENT_TYPE_LIGHT_LEVEL_DATA:
                return SENSOR_LIGHT;
+       case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+               return SENSOR_GRAVITY;
+       case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+               return SENSOR_LINEAR_ACCELERATION;
+       case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+               return SENSOR_DEVICE_ORIENTATION;
        default:
                SysAssertf(false, "GetSensorTypeEFromSensorCoreEventType() > Invalid _SensorCoreEventType [eventType:%d]", eventType);
                SetLastResult(E_INVALID_ARG);
@@ -225,9 +243,9 @@ OnRotationRateDataEventReceived(unsigned long long timestamp, sensor_data_accura
        eventBuffer.isEventValid = IsAccuracyValid(accuracy);
        eventBuffer.eventType = _SENSOR_CORE_EVENT_TYPE_ROTATION_RATE_DATA;
        eventBuffer.eventTimestamp = CorrectTimestamp(timestamp);
-       eventBuffer.eventKind.rotationRateData.x = x * DEGREE_TO_RADIAN;
-       eventBuffer.eventKind.rotationRateData.y = y * DEGREE_TO_RADIAN;
-       eventBuffer.eventKind.rotationRateData.z = z * DEGREE_TO_RADIAN;
+       eventBuffer.eventKind.rotationRateData.x = x;
+       eventBuffer.eventKind.rotationRateData.y = y;
+       eventBuffer.eventKind.rotationRateData.z = z;
        receiver.OnSensorCoreEventReceived(eventBuffer);
 }
 
@@ -246,7 +264,56 @@ OnLightLevelDataEventReceived(unsigned long long timestamp, float lux, void* pUs
 void
 OnAccelerationSensorWakeupEventReceived(void *pUserData)
 {
-       SysLog(NID_UIX, "Device wake up by Acceleration sensor.");
+       SysLog(NID_UIX, " OnAccelerationSensorWakeupEventReceived Device wake up by Acceleration sensor.");
+}
+
+void
+OnGravityDataEventReceived(unsigned long long timestamp, sensor_data_accuracy_e accuracy,float x, float y, float z, void* pUserData)
+{
+       _ISensorCoreEventReceiver& receiver= *static_cast<_ISensorCoreEventReceiver*>(pUserData);
+       _SensorCoreEvent& eventBuffer = receiver.GetSensorCoreEventBuffer();
+
+       SysLog(NID_UIX, "taehwan.son OnGravityDataEventReceived.");
+       eventBuffer.isEventValid = IsAccuracyValid(accuracy);
+       eventBuffer.eventType = _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA;
+       eventBuffer.eventTimestamp = CorrectTimestamp(timestamp);
+       eventBuffer.eventKind.gravityData.x = x;
+       eventBuffer.eventKind.gravityData.y = y;
+       eventBuffer.eventKind.gravityData.z = z;
+       receiver.OnSensorCoreEventReceived(eventBuffer);
+
+}
+
+void
+OnUserAccelerationDataEventReceived(unsigned long long timestamp, sensor_data_accuracy_e accuracy,float x, float y, float z, void* pUserData)
+{
+       _ISensorCoreEventReceiver& receiver= *static_cast<_ISensorCoreEventReceiver*>(pUserData);
+       _SensorCoreEvent& eventBuffer = receiver.GetSensorCoreEventBuffer();
+
+       SysLog(NID_UIX, "OnUserAccelerationDataEventReceived.");
+       eventBuffer.isEventValid = IsAccuracyValid(accuracy);
+       eventBuffer.eventType = _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA;
+       eventBuffer.eventTimestamp = CorrectTimestamp(timestamp);
+       eventBuffer.eventKind.userAccelerationData.x = x * METER_PER_SECOND_SQUARE_TO_G;
+       eventBuffer.eventKind.userAccelerationData.y = y * METER_PER_SECOND_SQUARE_TO_G;
+       eventBuffer.eventKind.userAccelerationData.z = z * METER_PER_SECOND_SQUARE_TO_G;
+       receiver.OnSensorCoreEventReceived(eventBuffer);
+}
+
+void
+OnDeviceOrientationDataEventReceived(unsigned long long timestamp, sensor_data_accuracy_e accuracy,float yaw, float pitch, float roll, void* pUserData)
+{
+       _ISensorCoreEventReceiver& receiver= *static_cast<_ISensorCoreEventReceiver*>(pUserData);
+       _SensorCoreEvent& eventBuffer = receiver.GetSensorCoreEventBuffer();
+
+       SysLog(NID_UIX, "OnDeviceOrientationDataEventReceived.");
+       eventBuffer.isEventValid = IsAccuracyValid(accuracy);
+       eventBuffer.eventType = _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA;
+       eventBuffer.eventTimestamp = CorrectTimestamp(timestamp);
+       eventBuffer.eventKind.deviceOrientationData.yaw = yaw;
+       eventBuffer.eventKind.deviceOrientationData.pitch = pitch;
+       eventBuffer.eventKind.deviceOrientationData.roll = roll;
+       receiver.OnSensorCoreEventReceived(eventBuffer);
 }
 
 // Internal management methods ----------------------------------------------------------------------------------------------- //
@@ -344,6 +411,21 @@ PrepareSensorCoreEventSensing(sensor_h sensorHandle, _SensorCoreEventType eventT
                        sensorResult = sensor_awake_set_cb(sensorHandle, SENSOR_ACCELEROMETER, OnAccelerationSensorWakeupEventReceived, pUserData);
                        break;
                }
+       case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+               {
+                       sensorResult = sensor_gravity_set_cb(sensorHandle, interval, OnGravityDataEventReceived, pUserData);
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+               {
+                       sensorResult = sensor_linear_acceleration_set_cb(sensorHandle, interval, OnUserAccelerationDataEventReceived, pUserData);
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+               {
+                       sensorResult = sensor_device_orientation_set_cb(sensorHandle, interval, OnDeviceOrientationDataEventReceived, pUserData);
+                       break;
+               }
        default:
                {
                        // PARADOX
@@ -420,6 +502,21 @@ UnprepareSensorCoreEventSensing(sensor_h sensorHandle, _SensorCoreEventType even
                        sensorResult = sensor_awake_unset_cb(sensorHandle, SENSOR_ACCELEROMETER);
                        break;
                }
+       case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+               {
+                       sensorResult = sensor_gravity_unset_cb(sensorHandle);
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+               {
+                       sensorResult = sensor_linear_acceleration_unset_cb(sensorHandle);
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+               {
+                       sensorResult = sensor_device_orientation_unset_cb(sensorHandle);
+                       break;
+               }
        default:
                {
                        // PARADOX
@@ -452,129 +549,94 @@ UnprepareSensorCoreEventSensing(sensor_h sensorHandle, _SensorCoreEventType even
 }
 
 result
+StartSensorType(sensor_h sensorHandle, sensor_type_e sensorTypeE)
+{
+       int sensorResult = sensor_start(sensorHandle, sensorTypeE);
+       if (!IsSuccess(sensorResult))
+       {
+               // SENSOR_ERROR_IO_ERROR or SENSOR_ERROR_OPERATION_FAILED
+               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
+               {
+                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+                       SetLastResult(E_DEVICE_UNAVAILABLE);
+                       return E_DEVICE_UNAVAILABLE;
+               }
+               else
+               {
+                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+                       SetLastResult(E_OPERATION_FAILED);
+                       return E_OPERATION_FAILED;
+               }
+       }
+
+       sensorResult = sensor_set_always_on(sensorHandle, sensorTypeE);
+       if (!IsSuccess(sensorResult))
+       {
+               // SENSOR_ERROR_IO_ERROR
+               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
+               {
+                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+                       SetLastResult(E_DEVICE_UNAVAILABLE);
+                       return E_DEVICE_UNAVAILABLE;
+               }
+               else
+               {
+                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+                       SetLastResult(E_OPERATION_FAILED);
+                       return E_OPERATION_FAILED;
+               }
+       }
+       return E_SUCCESS;
+}
+
+result
 StartSensorCoreEventSensing(sensor_h sensorHandle, _SensorCoreEventType eventType)
 {
        switch (eventType)
        {
        case _SENSOR_CORE_EVENT_TYPE_TILT_DATA:
                {
-                       int sensorResult = sensor_start(sensorHandle, SENSOR_ACCELEROMETER);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               // SENSOR_ERROR_IO_ERROR or SENSOR_ERROR_OPERATION_FAILED
-                               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-                       }
-
-                       sensorResult = sensor_start(sensorHandle, SENSOR_ORIENTATION);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               // SENSOR_ERROR_IO_ERROR or SENSOR_ERROR_OPERATION_FAILED
-                               sensor_stop(sensorHandle, SENSOR_ACCELEROMETER);
-
-                               if(_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-
-                       }
-                       sensorResult = sensor_set_always_on(sensorHandle, SENSOR_ACCELEROMETER);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               // SENSOR_ERROR_IO_ERROR
-                               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-                       }
-                       sensorResult = sensor_set_always_on(sensorHandle, SENSOR_ORIENTATION);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               // SENSOR_ERROR_IO_ERROR
-                               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-
-                       }
+                       StartSensorType(sensorHandle,SENSOR_ACCELEROMETER);
+                       StartSensorType(sensorHandle,SENSOR_ORIENTATION);
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+               {
+                       SysLog(NID_UIX,"taehwan.son ");
+                       StartSensorType(sensorHandle,SENSOR_GRAVITY);
                        break;
                }
        default:
                {
                        sensor_type_e sensorTypeE = GetSensorTypeEFromSensorCoreEventType(eventType);
-
-                       int sensorResult = sensor_start(sensorHandle, sensorTypeE);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               // SENSOR_ERROR_IO_ERROR or SENSOR_ERROR_OPERATION_FAILED
-                               if(_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_start() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-                       }
-                       sensorResult = sensor_set_always_on(sensorHandle, sensorTypeE);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               // SENSOR_ERROR_IO_ERROR
-                               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_set_always_on() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-                       }
+                       StartSensorType(sensorHandle,sensorTypeE);
                        break;
                }
        }
+       return E_SUCCESS;
+}
+
+result
+StopSensorType(sensor_h sensorHandle,  sensor_type_e sensorTypeE)
+{
+       int sensorResult = sensor_stop(sensorHandle,sensorTypeE );
+       if (!IsSuccess(sensorResult))
+       {
+               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
+               {
+                       // SENSOR_ERROR_IO_ERROR
+                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+                       SetLastResult(E_DEVICE_UNAVAILABLE);
+                       return E_DEVICE_UNAVAILABLE;
+               }
+               else
+               {
+                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
+                       SetLastResult(E_OPERATION_FAILED);
+                       return E_OPERATION_FAILED;
+               }
 
+       }
        return E_SUCCESS;
 }
 
@@ -585,66 +647,19 @@ StopSensorCoreEventSensing(sensor_h sensorHandle, _SensorCoreEventType eventType
        {
        case _SENSOR_CORE_EVENT_TYPE_TILT_DATA:
                {
-                       int sensorResult = sensor_stop(sensorHandle, SENSOR_ORIENTATION);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               // SENSOR_ERROR_IO_ERROR
-                               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ORIENTATION, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-
-                       }
-
-                       sensorResult = sensor_stop(sensorHandle, SENSOR_ACCELEROMETER);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       // SENSOR_ERROR_IO_ERROR
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StartSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, SENSOR_ACCELEROMETER, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-
-                       }
+                       StopSensorType(sensorHandle,SENSOR_ORIENTATION );
+                       StopSensorType(sensorHandle,SENSOR_ACCELEROMETER );
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+               {
+                       StopSensorType(sensorHandle,SENSOR_GRAVITY);
                        break;
                }
        default:
                {
                        sensor_type_e sensorTypeE = GetSensorTypeEFromSensorCoreEventType(eventType);
-
-                       int sensorResult = sensor_stop(sensorHandle, sensorTypeE);
-                       if (!IsSuccess(sensorResult))
-                       {
-                               if (_AppInfo::GetApiVersion() == Tizen::Base::_API_VERSION_2_0 && _AppInfo::IsOspCompat())
-                               {
-                                       SysAssertf(false, "StopSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
-                                       SetLastResult(E_DEVICE_UNAVAILABLE);
-                                       return E_DEVICE_UNAVAILABLE;
-                               }
-                               else
-                               {
-                                       SysAssertf(false, "StopSensorCoreEventSensing() > sensor_stop() failed. [handle:%p, sensorTypeE:%d, result:%d]", sensorHandle, sensorTypeE, sensorResult);
-                                       SetLastResult(E_OPERATION_FAILED);
-                                       return E_OPERATION_FAILED;
-                               }
-                               // SENSOR_ERROR_IO_ERROR
-                       }
+                       StopSensorType(sensorHandle,sensorTypeE);
                        break;
                }
        }
@@ -693,6 +708,21 @@ ResetSensorCoreDataEventSensingInterval(sensor_h sensorHandle, _SensorCoreEventT
                        sensorResult = sensor_light_set_interval(sensorHandle, interval);
                        break;
                }
+       case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+               {
+                       sensorResult = sensor_gravity_set_interval(sensorHandle, interval);
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+               {
+                       sensorResult = sensor_gravity_set_interval(sensorHandle, interval);
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+               {
+                       sensorResult = sensor_gravity_set_interval(sensorHandle, interval);
+                       break;
+               }
        default:
                {
                        // PARADOX
index aaa88e8..a185d78 100644 (file)
@@ -96,6 +96,16 @@ _MotionImpl::__MotionEventReceiver(unsigned int eventType, sensor_event_data_t*
 
         }
         break;
+
+        case MOTION_ENGINE_EVENT_DIRECT_CALL:
+               {
+                       SysLog(NID_UIX, "Detected MOVE_TO_EAR event(%d)\n", eventData);
+
+                       if (eventData == MOTION_ENGINE_DIRECT_CALL_DETECTION)
+                               pMotionEventListener->OnMoveToEarDetected();
+
+               }
+               break;
         }
     }
 }
@@ -205,6 +215,27 @@ _MotionImpl::SetEnabled(unsigned long type)
             SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion double tap event.");
         }
     }
+
+    if (type & MOTION_TYPE_MOVE_TO_EAR)
+       {
+           if (__motionType & MOTION_TYPE_MOVE_TO_EAR)
+           {
+               SysLog(NID_UIX, "MOTION_TYPE_MOVE_TO_EAR is already registered.");
+           }
+           else
+           {
+               ret = sf_register_event(__handle, MOTION_ENGINE_EVENT_DIRECT_CALL, null, __MotionEventReceiver, (void*) __pIMotionEventListener);
+               SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to register motion direct call event.");
+           }
+       }
+       else
+       {
+           if (__motionType & MOTION_TYPE_MOVE_TO_EAR)
+           {
+               ret = sf_unregister_event(__handle, MOTION_ENGINE_EVENT_DIRECT_CALL);
+               SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion direct call event.");
+           }
+       }
     __motionType = type;
 
     SetLastResult(E_SUCCESS);
@@ -222,6 +253,9 @@ _MotionImpl::IsSupported(MotionType type) const
     case MOTION_TYPE_SHAKE:
         // fall through
     case MOTION_TYPE_DOUBLETAP:
+        // fall through
+    case MOTION_TYPE_MOVE_TO_EAR:
+
         isSupported = true;
         break;
 
@@ -238,7 +272,7 @@ _MotionImpl::IsSupported(MotionType type) const
 bool
 _MotionImpl::IsMotionTypeValid(unsigned long type)
 {
-       if (type > MOTION_TYPE_NONE && type <= (MOTION_TYPE_SNAP | MOTION_TYPE_SHAKE | MOTION_TYPE_DOUBLETAP))
+       if (type > MOTION_TYPE_NONE && type <= (MOTION_TYPE_SNAP | MOTION_TYPE_SHAKE | MOTION_TYPE_DOUBLETAP | MOTION_TYPE_MOVE_TO_EAR))
        {
                return true;
        }
index c9b60f4..6811189 100644 (file)
@@ -38,6 +38,9 @@ enum _SensorCoreEventType
        _SENSOR_CORE_EVENT_TYPE_ROTATION_RATE_DATA,
        _SENSOR_CORE_EVENT_TYPE_LIGHT_LEVEL_DATA,
        _SENSOR_CORE_EVENT_TYPE_ACCELERATION_SENSOR_WAKEUP,
+       _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA,
+       _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA,
+       _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA,
        _SENSOR_CORE_EVENT_TYPE_MAX,
        _SENSOR_CORE_EVENT_TYPE_NONE = -1,
 };
@@ -78,6 +81,14 @@ struct _SensorCoreEventTiltAxisOf3Dimension
        float azimuth;
 };
 
+struct _SensorCoreEventDeviceOrientationAxisOf3Dimension
+{
+       float yaw;
+       float roll;
+       float pitch;
+};
+
+
 struct _SensorCoreEventLevel
 {
        float level;
@@ -92,6 +103,9 @@ union _SensorCoreEventKind
        _SensorCoreEventTiltAxisOf3Dimension tiltData;
        _SensorCoreEventAxisOf3Dimension rotationRateData;
        _SensorCoreEventLevel lightLevelData;
+       _SensorCoreEventAxisOf3Dimension gravityData;
+       _SensorCoreEventAxisOf3Dimension userAccelerationData;
+       _SensorCoreEventDeviceOrientationAxisOf3Dimension deviceOrientationData;
 };
 
 struct _SensorCoreEvent
index 09d6fe0..be5a6eb 100644 (file)
 #include <FUixSensorTiltSensorData.h>
 #include <FUixSensorGyroSensorData.h>
 #include <FUixSensorLightSensorData.h>
+#include <FUixSensorGravitySensorData.h>
+#include <FUixSensorUserAccelerationSensorData.h>
+#include <FUixSensorDeviceOrientationSensorData.h>
+
 #include <FUixSensorISensorEventListener.h>
 
 #include "FUixSensor_SensorEventDeliverer.h"
@@ -146,6 +150,12 @@ ConvertToSensorCoreDataEventTypeFromSensorType(SensorType sensorType)
                return _SENSOR_CORE_EVENT_TYPE_ROTATION_RATE_DATA;
        case SENSOR_TYPE_LIGHT:
                return _SENSOR_CORE_EVENT_TYPE_LIGHT_LEVEL_DATA;
+       case SENSOR_TYPE_GRAVITY:
+                       return _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA;
+       case SENSOR_TYPE_USER_ACCELERATION:
+                       return _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA;
+       case SENSOR_TYPE_DEVICE_ORIENTATION:
+                       return _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA;
        default:
                SysAssertf(false, "ConvertToSensorCoreEventTypeFromSensorType() > Invalid SensorType [sensorType:%d]", sensorType);
                return _SENSOR_CORE_EVENT_TYPE_NONE;
@@ -226,6 +236,36 @@ IsSensorCoreEventChanged(_SensorCoreEventType eventType, _SensorCoreEvent& befor
                        }
                        break;
                }
+       case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+               {
+                       if (IsEquals(before.eventKind.gravityData.x, after.eventKind.gravityData.x) &&
+                               IsEquals(before.eventKind.gravityData.y, after.eventKind.gravityData.y) &&
+                               IsEquals(before.eventKind.gravityData.z, after.eventKind.gravityData.z))
+                       {
+                               return false;
+                       }
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+               {
+                       if (IsEquals(before.eventKind.userAccelerationData.x, after.eventKind.userAccelerationData.x) &&
+                               IsEquals(before.eventKind.userAccelerationData.y, after.eventKind.userAccelerationData.y) &&
+                               IsEquals(before.eventKind.userAccelerationData.z, after.eventKind.userAccelerationData.z))
+                       {
+                               return false;
+                       }
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+               {
+                       if (IsEquals(before.eventKind.deviceOrientationData.yaw, after.eventKind.deviceOrientationData.yaw) &&
+                               IsEquals(before.eventKind.deviceOrientationData.roll, after.eventKind.deviceOrientationData.roll) &&
+                               IsEquals(before.eventKind.deviceOrientationData.pitch, after.eventKind.deviceOrientationData.pitch))
+                       {
+                               return false;
+                       }
+                       break;
+               }
        default:
                {
                        SysAssertf(false, "IsSensorCoreEventChanged() > Invalid _SensorCoreEventType [eventType:%d]", eventType);
@@ -344,6 +384,27 @@ _SensorEventDeliverer::OnSensorCoreEventReceived(_SensorCoreEvent& event)
                        static_cast<LightSensorData&>(sensorDataBuffer).level = event.eventKind.lightLevelData.level;
                        break;
                }
+       case _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA:
+               {
+                       static_cast<GravitySensorData&>(sensorDataBuffer).x = event.eventKind.gravityData.x;
+                       static_cast<GravitySensorData&>(sensorDataBuffer).y = event.eventKind.gravityData.y;
+                       static_cast<GravitySensorData&>(sensorDataBuffer).z = event.eventKind.gravityData.z;
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA:
+               {
+                       static_cast<UserAccelerationSensorData&>(sensorDataBuffer).x = event.eventKind.userAccelerationData.x;
+                       static_cast<UserAccelerationSensorData&>(sensorDataBuffer).y = event.eventKind.userAccelerationData.y;
+                       static_cast<UserAccelerationSensorData&>(sensorDataBuffer).z = event.eventKind.userAccelerationData.z;
+                       break;
+               }
+       case _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA:
+               {
+                       static_cast<DeviceOrientationSensorData&>(sensorDataBuffer).yaw = event.eventKind.deviceOrientationData.yaw;
+                       static_cast<DeviceOrientationSensorData&>(sensorDataBuffer).roll = event.eventKind.deviceOrientationData.roll;
+                       static_cast<DeviceOrientationSensorData&>(sensorDataBuffer).pitch = event.eventKind.deviceOrientationData.pitch;
+                       break;
+               }
        default:
                {
                        SysAssertf(false, "OnSensorCoreEventReceived() > Invalid _SensorCoreEventType [eventType:%d]", eventType);
index efec9ce..c58008f 100644 (file)
@@ -38,6 +38,9 @@
 #include <FUixSensorTiltSensorData.h>
 #include <FUixSensorGyroSensorData.h>
 #include <FUixSensorLightSensorData.h>
+#include <FUixSensorGravitySensorData.h>
+#include <FUixSensorUserAccelerationSensorData.h>
+#include <FUixSensorDeviceOrientationSensorData.h>
 
 #include <FApp_AppInfo.h>
 #include <FUixSensor_SensorManagerImpl.h>
@@ -72,6 +75,12 @@ CreateSensorDataDelivererN(SensorType sensorType)
                return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<GyroSensorData>();
        case SENSOR_TYPE_LIGHT:
                return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<LightSensorData>();
+       case SENSOR_TYPE_GRAVITY:
+               return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<GravitySensorData>();
+       case SENSOR_TYPE_USER_ACCELERATION:
+               return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<UserAccelerationSensorData>();
+       case SENSOR_TYPE_DEVICE_ORIENTATION:
+               return new (std::nothrow) _SpecifiedSensorDataEventDelivererT<DeviceOrientationSensorData>();
        default:
                SysAssertf(false, "CreateSensorDataDelivererN() > Invalid SensorType [sensorType:%d]", sensorType);
                return null;