From 5e1bdae34dd45344b18109af1e8afd44e0995314 Mon Sep 17 00:00:00 2001 From: howon kim Date: Wed, 11 Dec 2013 15:46:02 +0900 Subject: [PATCH] Merge commits Tizen 2.2 to Tizen 2.2.1 Change-Id: I81bb777ce0e2cde0e50617087de521393ac58ac1 Signed-off-by: howon kim --- LICENSE.Flora | 26 +-- NOTICE | 4 +- inc/FUix.h | 6 +- inc/FUixSensor.h | 4 +- inc/FUixSensorAccelerationSensorData.h | 17 +- inc/FUixSensorDeviceOrientationSensorData.h | 17 +- inc/FUixSensorGravitySensorData.h | 17 +- inc/FUixSensorGyroSensorData.h | 15 +- inc/FUixSensorISensorEventListener.h | 5 +- inc/FUixSensorLightSensorData.h | 15 +- inc/FUixSensorMagneticSensorData.h | 15 +- inc/FUixSensorMotion.h | 19 +- inc/FUixSensorMotionCommon.h | 16 +- inc/FUixSensorProximitySensorData.h | 15 +- inc/FUixSensorSensorData.h | 17 +- inc/FUixSensorSensorManager.h | 327 ++++++++++++++-------------- inc/FUixSensorSensorTypes.h | 12 +- inc/FUixSensorTiltSensorData.h | 15 +- inc/FUixSensorUserAccelerationSensorData.h | 13 +- src/FUixSensorSensorManager.cpp | 2 +- src/FUixSensor_ISensorCore.cpp | 2 +- src/FUixSensor_ISensorCore.h | 2 +- src/FUixSensor_MotionImpl.cpp | 250 ++++++++++++--------- src/FUixSensor_SensorCoreEventTypes.h | 2 +- src/FUixSensor_SensorEventDeliverer.cpp | 2 +- src/FUixSensor_SensorEventDeliverer.h | 2 +- src/FUixSensor_SensorManagerImpl.cpp | 2 +- src/inc/FUixSensor_MotionImpl.h | 10 +- src/inc/FUixSensor_SensorManagerImpl.h | 2 +- 29 files changed, 431 insertions(+), 420 deletions(-) mode change 100644 => 100755 src/FUixSensor_MotionImpl.cpp diff --git a/LICENSE.Flora b/LICENSE.Flora index fd90a36..571fe79 100644 --- a/LICENSE.Flora +++ b/LICENSE.Flora @@ -1,6 +1,6 @@ Flora License -Version 1.0, April, 2013 +Version 1.1, April, 2013 http://floralicense.org/license/ @@ -119,17 +119,17 @@ Object form, provided that You meet the following conditions: Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only - and do not modify the License. - -You may add Your own attribution notices within Derivative Works -that You distribute, alongside or as an addendum to the NOTICE text -from the Work, provided that such additional attribution notices -cannot be construed as modifying the License. You may add Your own -copyright statement to Your modifications and may provide additional or -different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works -as a whole, provided Your use, reproduction, and distribution of -the Work otherwise complies with the conditions stated in this License. + and do not modify the License. You may add Your own attribution notices + within Derivative Works that You distribute, alongside or as an addendum + to the NOTICE text from the Work, provided that such additional attribution + notices cannot be construed as modifying the License. You may add Your own + copyright statement to Your modifications and may provide additional or + different license terms and conditions for use, reproduction, or + distribution of Your modifications, or for any such Derivative Works + as a whole, provided Your use, reproduction, and distribution of + the Work otherwise complies with the conditions stated in this License + and your own copyright statement or terms and conditions do not conflict + the conditions stated in the License including section 3. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work @@ -192,7 +192,7 @@ identification within third-party archives. Copyright [yyyy] [name of copyright owner] - Licensed under the Flora License, Version 1.0 (the "License"); + Licensed under the Flora License, Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/NOTICE b/NOTICE index f51fb7c..3a382ef 100644 --- a/NOTICE +++ b/NOTICE @@ -3,6 +3,6 @@ Except as noted, this software is licensed under Apache License, Version 2. Please, see the LICENSE.APLv2 file for Apache License terms and conditions. Several source codes may have its original copyright owner and/or -be licensed under other than Apache License, Version 2, say, Flora License, Version 1. +be licensed under other than Apache License, Version 2, say, Flora License, Version 1.1. Please, see copyright and license comments section in the header of each file, -and the LICENSE.Flora for Flora License terms and conditions. \ No newline at end of file +and the LICENSE.Flora for Flora License, Version 1.1 terms and conditions. \ No newline at end of file diff --git a/inc/FUix.h b/inc/FUix.h index bd60c49..8946cea 100755 --- a/inc/FUix.h +++ b/inc/FUix.h @@ -31,14 +31,14 @@ /** * @namespace Tizen::Uix - * @brief This namespace contains the %Ui extension classes and the %Tizen interfaces. + * @brief This namespace contains %Ui extension classes and %Tizen interfaces. * @since 2.0 * * @remarks @b Header @b %file: @b \#include @b @n * - * The %Uix namespace contains classes and interfaces for the UI extension services, which cover unconventional user interface + * The %Uix namespace contains classes and interfaces for UI extension services, which cover unconventional user interface * features not included in the basic UI namespace, such as vision based recognition, device sensor input and motion - * detection, and speech recognition and synthesis. + * detection, as well as speech recognition and synthesis. * @n * For more information on the %Uix namespace features, see Uix Guide. * diff --git a/inc/FUixSensor.h b/inc/FUixSensor.h index 7023ddf..e522131 100755 --- a/inc/FUixSensor.h +++ b/inc/FUixSensor.h @@ -46,9 +46,9 @@ * @since 2.0 * * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix + * @b Library: @b osp-uix * - * The %Sensor namespace contains classes and interfaces for the %Sensor services, user control sensor and access data of each sensor. + * The %Sensor namespace contains classes and interfaces for %Sensor services, user control sensor and access data of each sensor. * * * The following diagram illustrates the relationships between the classes belonging to the %Sensor namespace. diff --git a/inc/FUixSensorAccelerationSensorData.h b/inc/FUixSensorAccelerationSensorData.h index da6b829..75986d1 100644 --- a/inc/FUixSensorAccelerationSensorData.h +++ b/inc/FUixSensorAccelerationSensorData.h @@ -36,11 +36,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %AccelerationSensorData class stores acceleration sensor data, including a time stamp. - * @n + * * For more information on the class features, see Sensor Manager. */ class _OSP_EXPORT_ AccelerationSensorData @@ -66,7 +63,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %AccelerationSensorData + * @param[in] rhs An instance of %AccelerationSensorData to copy */ AccelerationSensorData(const AccelerationSensorData& rhs); @@ -75,9 +72,9 @@ public: * * @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 + * @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; @@ -96,8 +93,8 @@ public: * * @since 2.1 * - * @return A reference to this instance - * @param[in] rhs An instance of %AccelerationSensorData + * @return A reference to this instance + * @param[in] rhs An instance of %AccelerationSensorData to copy */ AccelerationSensorData& operator =(const AccelerationSensorData& rhs); diff --git a/inc/FUixSensorDeviceOrientationSensorData.h b/inc/FUixSensorDeviceOrientationSensorData.h index 85181d3..34b7df6 100644 --- a/inc/FUixSensorDeviceOrientationSensorData.h +++ b/inc/FUixSensorDeviceOrientationSensorData.h @@ -36,11 +36,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.1 * - * @remarks @b Header @b %file: @b \#include @b @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 Sensor Manager. */ class _OSP_EXPORT_ DeviceOrientationSensorData @@ -66,7 +63,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %DeviceOrientationSensorData + * @param[in] rhs An instance of %DeviceOrientationSensorData to copy */ DeviceOrientationSensorData(const DeviceOrientationSensorData& rhs); @@ -75,10 +72,10 @@ public: * * @since 2.1 * - * @return @c true if all the fields in the objects are equal, @n - * else @c false + * @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. + * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons. */ virtual bool Equals(const Tizen::Base::Object& rhs) const; @@ -96,8 +93,8 @@ public: * * @since 2.1 * - * @return A reference to this instance - * @param[in] rhs An instance of %DeviceOrientationSensorData + * @return A reference to this instance + * @param[in] rhs An instance of %DeviceOrientationSensorData to copy */ DeviceOrientationSensorData& operator =(const DeviceOrientationSensorData& rhs); diff --git a/inc/FUixSensorGravitySensorData.h b/inc/FUixSensorGravitySensorData.h index 00a4f7c..7491b3d 100644 --- a/inc/FUixSensorGravitySensorData.h +++ b/inc/FUixSensorGravitySensorData.h @@ -36,11 +36,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.1 * - * @remarks @b Header @b %file: @b \#include @b @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 Sensor Manager. */ class _OSP_EXPORT_ GravitySensorData @@ -66,7 +63,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %GravitySensorData + * @param[in] rhs An instance of %GravitySensorData to copy */ GravitySensorData(const GravitySensorData& rhs); @@ -76,9 +73,9 @@ public: * @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. + * 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; @@ -96,8 +93,8 @@ public: * * @since 2.1 * - * @return A reference to this instance - * @param[in] rhs An instance of %GravitySensorData + * @return A reference to this instance + * @param[in] rhs An instance of %GravitySensorData to copy */ GravitySensorData& operator =(const GravitySensorData& rhs); diff --git a/inc/FUixSensorGyroSensorData.h b/inc/FUixSensorGyroSensorData.h index 6ad5038..7375c99 100644 --- a/inc/FUixSensorGyroSensorData.h +++ b/inc/FUixSensorGyroSensorData.h @@ -36,11 +36,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %GyroSensorData class stores gyro sensor data, including a time stamp. - * @n + * * For more information on the class features, see Sensor Manager. */ class _OSP_EXPORT_ GyroSensorData @@ -66,7 +63,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %GyroSensorData + * @param[in] rhs An instance of %GyroSensorData to copy */ GyroSensorData(const GyroSensorData& rhs); @@ -76,9 +73,9 @@ public: * @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. + * 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; @@ -97,7 +94,7 @@ public: * @since 2.1 * * @return A reference to this instance - * @param[in] rhs An instance of %GyroSensorData + * @param[in] rhs An instance of %GyroSensorData to copy */ GyroSensorData& operator =(const GyroSensorData& rhs); diff --git a/inc/FUixSensorISensorEventListener.h b/inc/FUixSensorISensorEventListener.h index e8f3a5d..6b50e3f 100644 --- a/inc/FUixSensorISensorEventListener.h +++ b/inc/FUixSensorISensorEventListener.h @@ -38,12 +38,9 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %ISensorEventListener interface is an event listener used to receive sensor data asynchronously. * It provides methods that are invoked when the sensor data is received from the device. - * @n + * * For more information on the class features, see Sensor Manager. */ class _OSP_EXPORT_ ISensorEventListener diff --git a/inc/FUixSensorLightSensorData.h b/inc/FUixSensorLightSensorData.h index 2bd795d..f8276ab 100644 --- a/inc/FUixSensorLightSensorData.h +++ b/inc/FUixSensorLightSensorData.h @@ -36,11 +36,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %LightSensorData class stores light sensor data, including a time stamp. - * @n + * * For more information on the class features, see Sensor Manager. */ class _OSP_EXPORT_ LightSensorData @@ -66,7 +63,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %LightSensorData + * @param[in] rhs An instance of %LightSensorData to copy */ LightSensorData(const LightSensorData& rhs); @@ -76,9 +73,9 @@ public: * @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. + * 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; @@ -97,7 +94,7 @@ public: * @since 2.1 * * @return A reference to this instance - * @param[in] rhs An instance of %LightSensorData + * @param[in] rhs An instance of %LightSensorData to copy */ LightSensorData& operator =(const LightSensorData& rhs); diff --git a/inc/FUixSensorMagneticSensorData.h b/inc/FUixSensorMagneticSensorData.h index ac9cd6a..db2f262 100644 --- a/inc/FUixSensorMagneticSensorData.h +++ b/inc/FUixSensorMagneticSensorData.h @@ -36,11 +36,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %MagneticSensorData class stores magnetic sensor data, including a time stamp. - * @n + * * For more information on the class features, see Sensor Manager. */ class _OSP_EXPORT_ MagneticSensorData @@ -66,7 +63,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %MagneticSensorData + * @param[in] rhs An instance of %MagneticSensorData to copy */ MagneticSensorData(const MagneticSensorData& rhs); @@ -76,9 +73,9 @@ public: * @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. + * 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; @@ -97,7 +94,7 @@ public: * @since 2.1 * * @return A reference to this instance - * @param[in] rhs An instance of %MagneticSensorData + * @param[in] rhs An instance of %MagneticSensorData to copy */ MagneticSensorData& operator =(const MagneticSensorData& rhs); diff --git a/inc/FUixSensorMotion.h b/inc/FUixSensorMotion.h index 0ed2a9d..ebd4b5d 100644 --- a/inc/FUixSensorMotion.h +++ b/inc/FUixSensorMotion.h @@ -37,16 +37,13 @@ class _MotionImpl; /** * @class Motion - * @brief This class is used to probe the state or to receive an event about the conceptual states of the device's movement. + * @brief This class is used to probe the state or receive an event about the conceptual states of the device's movement. * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %Motion class allows an application to know about the movement of the device. The information is given in 2 ways: * the application probes the state or the application registers a listener and receives an event when a movement is observed. - * @n + * * For more information on the class features, see Device Motions. * * The following example demonstrates how to use the %Motion class to register a motion event listener and receive motion events. @@ -63,7 +60,7 @@ class _MotionImpl; * void OnSnapDetected(Tizen::Uix::Sensor::MotionSnapType snapType); * * private: - * Tizen::Uix::Motion* pMotion; + * Tizen::Uix::Sensor::Motion* pMotion; * }; * * result MotionExample::Initialize(void) @@ -133,8 +130,8 @@ public: /** * Sets the motion event type. @n - * If the %SetEnabled() method is not called, then by default all the motion event types will be captured by the listener. - * If the motion events are not be captured, this method can be called with @c type set to @c MOTION_TYPE_NONE. + * If the %SetEnabled() method is not called, then by default all the motion event types are captured by the listener. + * If the motion events are not to be captured, this method can be called with @c type set to @c MOTION_TYPE_NONE. * * @since 2.0 * @@ -142,14 +139,14 @@ 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. + * @exception E_INVALID_ARG The specified input parameter is invalid. * @remarks The specific error code can be accessed using the GetLastResult() method. */ void SetEnabled(unsigned long type); /** - * Checks whether the specified @c MotionType is supported. @n - * @c MOTION_TYPE_NONE and @c MOTION_TYPE_ALL are invalid, and @c false will be returned for these types. + * Checks whether the specified @c type is supported. @n + * @c MOTION_TYPE_NONE and @c MOTION_TYPE_ALL are unsupported types, and @c false is returned for these types. * * @since 2.0 * diff --git a/inc/FUixSensorMotionCommon.h b/inc/FUixSensorMotionCommon.h index a73ef39..5eb1f11 100644 --- a/inc/FUixSensorMotionCommon.h +++ b/inc/FUixSensorMotionCommon.h @@ -17,7 +17,7 @@ /** * @file FUixSensorMotionCommon.h - * @brief This is the header file for the declarations of the enumerations of the Sensor namespace. + * @brief This is the header file for the declarations of the enumerations of the %Sensor namespace. * * This header file contains the declarations of the enumerations of the Sensor namespace. */ @@ -39,19 +39,19 @@ namespace Tizen { namespace Uix { namespace Sensor */ enum MotionType { - MOTION_TYPE_NONE = 0x0000, /**< The motion type: None */ - 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_NONE = 0x0000, /**< The motion type: None */ + 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 */ + MOTION_TYPE_ALL = 0xFFFF, /**< The motion type: All */ }; /** * @enum MotionState * * Defines the state of motions. @n - * Some event can only be found in a subset of states described below. + * Some events can only be found in a subset of the states described below. * * @since 2.0 * @@ -62,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, /**< The specified motion has just canceled */ + MOTION_CANCELLED, /**< The specified motion has just cancelled */ }; /** diff --git a/inc/FUixSensorProximitySensorData.h b/inc/FUixSensorProximitySensorData.h index 7659bd3..925a8f3 100644 --- a/inc/FUixSensorProximitySensorData.h +++ b/inc/FUixSensorProximitySensorData.h @@ -36,11 +36,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %ProximitySensorData class stores proximity sensor data, including a time stamp. - * @n + * * For more information on the class features, see Sensor Manager. */ class _OSP_EXPORT_ ProximitySensorData @@ -76,7 +73,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %ProximitySensorData + * @param[in] rhs An instance of %ProximitySensorData to copy */ ProximitySensorData(const ProximitySensorData& rhs); @@ -86,9 +83,9 @@ public: * @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. + * 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; @@ -107,7 +104,7 @@ public: * @since 2.1 * * @return A reference to this instance - * @param[in] rhs An instance of %ProximitySensorData + * @param[in] rhs An instance of %ProximitySensorData to copy */ ProximitySensorData& operator =(const ProximitySensorData& rhs); diff --git a/inc/FUixSensorSensorData.h b/inc/FUixSensorSensorData.h index 1525cee..e9b2502 100644 --- a/inc/FUixSensorSensorData.h +++ b/inc/FUixSensorSensorData.h @@ -38,11 +38,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %SensorData class stores sensor data, including a time stamp. - * @n + * * For more information on the class features, see Sensor Manager. */ class _OSP_EXPORT_ SensorData @@ -64,39 +61,39 @@ public: virtual ~SensorData(void); /** - * Gets sensor data with @c long value as the key input. + * Gets the sensor data with a @c long value as the key input. * * @since 2.0 * * @return An error code * @param[in] dataKey The key to access the sensor data - * @param[out] value The @c long value representing the sensor data requested by the user + * @param[out] value The @c long value that represents the sensor data requested by the user * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The data matching the specified key and data type cannot be found. */ virtual result GetValue(SensorDataKey dataKey, long& value) const; /** - * Gets the sensor data with @c float value as the key input. + * Gets the sensor data with a @c float value as the key input. * * @since 2.0 * * @return An error code * @param[in] dataKey The key to access the sensor data - * @param[out] value The @c float value representing the sensor data requested by the user + * @param[out] value The @c float value that represents the sensor data requested by the user * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The data matching the specified key and data type cannot be found. */ virtual result GetValue(SensorDataKey dataKey, float& value) const; /** - * Gets the sensor data with @c bool value as the key input. + * Gets the sensor data with a @c bool value as the key input. * * @since 2.0 * * @return An error code * @param[in] dataKey The key to access the sensor data - * @param[out] value The @c bool value representing the sensor data requested by the user + * @param[out] value The @c bool value that represents the sensor data requested by the user * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The data matching the specified key and data type cannot be found. */ diff --git a/inc/FUixSensorSensorManager.h b/inc/FUixSensorSensorManager.h index 171fe64..7cc2309 100644 --- a/inc/FUixSensorSensorManager.h +++ b/inc/FUixSensorSensorManager.h @@ -44,12 +44,9 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %SensorManager class is used to receive and manage sensor data from the device, including adding or removing the sensor * listeners, checking sensor availability, setting intervals, and getting the maximum or minimum intervals. - * @n + * * For more information on the class features, see Sensor Manager. * * The following examples demonstrate how to use the %SensorManager class with the acceleration sensor. @@ -139,7 +136,7 @@ public: * * @since 2.0 * - * @remarks All listeners are removed + * @remarks All the listeners are removed * and the internally allocated memory block is deleted when the instance is destroyed. */ virtual ~SensorManager(void); @@ -166,7 +163,7 @@ public: * @endif * @since 2.0 * @if OSPCOMPAT - * @compatibility This method has compatibility issues with OSP compatible applications. @n + * @compatibility This method has compatibility issues with OSP compatible applications. @n * For more information, see @ref CompSensorManagerAddSensorListenerPage "here". * @endif * @return An error code @@ -177,9 +174,11 @@ public: * else @c false if the sensor data is received at every interval * @exception E_SUCCESS The method is successful. * @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 @c listener is already registered for the specified sensor type. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c interval is neither greater than the maximum interval nor less than the minimum interval. + * - The sensor type is invalid. + * @exception E_OPERATION_FAILED The operation has failed to add the sensor listener. + * @exception E_USER_ALREADY_REGISTERED The specified @c listener is already registered for the specified @c sensorType. * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ @@ -189,13 +188,13 @@ public: * @if OSPCOMPAT * @page CompSensorManagerAddSensorListenerPage Compatibility for AddSensorListener() * @section CompSensorManagerAddSensorListenerIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerAddSensorListenerSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -208,14 +207,14 @@ public: * @since 2.0 * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerRemoveSensorListenerPage "here". + * For more information, see @ref CompSensorManagerRemoveSensorListenerPage "here". * @endif * @return An error code - * @param[in] listener The listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c listener is not found in the listener list. - * @exception E_OPERATION_FAILED The operation has failed to remove sensor listeners. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @param[in] listener The listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c listener is not found in the listener list. + * @exception E_OPERATION_FAILED The operation has failed to remove sensor listeners. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ result RemoveSensorListener(ISensorEventListener& listener); @@ -224,13 +223,13 @@ public: * @if OSPCOMPAT * @page CompSensorManagerRemoveSensorListenerPage Compatibility for RemoveSensorListener() * @section CompSensorManagerRemoveSensorListenerIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerRemoveSensorListenerSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -244,14 +243,15 @@ public: * @since 2.0 * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerRemoveSensorListenerPage "here". + * For more information, see @ref CompSensorManagerRemoveSensorListenerPage "here". * @endif * @return An error code * @param[in] listener The listener to remove * @param[in] sensorType The sensor type * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c listener is not found in the listener list, - * or the specified type of sensor is not valid. + * @exception E_OBJ_NOT_FOUND Either of the following conditions has occurred: + * - The specified @c listener is not found in the listener list. + * - The specified @c sensorType is invalid. * @exception E_OPERATION_FAILED The operation has failed to remove the sensor listener. * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ @@ -260,21 +260,20 @@ public: /** * @if OSPCOMPAT * @page CompSensorManagerRemoveSensorListenerPage Compatibility for RemoveSensorListener () - * @section CompSensorManagerRemoveSensorListenerIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerRemoveSensorListenerIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerRemoveSensorListenerSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ /** - * @{ - * @if OSPDEPREC - * Sets an interval of a sensor. + * @cond OSPDEPREC + * Sets the interval of a sensor. * @if OSPCOMPAT * @brief [Deprecated] [Compatibility] * @endif @@ -283,20 +282,20 @@ public: * @since 2.0 * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerSetIntervalPage "here". + * For more information, see @ref CompSensorManagerSetIntervalPage "here". * @endif * @return An error code * @param[in] sensorType The sensor type * @param[in] interval The interval (in milliseconds) at which the sensor data is received * @exception E_SUCCESS The method is successful. - * @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 set interval of sensor. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c interval is neither greater than the maximum interval nor less than the minimum interval. + * - The specified @c sensorType is invalid. + * @exception E_OPERATION_FAILED The operation has failed to set the interval of the sensor. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. * @see SensorManager::GetMaxInterval() for getting the maximum intervals * @see SensorManager::GetMinInterval() for getting the minimum intervals - * @endif - * @} + * @endcond */ result SetInterval(SensorType sensorType, long interval); @@ -304,36 +303,38 @@ public: /** * @if OSPCOMPAT * @page CompSensorManagerSetIntervalPage Compatibility for SetInterval () - * @section CompSensorManagerSetIntervalIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerSetIntervalIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerSetIntervalSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ /** - * Sets an interval of a sensor using the specified @c listener. + * Sets the interval of a sensor using the specified @c listener. * @if OSPCOMPAT * @brief [Compatibility] * @endif * @since 2.0 * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerSetIntervalPage "here". + * For more information, see @ref CompSensorManagerSetIntervalPage "here". * @endif * @return An error code * @param[in] listener The added listener * @param[in] sensorType The sensor type * @param[in] interval The interval (in milliseconds) at which the sensor data is received * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG An interval must be greater than the maximum interval or less than the minimum interval, - * or the listener is not registered for this type of sensor, or the sensor type is invalid. - * @exception E_OPERATION_FAILED The operation has failed to set the interval of sensor. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c interval is neither greater than the maximum interval nor less than the minimum interval. + * - The listener is not registered for this type of sensor. + * - The specified @c sensorType is invalid. + * @exception E_OPERATION_FAILED The operation has failed to set the interval of the sensor. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. * @see SensorManager::GetMaxInterval() for getting the maximum intervals * @see SensorManager::GetMinInterval() for getting the minimum intervals */ @@ -342,14 +343,14 @@ public: /** * @if OSPCOMPAT * @page CompSensorManagerSetIntervalPage Compatibility for SetInterval () - * @section CompSensorManagerSetIntervalIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerSetIntervalIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerSetIntervalSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -361,13 +362,13 @@ public: * @since 2.0 * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerIsAvailablePage "here". + * For more information, see @ref CompSensorManagerIsAvailablePage "here". * @endif * @return @c true if the sensor type is available, @n * else @c false * @param[in] sensorType The sensor type * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The sensor type is invalid. + * @exception E_INVALID_ARG The sensor type is invalid. * @remarks The specific error code can be accessed using the GetLastResult() method. */ bool IsAvailable(SensorType sensorType) const; @@ -375,14 +376,14 @@ public: /** * @if OSPCOMPAT * @page CompSensorManagerIsAvailablePage Compatibility for IsAvailable () - * @section CompSensorManagerIsAvailableIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerIsAvailableIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerIsAvailableSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -394,29 +395,29 @@ public: * @since 2.0 * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerGetMinIntervalPage "here". + * For more information, see @ref CompSensorManagerGetMinIntervalPage "here". * @endif * @return An error code * @param[in] sensorType The sensor type * @param[out] interval The minimum interval in milliseconds * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The sensor type is invalid. - * @exception E_OPERATION_FAILED The operation has failed to get interval of sensor. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @exception E_OPERATION_FAILED The operation has failed to get interval of the sensor. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ result GetMinInterval(SensorType sensorType, long& interval) const; /** * @if OSPCOMPAT * @page CompSensorManagerGetMinIntervalPage Compatibility for GetMinInterval() - * @section CompSensorManagerGetMinIntervalIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerGetMinIntervalIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerGetMinIntervalSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -427,7 +428,7 @@ public: * @endif * @since 2.0 * @if OSPCOMPAT - * @compatibility This method has compatibility issues with OSP compatible applications. @n + * @compatibility This method has compatibility issues with OSP compatible applications. @n * For more information, see @ref CompSensorManagerGetMaxIntervalPage "here". * @endif * @return An error code @@ -435,22 +436,22 @@ public: * @param[out] interval The maximum interval in milliseconds * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The sensor type is invalid. - * @exception E_OPERATION_FAILED The operation has failed to get interval of sensor. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @exception E_OPERATION_FAILED The operation has failed to get interval of the sensor. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ result GetMaxInterval(SensorType sensorType, long& interval) const; /** * @if OSPCOMPAT * @page CompSensorManagerGetMaxIntervalPage Compatibility for GetMaxInterval() - * @section CompSensorManagerGetMaxIntervalIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerGetMaxIntervalIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerGetMaxIntervalSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -463,29 +464,29 @@ public: * * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerGetDescriptionPage "here". + * For more information, see @ref CompSensorManagerGetDescriptionPage "here". * @endif * @return An error code * @param[in] sensorType The sensor type * @param[out] description The sensor description * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The sensor type is invalid. - * @exception E_OPERATION_FAILED The operation has failed to get description of sensor. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @exception E_OPERATION_FAILED The operation has failed to get the description of the sensor. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ result GetDescription(SensorType sensorType, Tizen::Base::String& description) const; /** * @if OSPCOMPAT * @page CompSensorManagerGetDescriptionPage Compatibility for GetDescription() - * @section CompSensorManagerGetDescriptionIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerGetDescriptionIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerGetDescriptionSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -497,29 +498,29 @@ public: * @since 2.0 * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerGetVendorPage "here". + * For more information, see @ref CompSensorManagerGetVendorPage "here". * @endif * @return An error code * @param[in] sensorType The sensor type * @param[out] vendor The vendor information * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The sensor type is invalid. - * @exception E_OPERATION_FAILED The operation has failed to get vender information of sensor. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @exception E_OPERATION_FAILED The operation has failed to get the vendor information of the sensor. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ result GetVendor(SensorType sensorType, Tizen::Base::String& vendor) const; /** * @if OSPCOMPAT * @page CompSensorManagerGetVendorPage Compatibility for GetVendor() - * @section CompSensorManagerGetVendorIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerGetVendorIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerGetVendorSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -532,29 +533,29 @@ public: * * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerGetModelIdPage "here". + * For more information, see @ref CompSensorManagerGetModelIdPage "here". * @endif * @return An error code * @param[in] sensorType The sensor type * @param[out] modelId The model ID of the sensor hardware * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The sensor type is invalid. - * @exception E_OPERATION_FAILED The operation has failed to get the model ID of the sensor. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @exception E_OPERATION_FAILED The operation has failed to get the model ID of the sensor. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ result GetModelId(SensorType sensorType, Tizen::Base::String& modelId) const; /** * @if OSPCOMPAT * @page CompSensorManagerGetModelIdPage Compatibility for GetModelId() - * @section CompSensorManagerGetModelIdIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerGetModelIdIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerGetModelIdSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -567,7 +568,7 @@ public: * * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerGetMeasurementRangePage "here". + * For more information, see @ref CompSensorManagerGetMeasurementRangePage "here". * @endif * @return An error code * @param[in] sensorType The sensor type @@ -577,22 +578,22 @@ public: * This is a device specific characteristic. * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The sensor type is invalid. - * @exception E_OPERATION_FAILED The operation has failed. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. + * @exception E_OPERATION_FAILED The operation has failed. + * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor. */ result GetMeasurementRange(SensorType sensorType, float& min, float& max, float& resolution) const; /** * @if OSPCOMPAT * @page CompSensorManagerGetMeasurementRangePage Compatibility for GetMeasurementRange() - * @section CompSensorManagerGetMeasurementRangeIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. + * @section CompSensorManagerGetMeasurementRangeIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor. * * @section CompSensorManagerGetMeasurementRangeSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -606,33 +607,35 @@ public: * * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerIsWakeupSupportedPage "here". + * For more information, see @ref CompSensorManagerIsWakeupSupportedPage "here". * @endif * @return @c true if the sensor type supports the wake up feature while the device is in the sleep mode, @n - * else @c false if the wake up feature is not supported by the sensor or if the instance is not initialized properly - * @param[in] sensorType The sensor type - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The sensor type is invalid. - * @exception E_OPERATION_FAILED The operation has failed. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor,or @n - * the target device does not support wake-up feature originally or based on 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. + * else @c false if the wake up feature is not supported by the sensor or the instance is not initialized properly + * @param[in] sensorType The sensor type + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The sensor type is invalid. + * @exception E_OPERATION_FAILED The operation has failed. + * @exception E_UNSUPPORTED_OPERATION Either of the following conditions has occurred: + * - The target device does not support the specific sensor. + * - The target device does not support the wake-up feature originally or based on the specific sensor. + * @remarks + * - The specific error code can be accessed using the GetLastResult() method. + * - This method cannot be tested on the Emulator. It always returns @c true on the Emulator. */ bool IsWakeupSupported(SensorType sensorType) const; /** * @if OSPCOMPAT * @page CompSensorManagerIsWakeupSupportedPage Compatibility for IsWakeupSupported() - * @section CompSensorManagerIsWakeupSupportedIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensorl,or @n - * the target device does not support wake-up feature originally or based on the specific sensor. + * @section CompSensorManagerIsWakeupSupportedIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor or @n + * the target device does not support the wake-up feature originally or based on the specific sensor. * * @section CompSensorManagerIsWakeupSupportedSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -645,7 +648,7 @@ public: * * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerSetWakeupEnabledPage "here". + * For more information, see @ref CompSensorManagerSetWakeupEnabledPage "here". * @endif * @feature %http://tizen.org/feature/sensor.accelerometer.wakeup * @return An error code @@ -657,8 +660,9 @@ public: * @exception E_INVALID_STATE There is no sensor listener registered for this type. * @exception E_INVALID_ARG The sensor type is invalid. * @exception E_OPERATION_FAILED The operation has failed. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor,or @n - * the target device does not support wake-up feature originally or based on the specific sensor. + * @exception E_UNSUPPORTED_OPERATION Either of the following conditions has occurred: + * - The target device does not support the specific sensor. + * - The target device does not support the wake-up feature originally or based on the specific sensor. * @remarks * - The wake up feature is automatically disabled by the system as soon as the calling application is terminated. * - This method cannot be tested on the Emulator. It always returns @c E_SUCCESS on the Emulator. @@ -669,15 +673,15 @@ public: /** * @if OSPCOMPAT * @page CompSensorManagerSetWakeupEnabledPage Compatibility for SetWakeupEnabled() - * @section CompSensorManagerSetWakeupEnabledIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor,or @n - * the target device does not support wake-up feature originally or based on the specific sensor. + * @section CompSensorManagerSetWakeupEnabledIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor or @n + * the target device does not support the wake-up feature originally or based on the specific sensor. * * @section CompSensorManagerSetWakeupEnabledSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ @@ -690,7 +694,7 @@ public: * * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompSensorManagerIsWakeupEnabledPage "here". + * For more information, see @ref CompSensorManagerIsWakeupEnabledPage "here". * @endif * @feature %http://tizen.org/feature/sensor.accelerometer.wakeup * @return @c true if the wakeup feature is enabled for the specified sensor type for the calling application, @n @@ -699,8 +703,9 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The sensor type is invalid. * @exception E_OPERATION_FAILED The operation has failed. - * @exception E_UNSUPPORTED_OPERATION The target device does not support the specific sensor,or @n - * the target device does not support wake-up feature originally or based on the specific sensor. + * @exception E_UNSUPPORTED_OPERATION Either of the following conditions has occurred: + * - The target device does not support the specific sensor. + * - The target device does not support the wake-up feature originally or based on the specific sensor. * @remarks * - The specific error code can be accessed using the GetLastResult() method. * - This method cannot be tested on the Emulator. It always returns @c true on the Emulator. @@ -711,15 +716,15 @@ public: /** * @if OSPCOMPAT * @page CompSensorManagerIsWakeupEnabledPage Compatibility for IsWakeupEnabled() - * @section CompSensorManagerIsWakeupEnabledIssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor,or @n - * the target device does not support wake-up feature originally or based on the specific sensor. + * @section CompSensorManagerIsWakeupEnabledIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The method returns @c E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor or @n + * the target device does not support the wake-up feature originally or based on the specific sensor. * * @section CompSensorManagerIsWakeupEnabledSolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. - * -# E_DEVICE_UNAVAILABLE exception is removed. + * This issue has been resolved in Tizen. @n + * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor. + * -# @c E_DEVICE_UNAVAILABLE exception is removed. * @endif */ diff --git a/inc/FUixSensorSensorTypes.h b/inc/FUixSensorSensorTypes.h index 4459452..fb1b425 100644 --- a/inc/FUixSensorSensorTypes.h +++ b/inc/FUixSensorSensorTypes.h @@ -17,7 +17,7 @@ /** * @file FUixSensorSensorTypes.h - * @brief This is the header file for the common data types used by the SensorData and SensorManager classes. + * @brief This is the header file for the common data types used by the %SensorData and %SensorManager classes. * * This header file contains the declarations of the common data types and constants used by the SensorData and SensorManager classes. */ @@ -63,7 +63,7 @@ enum SensorType * * @since 2.0 * -* @remarks Use actual key type, such as Tizen::Uix::Sensor::AccelerationDataKey, Tizen::Uix::Sensor::MagneticDataKey, Tizen::Uix::Sensor::ProximityDataKey, or Tizen::Uix::Sensor::TiltDataKey with type casting. For example, use Tizen::Uix::Sensor::SensorData::GetValue(static_cast(ACCELERATION_DATA_KEY_X), value) to get the acceleration value in x-axis. +* @remarks Use the actual key type, such as Tizen::Uix::Sensor::AccelerationDataKey, Tizen::Uix::Sensor::MagneticDataKey, Tizen::Uix::Sensor::ProximityDataKey, or Tizen::Uix::Sensor::TiltDataKey with type casting. For example, use Tizen::Uix::Sensor::SensorData::GetValue(static_cast(ACCELERATION_DATA_KEY_X), value) to get the acceleration value on the x-axis. */ enum SensorDataKey { @@ -101,9 +101,9 @@ enum MagneticDataKey { MAGNETIC_DATA_KEY_TIMESTAMP = 266, /**< The key to the timestamp of the magnetic sensor data */ MAGNETIC_DATA_KEY_X, /**< The key to the x-axis of the magnetic sensor data */ - MAGNETIC_DATA_KEY_Y, /**< The key to the y-axis of the magnetic sensor data */ - MAGNETIC_DATA_KEY_Z, /**< The key to the z-axis of the magnetic sensor data */ - MAGNETIC_DATA_KEY_COUNT = 4 /**< The number of indices to access magnetic sensor data */ + MAGNETIC_DATA_KEY_Y, /**< The key to the y-axis of the magnetic sensor data */ + MAGNETIC_DATA_KEY_Z, /**< The key to the z-axis of the magnetic sensor data */ + MAGNETIC_DATA_KEY_COUNT = 4 /**< The number of indices to access the magnetic sensor data */ }; /** @@ -130,7 +130,7 @@ enum ProximityDataKey enum TiltDataKey { TILT_DATA_KEY_TIMESTAMP = 286, /**< The key to the timestamp of the tilt sensor data */ - TILT_DATA_KEY_AZIMUTH, /**< The key to the azimuth of the tilt sensor data */ + TILT_DATA_KEY_AZIMUTH, /**< The key to the azimuth of the tilt sensor data */ TILT_DATA_KEY_PITCH, /**< The key to the pitch of the tilt sensor data */ TILT_DATA_KEY_ROLL, /**< The key to the roll of the tilt sensor data */ TILT_DATA_KEY_COUNT = 4 /**< The number of indices to access the tilt sensor data */ diff --git a/inc/FUixSensorTiltSensorData.h b/inc/FUixSensorTiltSensorData.h index 24fab84..cb1b4be 100644 --- a/inc/FUixSensorTiltSensorData.h +++ b/inc/FUixSensorTiltSensorData.h @@ -36,11 +36,8 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.0 * - * @remarks @b Header @b %file: @b \#include @b @n - * @b Library : @b osp-uix - * * The %TiltSensorData class stores tilt sensor data, including a time stamp. - * @n + * * For more information on the class features, see Sensor Manager. */ class _OSP_EXPORT_ TiltSensorData @@ -66,7 +63,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %TiltSensorData + * @param[in] rhs An instance of %TiltSensorData to copy */ TiltSensorData(const TiltSensorData& rhs); @@ -76,9 +73,9 @@ public: * @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. + * 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; @@ -97,7 +94,7 @@ public: * @since 2.1 * * @return A reference to this instance - * @param[in] rhs An instance of %TiltSensorData + * @param[in] rhs An instance of %TiltSensorData to copy */ TiltSensorData& operator =(const TiltSensorData& rhs); diff --git a/inc/FUixSensorUserAccelerationSensorData.h b/inc/FUixSensorUserAccelerationSensorData.h index b1b4d74..d876190 100644 --- a/inc/FUixSensorUserAccelerationSensorData.h +++ b/inc/FUixSensorUserAccelerationSensorData.h @@ -36,9 +36,6 @@ namespace Tizen { namespace Uix { namespace Sensor * * @since 2.1 * - * @remarks @b Header @b %file: @b \#include @b @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 Sensor Manager. @@ -66,7 +63,7 @@ public: * * @since 2.1 * - * @param[in] rhs An instance of %UserAccelerationSensorData + * @param[in] rhs An instance of %UserAccelerationSensorData to copy */ UserAccelerationSensorData(const UserAccelerationSensorData& rhs); @@ -76,9 +73,9 @@ public: * @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. + * 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; @@ -97,7 +94,7 @@ public: * @since 2.1 * * @return A reference to this instance - * @param[in] rhs An instance of %UserAccelerationSensorData + * @param[in] rhs An instance of %UserAccelerationSensorData to copy */ UserAccelerationSensorData& operator =(const UserAccelerationSensorData& rhs); diff --git a/src/FUixSensorSensorManager.cpp b/src/FUixSensorSensorManager.cpp index 70fb914..013bae1 100644 --- a/src/FUixSensorSensorManager.cpp +++ b/src/FUixSensorSensorManager.cpp @@ -2,7 +2,7 @@ // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // diff --git a/src/FUixSensor_ISensorCore.cpp b/src/FUixSensor_ISensorCore.cpp index cc61630..4eb5c02 100644 --- a/src/FUixSensor_ISensorCore.cpp +++ b/src/FUixSensor_ISensorCore.cpp @@ -2,7 +2,7 @@ // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // diff --git a/src/FUixSensor_ISensorCore.h b/src/FUixSensor_ISensorCore.h index d435b8f..0886e50 100644 --- a/src/FUixSensor_ISensorCore.h +++ b/src/FUixSensor_ISensorCore.h @@ -2,7 +2,7 @@ // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // diff --git a/src/FUixSensor_MotionImpl.cpp b/src/FUixSensor_MotionImpl.cpp old mode 100644 new mode 100755 index a185d78..365d39b --- a/src/FUixSensor_MotionImpl.cpp +++ b/src/FUixSensor_MotionImpl.cpp @@ -15,6 +15,8 @@ // limitations under the License. // +#include + #include #include #include @@ -25,122 +27,155 @@ using namespace Tizen::Base; namespace Tizen { namespace Uix { namespace Sensor { + + void -_MotionImpl::__MotionEventReceiver(unsigned int eventType, sensor_event_data_t* pEventData, void* pData) +_MotionImpl:: __MotionSnapEventReceiver(unsigned long long timeStamp, sensor_motion_snap_e snap, void *pData) { - int eventData = *((int*) pEventData->event_data); - IMotionEventListener* pMotionEventListener = (IMotionEventListener*) pData; + IMotionEventListener* pMotionEventListener = (IMotionEventListener*) pData; - if (pMotionEventListener != null) - { - switch (eventType) - { - case MOTION_ENGINE_EVENT_SNAP: - { - SysLog(NID_UIX, "Detected SNAP event(%d)\n", eventData); - switch (eventData) - { - case MOTION_ENGIEN_POSITIVE_SNAP_X: - pMotionEventListener->OnSnapDetected(MOTION_SNAP_X_POSITIVE); - break; - - case MOTION_ENGIEN_NEGATIVE_SNAP_X: - pMotionEventListener->OnSnapDetected(MOTION_SNAP_X_NEGATIVE); - break; - - case MOTION_ENGIEN_POSITIVE_SNAP_Y: - pMotionEventListener->OnSnapDetected(MOTION_SNAP_Y_POSITIVE); - break; - - case MOTION_ENGIEN_NEGATIVE_SNAP_Y: - pMotionEventListener->OnSnapDetected(MOTION_SNAP_Y_NEGATIVE); - break; - - case MOTION_ENGIEN_POSITIVE_SNAP_Z: - pMotionEventListener->OnSnapDetected(MOTION_SNAP_Z_POSITIVE); - break; - - case MOTION_ENGIEN_NEGATIVE_SNAP_Z: - pMotionEventListener->OnSnapDetected(MOTION_SNAP_Z_NEGATIVE); - break; - } - } - break; + SysLog(NID_UIX, "Detected SNAP event(%d)\n", snap); - case MOTION_ENGINE_EVENT_SHAKE: - { - SysLog(NID_UIX, "Detected SHAKE event(%d)\n", eventData); - switch (eventData) - { - case MOTION_ENGIEN_SHAKE_DETECTION: - pMotionEventListener->OnShakeDetected(MOTION_STARTED); - break; - - case MOTION_ENGIEN_SHAKE_CONTINUING: - pMotionEventListener->OnShakeDetected(MOTION_INPROGRESS); - break; - - case MOTION_ENGIEN_SHAKE_FINISH: - pMotionEventListener->OnShakeDetected(MOTION_ENDED); - break; - } - } - break; + switch (snap) + { + case SENSOR_MOTION_SNAP_X_POSITIVE: + pMotionEventListener->OnSnapDetected(MOTION_SNAP_X_POSITIVE); + break; + + case SENSOR_MOTION_SNAP_X_NEGATIVE: + pMotionEventListener->OnSnapDetected(MOTION_SNAP_X_NEGATIVE); + break; + + case SENSOR_MOTION_SNAP_Y_NEGATIVE: + pMotionEventListener->OnSnapDetected(MOTION_SNAP_Y_NEGATIVE); + break; + + case SENSOR_MOTION_SNAP_Y_POSITIVE: + pMotionEventListener->OnSnapDetected(MOTION_SNAP_Y_POSITIVE); + break; + + case SENSOR_MOTION_SNAP_Z_POSITIVE: + pMotionEventListener->OnSnapDetected(MOTION_SNAP_Z_POSITIVE); + break; + + case SENSOR_MOTION_SNAP_Z_NEGATIVE: + pMotionEventListener->OnSnapDetected(MOTION_SNAP_Z_NEGATIVE); + break; + } +} +void +_MotionImpl::__MotionShakeEventReceiver(unsigned long long timeStamp, sensor_motion_shake_e shake, void *pData) +{ + IMotionEventListener* pMotionEventListener = (IMotionEventListener*) pData; - case MOTION_ENGINE_EVENT_DOUBLETAP: - { - SysLog(NID_UIX, "Detected DOUBLETAP event(%d)\n", eventData); + SysLog(NID_UIX, "Detected SHAKE event(%d)\n", shake); + switch (shake) + { + case SENSOR_MOTION_SHAKE_DETECTED: + pMotionEventListener->OnShakeDetected(MOTION_STARTED); + break; - if (eventData == MOTION_ENGIEN_DOUBLTAP_DETECTION) - pMotionEventListener->OnDoubleTapDetected(); + case SENSOR_MOTION_SHAKE_CONTINUING: + pMotionEventListener->OnShakeDetected(MOTION_INPROGRESS); + break; - } - break; + case SENSOR_MOTION_SHAKE_FINISHED: + pMotionEventListener->OnShakeDetected(MOTION_ENDED); + break; + } - case MOTION_ENGINE_EVENT_DIRECT_CALL: - { - SysLog(NID_UIX, "Detected MOVE_TO_EAR event(%d)\n", eventData); +} +void +_MotionImpl::__MotionDoubleTapEventReceiver(unsigned long long timeStamp, void *pData) +{ + IMotionEventListener* pMotionEventListener = (IMotionEventListener*) pData; - if (eventData == MOTION_ENGINE_DIRECT_CALL_DETECTION) - pMotionEventListener->OnMoveToEarDetected(); + SysLog(NID_UIX, "Detected DOUBLETAP event \n"); + + pMotionEventListener->OnDoubleTapDetected(); - } - break; - } - } +} +void +_MotionImpl::__MotionDirectCallEventReceiver(unsigned long long timeStamp, void *pData) +{ + IMotionEventListener* pMotionEventListener = (IMotionEventListener*) pData; + + SysLog(NID_UIX, "Detected MOVETOEAR event \n"); + + pMotionEventListener->OnMoveToEarDetected(); } _MotionImpl::_MotionImpl(void) : __pIMotionEventListener(null) - , __handle(-1) + , __handle(null) , __motionType(MOTION_TYPE_NONE) { } _MotionImpl::~_MotionImpl(void) { - int ret = 0; + int sensorResult = SENSOR_ERROR_NONE; + + if (__motionType & MOTION_TYPE_SNAP) + { + sensorResult = sensor_stop(__handle, SENSOR_MOTION_SNAP); + SysTryReturnVoidResult(NID_UIX, sensorResult != SENSOR_ERROR_NONE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); + } + if (__motionType & MOTION_TYPE_SHAKE) + { + sensorResult = sensor_stop(__handle, SENSOR_MOTION_SHAKE); + SysTryReturnVoidResult(NID_UIX, sensorResult != SENSOR_ERROR_NONE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); + } + if (__motionType & MOTION_TYPE_MOVE_TO_EAR) + { + sensorResult = sensor_stop(__handle, SENSOR_MOTION_DIRECTCALL); + SysTryReturnVoidResult(NID_UIX, sensorResult != SENSOR_ERROR_NONE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); + } + if (__motionType & MOTION_TYPE_DOUBLETAP) + { + sensorResult = sensor_stop(__handle, SENSOR_MOTION_DOUBLETAP); + SysTryReturnVoidResult(NID_UIX, sensorResult != SENSOR_ERROR_NONE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); + } - ret = sf_stop(__handle); - if (ret != 0) - SysLog(NID_UIX, "Failed to call sf_stop() method."); + sensorResult = sensor_destroy(__handle); + SysTryReturnVoidResult(NID_UIX, sensorResult != SENSOR_ERROR_NONE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); - ret = sf_disconnect(__handle); - if (ret != 0) - SysLog(NID_UIX, "Failed to call sf_disconnect() method."); + __handle = null; } result _MotionImpl::Construct(IMotionEventListener& listener) { - result r = E_SUCCESS; - int ret = 0; - ret = sf_is_sensor_event_available(MOTION_SENSOR, 0); - SysTryReturn(NID_UIX, ret == 0, E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); - __handle = sf_connect(MOTION_SENSOR); - SysTryReturn(NID_UIX, __handle >= 0, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor handle was not created properly"); - ret = sf_start(__handle, 0); - SysTryReturn(NID_UIX, ret == 0, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + result r = E_SUCCESS; + + int sensorResult = SENSOR_ERROR_NONE; + + sensorResult = sensor_create(&__handle); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_OUT_OF_MEMORY, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The motion detection feature instance is not created"); + + sensorResult = sensor_start(__handle, SENSOR_MOTION_SNAP); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_NOT_SUPPORTED, E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_IO_ERROR, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_OPERATION_FAILED, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + sensor_set_always_on(__handle, SENSOR_MOTION_SNAP); + + sensorResult = sensor_start(__handle, SENSOR_MOTION_SHAKE); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_NOT_SUPPORTED, E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_IO_ERROR, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_OPERATION_FAILED, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + sensor_set_always_on(__handle, SENSOR_MOTION_SHAKE); + + sensorResult = sensor_start(__handle, SENSOR_MOTION_DOUBLETAP); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_NOT_SUPPORTED, E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_IO_ERROR, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_OPERATION_FAILED, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + sensor_set_always_on(__handle, SENSOR_MOTION_DOUBLETAP); + + sensorResult = sensor_start(__handle, SENSOR_MOTION_DIRECTCALL); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_NOT_SUPPORTED, E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] The motion detection feature is not supported"); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_IO_ERROR, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + SysTryReturn(NID_UIX, sensorResult != SENSOR_ERROR_OPERATION_FAILED, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Sensor couldn't start"); + sensor_set_always_on(__handle, SENSOR_MOTION_DIRECTCALL); __pIMotionEventListener = &listener; return r; @@ -153,6 +188,8 @@ _MotionImpl::SetEnabled(unsigned long type) SysLog(NID_UIX, "type(%d) / __motionType(%d)", (int)type, (int)__motionType); + SetLastResult(E_INVALID_STATE); + if (type & MOTION_TYPE_SNAP) { if (__motionType & MOTION_TYPE_SNAP) @@ -161,16 +198,16 @@ _MotionImpl::SetEnabled(unsigned long type) } else { - ret = sf_register_event(__handle, MOTION_ENGINE_EVENT_SNAP, null, __MotionEventReceiver, (void*) __pIMotionEventListener); - SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to register motion snap event."); + ret = sensor_motion_snap_set_cb(__handle, __MotionSnapEventReceiver, (void*) __pIMotionEventListener); + SysTryReturnVoidResult(NID_UIX, ret == SENSOR_ERROR_NONE, E_INVALID_STATE, "[E_INVALID_STATE] Failed to register motion snap event."); } } else { if (__motionType & MOTION_TYPE_SNAP) { - ret = sf_unregister_event(__handle, MOTION_ENGINE_EVENT_SNAP); - SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion snap event."); + ret = sensor_motion_snap_unset_cb(__handle); + SysTryReturnVoidResult(NID_UIX, ret == SENSOR_ERROR_NONE, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion snap event."); } } @@ -182,16 +219,16 @@ _MotionImpl::SetEnabled(unsigned long type) } else { - ret = sf_register_event(__handle, MOTION_ENGINE_EVENT_SHAKE, null, __MotionEventReceiver, (void*) __pIMotionEventListener); - SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to register motion shake event."); + ret = sensor_motion_shake_set_cb(__handle, __MotionShakeEventReceiver, (void*) __pIMotionEventListener); + SysTryReturnVoidResult(NID_UIX, ret == SENSOR_ERROR_NONE, E_INVALID_STATE, "[E_INVALID_STATE] Failed to register motion shake event."); } } else { if (__motionType & MOTION_TYPE_SHAKE) { - ret = sf_unregister_event(__handle, MOTION_ENGINE_EVENT_SHAKE); - SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion shake event."); + ret = sensor_motion_shake_unset_cb(__handle); + SysTryReturnVoidResult(NID_UIX, ret == SENSOR_ERROR_NONE, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion shake event."); } } @@ -203,39 +240,40 @@ _MotionImpl::SetEnabled(unsigned long type) } else { - ret = sf_register_event(__handle, MOTION_ENGINE_EVENT_DOUBLETAP, null, __MotionEventReceiver, (void*) __pIMotionEventListener); - SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to register motion double tap event."); + ret = sensor_motion_doubletap_set_cb(__handle, __MotionDoubleTapEventReceiver, (void*) __pIMotionEventListener); + SysTryReturnVoidResult(NID_UIX, ret == SENSOR_ERROR_NONE, E_INVALID_STATE, "[E_INVALID_STATE] Failed to register motion double tap event."); } } else { if (__motionType & MOTION_TYPE_DOUBLETAP) { - ret = sf_unregister_event(__handle, MOTION_ENGINE_EVENT_DOUBLETAP); - SysTryReturnVoidResult(NID_UIX, ret == 0, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion double tap event."); + ret = sensor_motion_doubletap_unset_cb(__handle); + SysTryReturnVoidResult(NID_UIX, ret == SENSOR_ERROR_NONE, 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."); + ret = sensor_motion_directcall_set_cb(__handle, __MotionDirectCallEventReceiver, (void*) __pIMotionEventListener); + SysTryReturnVoidResult(NID_UIX, ret == SENSOR_ERROR_NONE, 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."); + ret = sensor_motion_directcall_unset_cb(__handle); + SysTryReturnVoidResult(NID_UIX, ret == SENSOR_ERROR_NONE, E_INVALID_STATE, "[E_INVALID_STATE] Failed to unregister motion direct call event."); } } + __motionType = type; SetLastResult(E_SUCCESS); diff --git a/src/FUixSensor_SensorCoreEventTypes.h b/src/FUixSensor_SensorCoreEventTypes.h index e583550..c6d2705 100644 --- a/src/FUixSensor_SensorCoreEventTypes.h +++ b/src/FUixSensor_SensorCoreEventTypes.h @@ -2,7 +2,7 @@ // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 2.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // diff --git a/src/FUixSensor_SensorEventDeliverer.cpp b/src/FUixSensor_SensorEventDeliverer.cpp index 5591499..21d8e17 100644 --- a/src/FUixSensor_SensorEventDeliverer.cpp +++ b/src/FUixSensor_SensorEventDeliverer.cpp @@ -2,7 +2,7 @@ // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // diff --git a/src/FUixSensor_SensorEventDeliverer.h b/src/FUixSensor_SensorEventDeliverer.h index 39331a8..02f050a 100644 --- a/src/FUixSensor_SensorEventDeliverer.h +++ b/src/FUixSensor_SensorEventDeliverer.h @@ -2,7 +2,7 @@ // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // diff --git a/src/FUixSensor_SensorManagerImpl.cpp b/src/FUixSensor_SensorManagerImpl.cpp index c603590..fe20325 100644 --- a/src/FUixSensor_SensorManagerImpl.cpp +++ b/src/FUixSensor_SensorManagerImpl.cpp @@ -2,7 +2,7 @@ // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // diff --git a/src/inc/FUixSensor_MotionImpl.h b/src/inc/FUixSensor_MotionImpl.h index b64fdf6..1bf78c2 100644 --- a/src/inc/FUixSensor_MotionImpl.h +++ b/src/inc/FUixSensor_MotionImpl.h @@ -18,7 +18,8 @@ #ifndef _FUIX_SENSOR_INTERNAL_MOTION_IMPL_H_ #define _FUIX_SENSOR_INTERNAL_MOTION_IMPL_H_ -#include +#include + #include #include #include @@ -113,11 +114,14 @@ private: _MotionImpl(const _MotionImpl& value); _MotionImpl& operator =(const _MotionImpl& value); - static void __MotionEventReceiver(unsigned int eventType, sensor_event_data_t* pEventData, void* pData); + static void __MotionSnapEventReceiver(unsigned long long timeStamp, sensor_motion_snap_e snap, void *pData); + static void __MotionShakeEventReceiver(unsigned long long timeStamp, sensor_motion_shake_e shake, void *pData); + static void __MotionDoubleTapEventReceiver(unsigned long long timeStamp, void *pData); + static void __MotionDirectCallEventReceiver(unsigned long long timeStamp, void *pData); private: IMotionEventListener* __pIMotionEventListener; - int __handle; + sensor_handle_s *__handle; unsigned long __motionType; }; // _MotionImpl diff --git a/src/inc/FUixSensor_SensorManagerImpl.h b/src/inc/FUixSensor_SensorManagerImpl.h index 458b9f8..7062db7 100644 --- a/src/inc/FUixSensor_SensorManagerImpl.h +++ b/src/inc/FUixSensor_SensorManagerImpl.h @@ -2,7 +2,7 @@ // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -- 2.7.4