6178266601bd87959217f9cda9da099cec93ed58
[platform/framework/native/uix.git] / inc / FUixSensorSensorManager.h
1 // 
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // 
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.tizenopensource.org/license
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file     FUixSensorSensorManager.h
20  * @brief    This is the header file for the %SensorManager class.
21  *
22  * This header file contains the declarations of the %SensorManager class.
23  */
24
25 #ifndef _FUIX_SENSOR_SENSOR_MANAGER_H_
26 #define _FUIX_SENSOR_SENSOR_MANAGER_H_
27
28 #include <FBaseDataType.h>
29 #include <FBaseObject.h>
30 #include <FUixSensorSensorTypes.h>
31 #include <FUixSensorISensorEventListener.h>
32
33 namespace Tizen { namespace Base
34 {
35 class String;
36 } } // Tizen::Base
37
38 namespace Tizen { namespace Uix { namespace Sensor
39 {
40
41 /**
42  * @class SensorManager
43  * @brief This class is used to receive sensor data from the device.
44  *
45  * @since 2.0
46  *
47  * @remarks      @b Header @b %file: @b \#include @b <FUix.h> @n
48  *               @b Library : @b osp-uix
49  *
50  * The %SensorManager class is used to receive and manage sensor data from the device, including adding or removing the sensor
51  * listeners, checking sensor availability, setting intervals, and getting the maximum or minimum intervals.
52  * @n
53  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/uix/sensor_manager.htm">Sensor Manager</a>.
54  *
55  * The following examples demonstrate how to use the %SensorManager class with the acceleration sensor.
56  *
57  * @code
58  * //Sample code for SensorSample.h
59  * #include <FUixSensor.h>
60  *
61  * using namespace Tizen::Uix::Sensor;
62  *
63  * class SensorSample : public ISensorEventListener
64  * {
65  *     public:
66  *         SensorSample(void);
67  *         virtual ~SensorSample(void);
68  *         bool CreateSensor(void);
69  *
70  *         virtual void OnDataReceived(SensorType sensorType, SensorData& sensorData, result r);
71  *
72  *     private:
73  *         SensorManager __sensorManager;
74  * };
75  *
76  * //Sample code for SensorSample.cpp
77  * #include "SensorSample.h"
78  *
79  * SensorSample::SensorSample(void)
80  * {
81  *     // Initializes the sensor manager
82  *     __sensorManager.Construct();
83  * }
84  *
85  * SensorSample::~SensorSample(void)
86  * {
87  *     // Finalizes the sensor manager
88  * }
89  *
90  * void SensorSample::OnDataReceived(SensorType sensorType, SensorData& sensorData, result r)
91  * {
92  *     // Adds your code.
93  *     // Refers to API Reference to ISensorEventListener::OnDataReceived().
94  *     // Application APIs should not be called inside this event handler.
95  *     // Overrides OnDataReceived() for just receiving the sensor data and copying it to the main application context.
96  *
97  * }
98  *
99  * bool SensorSample::CreateSensor(void)
100  * {
101  *     result r = E_SUCCESS;
102  *
103  *     if (__sensorManager.IsAvailable(SENSOR_TYPE_ACCELERATION))
104  *     {
105  *         r = __sensorManager.AddSensorListener(*this, SENSOR_TYPE_ACCELERATION, 50, true);
106  *         if (IsFailed(r))
107  *         {
108  *             return false;
109  *         }
110  *     }
111  *     else
112  *     {
113  *         AppLogException("Acceleration sensor is not available.");
114  *         return false;
115  *     }
116  *
117  *     return true;
118  * }
119  * @endcode
120  */
121 class _OSP_EXPORT_ SensorManager
122         : public Tizen::Base::Object
123 {
124
125 // Lifecycle
126 public:
127         /**
128          * This is the default constructor for this class.
129          *
130          * @since      2.0
131          *
132          * @remarks    After creating an instance of this class, the Construct() method
133          *             must be called explicitly to initialize this instance.
134          */
135         SensorManager(void);
136
137         /**
138          * This is the destructor for this class.
139          *
140          * @since      2.0
141          *
142          * @remarks    All listeners are removed
143          *             and the internally allocated memory block is deleted when the instance is destroyed.
144          */
145         virtual ~SensorManager(void);
146
147
148 // Operation
149 public:
150         /**
151          * Initializes this instance of %SensorManager. @n
152          * It includes initializing the sub-component of the sensor manager.
153          *
154          * @since        2.0
155          *
156          * @return       An error code
157          * @exception    E_SUCCESS          The method is successful.
158          * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
159          */
160         result Construct(void);
161
162         /**
163         * Adds a sensor listener when the sensor powers up for the first time.
164         * @if OSPCOMPAT
165         * @brief                   <i> [Compatibility] </i>
166         * @endif
167         * @since        2.0
168         * @if OSPCOMPAT
169         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
170         *                              For more information, see @ref CompSensorManagerAddSensorListenerPage "here".
171         * @endif
172         * @return       An error code
173         * @param[in]    listener                     The listener to add
174         * @param[in]    sensorType                   The sensor type
175         * @param[in]    interval                     The interval (in milliseconds) at which the sensor data is received
176         * @param[in]    dataChanged                  Set to @c true if the sensor data is received only when the sensor data is changed, @n
177         *                                            else @c false if the sensor data is received at every interval
178         * @exception    E_SUCCESS                    The method is successful.
179         * @exception    E_OUT_OF_MEMORY              The memory is insufficient.
180         * @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.
181         * @exception    E_OPERATION_FAILED         The operation has failed to add a sensor listener.
182         * @exception    E_USER_ALREADY_REGISTERED    The specified listener is already registered for the specified sensor type.
183         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
184         */
185
186         result AddSensorListener(ISensorEventListener& listener, SensorType sensorType, long interval, bool dataChanged);
187
188         /**
189         * @if OSPCOMPAT
190         * @page         CompSensorManagerAddSensorListenerPage Compatibility for AddSensorListener()
191         * @section      CompSensorManagerAddSensorListenerIssueSection Issues
192         * Implementing this method in OSP compatible applications has the following issues:   @n
193         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
194         *
195         * @section      CompSensorManagerAddSensorListenerSolutionSection Resolutions
196         * This issue has been resolved in Tizen. @n
197         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
198         * -# E_DEVICE_UNAVAILABLE exception is removed.
199         * @endif
200         */
201
202         /**
203         * Removes a sensor listener from all sensor types. @n
204         * Sensor powers down when every listener added to the type of sensor is removed.
205         * @if OSPCOMPAT
206         * @brief                   <i> [Compatibility] </i>
207         * @endif
208         * @since        2.0
209         * @if OSPCOMPAT
210         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
211         *                              For more information, see @ref CompSensorManagerRemoveSensorListenerPage "here".
212         * @endif
213         * @return       An error code
214         * @param[in]    listener                The listener to remove
215         * @exception    E_SUCCESS               The method is successful.
216         * @exception   E_OBJ_NOT_FOUND           The specified @c listener is not found in the listener list.
217         * @exception    E_OPERATION_FAILED           The operation has failed to remove sensor listeners.
218         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
219         */
220
221         result RemoveSensorListener(ISensorEventListener& listener);
222
223         /**
224         * @if OSPCOMPAT
225         * @page                    CompSensorManagerRemoveSensorListenerPage Compatibility for RemoveSensorListener()
226         * @section                 CompSensorManagerRemoveSensorListenerIssueSection Issues
227         * Implementing this method in OSP compatible applications has the following issues:   @n
228         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
229         *
230         * @section                 CompSensorManagerRemoveSensorListenerSolutionSection Resolutions
231         * This issue has been resolved in Tizen. @n
232         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
233         * -# E_DEVICE_UNAVAILABLE exception is removed.
234         * @endif
235         */
236
237
238         /**
239         * Removes a sensor listener from the sensor type. @n
240         * Sensor powers down when every listener added to the type of sensor is removed.
241         * @if OSPCOMPAT
242         * @brief                   <i> [Compatibility] </i>
243         * @endif
244         * @since        2.0
245         * @if OSPCOMPAT
246         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
247         *                              For more information, see @ref CompSensorManagerRemoveSensorListenerPage "here".
248         * @endif
249         * @return       An error code
250         * @param[in]    listener                   The listener to remove
251         * @param[in]    sensorType                 The sensor type
252         * @exception    E_SUCCESS                  The method is successful.
253         * @exception    E_OBJ_NOT_FOUND           The specified @c listener is not found in the listener list,
254         *                                            or the specified type of sensor is not valid.
255         * @exception    E_OPERATION_FAILED           The operation has failed to remove the sensor listener.
256         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
257         */
258         result RemoveSensorListener(ISensorEventListener& listener, SensorType sensorType);
259
260         /**
261          * @if OSPCOMPAT
262         * @page                    CompSensorManagerRemoveSensorListenerPage Compatibility for RemoveSensorListener ()
263         * @section                   CompSensorManagerRemoveSensorListenerIssueSection Issues
264         * Implementing this method in OSP compatible applications has the following issues:   @n
265         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
266         *
267         * @section                 CompSensorManagerRemoveSensorListenerSolutionSection Resolutions
268         * This issue has been resolved in Tizen. @n
269         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
270         * -# E_DEVICE_UNAVAILABLE exception is removed.
271         * @endif
272         */
273
274         /**
275         * @if OSPDEPREC
276         * @{
277         * Sets an interval of a sensor.
278         * @if OSPCOMPAT
279         * @brief <i> [Deprecated] [Compatibility] </i>
280         * @endif
281         * @deprecated   This method is deprecated because it changes only the first listener's interval; the other listeners do not have an option to change their intervals.
282         * To resolve this, a new method has been added. Instead of using this method, use the SetInterval(ISensorEventListener& listener, SensorType sensorType, long interval) method.
283         * @since        2.0
284         * @if OSPCOMPAT
285         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
286         *                              For more information, see @ref CompSensorManagerSetIntervalPage "here".
287         * @endif
288         * @return       An error code
289         * @param[in]    sensorType                 The sensor type
290         * @param[in]    interval                   The interval (in milliseconds) at which the sensor data is received
291         * @exception    E_SUCCESS                  The method is successful.
292         * @exception    E_INVALID_ARG              An interval must be greater than the maximum interval or less than the minimum interval,
293         *                                            or the sensor type is invalid.
294         * @exception    E_OPERATION_FAILED         The operation has failed to set interval of sensor.
295         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
296         * @see SensorManager::GetMaxInterval() for getting the maximum intervals
297         * @see SensorManager::GetMinInterval() for getting the minimum intervals
298         * @}
299         * @endif
300         */
301
302         result SetInterval(SensorType sensorType, long interval);
303
304         /**
305         * @if OSPCOMPAT
306         * @page                    CompSensorManagerSetIntervalPage Compatibility for SetInterval ()
307         * @section                   CompSensorManagerSetIntervalIssueSection Issues
308         * Implementing this method in OSP compatible applications has the following issues:   @n
309         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
310         *
311         * @section                 CompSensorManagerSetIntervalSolutionSection Resolutions
312         * This issue has been resolved in Tizen. @n
313         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
314         * -# E_DEVICE_UNAVAILABLE exception is removed.
315         * @endif
316         */
317
318         /**
319         * Sets an interval of a sensor using the specified @c listener.
320         * @if OSPCOMPAT
321         * @brief                   <i> [Compatibility] </i>
322         * @endif
323         * @since        2.0
324         * @if OSPCOMPAT
325         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
326         *                              For more information, see @ref CompSensorManagerSetIntervalPage "here".
327         * @endif
328         * @return       An error code
329         * @param[in]    listener                   The added listener
330         * @param[in]    sensorType                 The sensor type
331         * @param[in]    interval                   The interval (in milliseconds) at which the sensor data is received
332         * @exception    E_SUCCESS                  The method is successful.
333         * @exception    E_INVALID_ARG              An interval must be greater than the maximum interval or less than the minimum interval,
334     *                                           or the listener is not registered for this type of sensor, or the sensor type is invalid.
335         * @exception    E_OPERATION_FAILED         The operation has failed to set the interval of sensor.
336         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
337         * @see SensorManager::GetMaxInterval() for getting the maximum intervals
338         * @see SensorManager::GetMinInterval() for getting the minimum intervals
339         */
340         result SetInterval(ISensorEventListener& listener, SensorType sensorType, long interval);
341
342         /**
343         * @if OSPCOMPAT
344         * @page                    CompSensorManagerSetIntervalPage Compatibility for SetInterval ()
345         * @section                   CompSensorManagerSetIntervalIssueSection Issues
346         * Implementing this method in OSP compatible applications has the following issues:   @n
347         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
348         *
349         * @section                 CompSensorManagerSetIntervalSolutionSection Resolutions
350         * This issue has been resolved in Tizen. @n
351         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
352         * -# E_DEVICE_UNAVAILABLE exception is removed.
353         * @endif
354         */
355
356         /**
357         * Checks whether a sensor type is available on the device.
358         * @if OSPCOMPAT
359         * @brief                   <i> [Compatibility] </i>
360         * @endif
361         * @since        2.0
362         * @if OSPCOMPAT
363         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
364         *                              For more information, see @ref CompSensorManagerIsAvailablePage "here".
365         * @endif
366         * @return       @c true if the sensor type is available, @n
367         *               else @c false
368         * @param[in]    sensorType       The sensor type
369         * @exception    E_SUCCESS        The method is successful.
370         * @exception    E_INVALID_ARG     The sensor type is invalid.
371         * @remarks      The specific error code can be accessed using the GetLastResult() method.
372         */
373         bool IsAvailable(SensorType sensorType) const;
374
375         /**
376         * @if OSPCOMPAT
377         * @page                    CompSensorManagerIsAvailablePage Compatibility for IsAvailable ()
378         * @section                   CompSensorManagerIsAvailableIssueSection Issues
379         * Implementing this method in OSP compatible applications has the following issues:   @n
380         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
381         *
382         * @section                 CompSensorManagerIsAvailableSolutionSection Resolutions
383         * This issue has been resolved in Tizen. @n
384         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
385         * -# E_DEVICE_UNAVAILABLE exception is removed.
386         * @endif
387         */
388
389         /**
390         * Gets the minimum interval of the sensor type.
391         * @if OSPCOMPAT
392         * @brief                   <i> [Compatibility] </i>
393         * @endif
394         * @since         2.0
395         * @if OSPCOMPAT
396         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
397         *                              For more information, see @ref CompSensorManagerGetMinIntervalPage "here".
398         * @endif
399         * @return        An error code
400         * @param[in]     sensorType                 The sensor type
401         * @param[out]    interval                   The minimum interval in milliseconds
402         * @exception     E_SUCCESS                  The method is successful.
403         * @exception    E_INVALID_ARG               The sensor type is invalid.
404         * @exception    E_OPERATION_FAILED         The operation has failed to get interval of sensor.
405         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
406         */
407         result GetMinInterval(SensorType sensorType, long& interval) const;
408
409         /**
410     * @if OSPCOMPAT
411         * @page                    CompSensorManagerGetMinIntervalPage Compatibility for GetMinInterval()
412         * @section                   CompSensorManagerGetMinIntervalIssueSection Issues
413         * Implementing this method in OSP compatible applications has the following issues:   @n
414         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
415         *
416         * @section                 CompSensorManagerGetMinIntervalSolutionSection Resolutions
417         * This issue has been resolved in Tizen. @n
418         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
419         * -# E_DEVICE_UNAVAILABLE exception is removed.
420         * @endif
421         */
422
423         /**
424         * Gets the maximum interval of the sensor type.
425         * @if OSPCOMPAT
426         * @brief                   <i> [Compatibility] </i>
427         * @endif
428         * @since         2.0
429         * @if OSPCOMPAT
430         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
431         *                              For more information, see @ref CompSensorManagerGetMaxIntervalPage "here".
432         * @endif
433         * @return        An error code
434         * @param[in]     sensorType                 The sensor type
435         * @param[out]    interval                   The maximum interval in milliseconds
436         * @exception     E_SUCCESS                  The method is successful.
437         * @exception    E_INVALID_ARG               The sensor type is invalid.
438         * @exception    E_OPERATION_FAILED         The operation has failed to get interval of sensor.
439         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
440         */
441         result GetMaxInterval(SensorType sensorType, long& interval) const;
442
443         /**
444         * @if OSPCOMPAT
445         * @page                    CompSensorManagerGetMaxIntervalPage Compatibility for GetMaxInterval()
446         * @section                   CompSensorManagerGetMaxIntervalIssueSection Issues
447         * Implementing this method in OSP compatible applications has the following issues:   @n
448         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
449         *
450         * @section                 CompSensorManagerGetMaxIntervalSolutionSection Resolutions
451         * This issue has been resolved in Tizen. @n
452         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
453         * -# E_DEVICE_UNAVAILABLE exception is removed.
454         * @endif
455         */
456
457         /**
458         * Gets a brief description on this sensor.
459         * @if OSPCOMPAT
460         * @brief                   <i> [Compatibility] </i>
461         * @endif
462         * @since         2.0
463         *
464         * @if OSPCOMPAT
465         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
466         *                              For more information, see @ref CompSensorManagerGetDescriptionPage "here".
467         * @endif
468         * @return        An error code
469         * @param[in]     sensorType                 The sensor type
470         * @param[out]    description                The sensor description
471         * @exception     E_SUCCESS                  The method is successful.
472         * @exception    E_INVALID_ARG               The sensor type is invalid.
473         * @exception    E_OPERATION_FAILED         The operation has failed to get description of sensor.
474         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
475         */
476         result GetDescription(SensorType sensorType, Tizen::Base::String& description) const;
477
478         /**
479         * @if OSPCOMPAT
480         * @page                    CompSensorManagerGetDescriptionPage Compatibility for GetDescription()
481         * @section                   CompSensorManagerGetDescriptionIssueSection Issues
482         * Implementing this method in OSP compatible applications has the following issues:   @n
483         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
484         *
485         * @section                 CompSensorManagerGetDescriptionSolutionSection Resolutions
486         * This issue has been resolved in Tizen. @n
487         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
488         * -# E_DEVICE_UNAVAILABLE exception is removed.
489         * @endif
490         */
491
492         /**
493         * Gets the sensor's vendor information.
494         * @if OSPCOMPAT
495         * @brief                   <i> [Compatibility] </i>
496         * @endif
497         * @since         2.0
498         * @if OSPCOMPAT
499         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
500         *                              For more information, see @ref CompSensorManagerGetVendorPage "here".
501         * @endif
502         * @return        An error code
503         * @param[in]     sensorType                 The sensor type
504         * @param[out]    vendor                     The vendor information
505         * @exception     E_SUCCESS                  The method is successful.
506         * @exception    E_INVALID_ARG               The sensor type is invalid.
507         * @exception    E_OPERATION_FAILED         The operation has failed to get vender information of sensor.
508         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
509         */
510         result GetVendor(SensorType sensorType, Tizen::Base::String& vendor) const;
511
512         /**
513         * @if OSPCOMPAT
514         * @page                    CompSensorManagerGetVendorPage Compatibility for GetVendor()
515         * @section                   CompSensorManagerGetVendorIssueSection Issues
516         * Implementing this method in OSP compatible applications has the following issues:   @n
517         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
518         *
519         * @section                 CompSensorManagerGetVendorSolutionSection Resolutions
520         * This issue has been resolved in Tizen. @n
521         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
522         * -# E_DEVICE_UNAVAILABLE exception is removed.
523         * @endif
524         */
525
526         /**
527         * Gets the sensor's model ID.
528         * @if OSPCOMPAT
529         * @brief                   <i> [Compatibility] </i>
530         * @endif
531         * @since         2.0
532         *
533         * @if OSPCOMPAT
534         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
535         *                              For more information, see @ref CompSensorManagerGetModelIdPage "here".
536         * @endif
537         * @return        An error code
538         * @param[in]     sensorType                 The sensor type
539         * @param[out]    modelId                    The model ID of the sensor hardware
540         * @exception     E_SUCCESS                  The method is successful.
541         * @exception    E_INVALID_ARG               The sensor type is invalid.
542         * @exception    E_OPERATION_FAILED         The operation has failed to get the model ID of the sensor.
543         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
544         */
545         result GetModelId(SensorType sensorType, Tizen::Base::String& modelId) const;
546
547         /**
548         * @if OSPCOMPAT
549         * @page                    CompSensorManagerGetModelIdPage Compatibility for GetModelId()
550         * @section                   CompSensorManagerGetModelIdIssueSection Issues
551         * Implementing this method in OSP compatible applications has the following issues:   @n
552         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
553         *
554         * @section                 CompSensorManagerGetModelIdSolutionSection Resolutions
555         * This issue has been resolved in Tizen. @n
556         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
557         * -# E_DEVICE_UNAVAILABLE exception is removed.
558         * @endif
559         */
560
561         /**
562         * Gets the measurement range of the sensor.
563         * @if OSPCOMPAT
564         * @brief                   <i> [Compatibility] </i>
565         * @endif
566         * @since         2.0
567         *
568         * @if OSPCOMPAT
569         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
570         *                              For more information, see @ref CompSensorManagerGetMeasurementRangePage "here".
571         * @endif
572         * @return        An error code
573         * @param[in]     sensorType                 The sensor type
574         * @param[out]    min                        The minimum value of the measurement range
575         * @param[out]    max                        The maximum value of the measurement range
576         * @param[out]    resolution                 The resolution of the sensor measurement, that is, Measurement/bit @n
577         *                                           This is a device specific characteristic.
578         * @exception     E_SUCCESS                  The method is successful.
579         * @exception    E_INVALID_ARG               The sensor type is invalid.
580         * @exception    E_OPERATION_FAILED         The operation has failed.
581         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
582         */
583         result GetMeasurementRange(SensorType sensorType, float& min, float& max, float& resolution) const;
584
585         /**
586         * @if OSPCOMPAT
587         * @page                    CompSensorManagerGetMeasurementRangePage Compatibility for GetMeasurementRange()
588         * @section                   CompSensorManagerGetMeasurementRangeIssueSection Issues
589         * Implementing this method in OSP compatible applications has the following issues:   @n
590         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
591         *
592         * @section                 CompSensorManagerGetMeasurementRangeSolutionSection Resolutions
593         * This issue has been resolved in Tizen. @n
594         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
595         * -# E_DEVICE_UNAVAILABLE exception is removed.
596         * @endif
597         */
598
599         /**
600         * Checks whether the wake up feature is supported for the specified sensor type. @n
601         * The return value can vary depending on a specific device model.
602         * @if OSPCOMPAT
603         * @brief                   <i> [Compatibility] </i>
604         * @endif
605         * @since        2.0
606         *
607         * @if OSPCOMPAT
608         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
609         *                              For more information, see @ref CompSensorManagerIsWakeupSupportedPage "here".
610         * @endif
611         * @return       @c true if the sensor type supports the wake up feature while the device is in the sleep mode, @n
612         *               else @c false if the wake up feature is not supported by the sensor or if the instance is not initialized properly
613         * @param[in]    sensorType                 The sensor type
614         * @exception    E_SUCCESS                  The method is successful.
615         * @exception    E_INVALID_ARG              The sensor type is invalid.
616         * @exception    E_OPERATION_FAILED         The operation has failed.
617         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
618         * @remarks      The specific error code can be accessed using the GetLastResult() method.
619         * @remarks              This method cannot be tested on the Emulator. It always returns true on the Emulator.
620         */
621         bool IsWakeupSupported(SensorType sensorType) const;
622
623         /**
624         * @if OSPCOMPAT
625         * @page                    CompSensorManagerIsWakeupSupportedPage Compatibility for IsWakeupSupported()
626         * @section                   CompSensorManagerIsWakeupSupportedIssueSection Issues
627         * Implementing this method in OSP compatible applications has the following issues:   @n
628         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
629         *
630         * @section                 CompSensorManagerIsWakeupSupportedSolutionSection Resolutions
631         * This issue has been resolved in Tizen. @n
632         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
633         * -# E_DEVICE_UNAVAILABLE exception is removed.
634         * @endif
635         */
636
637         /**
638         * Sets the application-wise wake up feature as enabled or disabled for the specified sensor type.
639         * @if OSPCOMPAT
640         * @brief                   <i> [Compatibility] </i>
641         * @endif
642         * @since        2.0
643         *
644         * @if OSPCOMPAT
645         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
646         *                              For more information, see @ref CompSensorManagerSetWakeupEnabledPage "here".
647         * @endif
648         * @return       An error code
649         * @param[in]    sensorType                 The sensor type
650         * @param[in]    enable                     Set to @c true to enable the wake up feature, @n
651         *                                          else @c false to disable the wake up feature
652         * @exception    E_SUCCESS                  The method is successful.
653         * @exception    E_OPERATION_FAILED         The method has failed to set the wake up option.
654         * @exception    E_INVALID_STATE            There is no sensor listener registered for this type.
655         * @exception    E_INVALID_ARG              The sensor type is invalid.
656         * @exception    E_OPERATION_FAILED         The operation has failed.
657         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
658         * @remarks      The wake up feature is automatically disabled by the system as soon as the calling application is terminated.
659         * @remarks              This method cannot be tested on the Emulator. It always returns E_SUCCESS on the Emulator.
660         */
661         result SetWakeupEnabled(SensorType sensorType, bool enable);
662
663         /**
664         * @if OSPCOMPAT
665         * @page                    CompSensorManagerSetWakeupEnabledPage Compatibility for SetWakeupEnabled()
666         * @section                   CompSensorManagerSetWakeupEnabledIssueSection Issues
667         * Implementing this method in OSP compatible applications has the following issues:   @n
668         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
669         *
670         * @section                 CompSensorManagerSetWakeupEnabledSolutionSection Resolutions
671         * This issue has been resolved in Tizen. @n
672         * -# The method returns E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
673         * -# E_DEVICE_UNAVAILABLE exception is removed.
674         * @endif
675         */
676
677         /**
678         * Checks whether the wake up feature is enabled for the specified sensor type.
679         * @if OSPCOMPAT
680         * @brief                   <i> [Compatibility] </i>
681         * @endif
682         * @since        2.0
683         *
684         * @if OSPCOMPAT
685         * @compatibility     This method has compatibility issues with OSP compatible applications. @n
686         *                              For more information, see @ref CompSensorManagerIsWakeupEnabledPage "here".
687         * @endif
688         * @return       @c true if the wakeup feature is enabled for the specified sensor type for the calling application, @n
689         *               else @c false
690         * @param[in]    sensorType                 The sensor type
691         * @exception    E_SUCCESS                  The method is successful.
692         * @exception    E_INVALID_ARG              The sensor type is invalid.
693         * @exception    E_OPERATION_FAILED         The operation has failed.
694         * @exception    E_UNSUPPORTED_OPERATION      The target device does not support the specific sensor.
695         * @remarks      The specific error code can be accessed using the GetLastResult() method.
696         * @remarks              This method cannot be tested on the Emulator. It always returns true on the Emulator.
697         */
698         bool IsWakeupEnabled(SensorType sensorType) const;
699
700         /**
701         * @if OSPCOMPAT
702         * @page                    CompSensorManagerIsWakeupEnabledPage Compatibility for IsWakeupEnabled()
703         * @section                   CompSensorManagerIsWakeupEnabledIssueSection Issues
704         * Implementing this method in OSP compatible applications has the following issues:   @n
705         * -# The method returns E_DEVICE_UNAVAILABLE if the target device does not support the specific sensor.
706         *
707         * @section                 CompSensorManagerIsWakeupEnabledSolutionSection Resolutions
708         * This issue has been resolved in Tizen. @n
709         * -# The method returns @c E_UNSUPPORTED_OPERATION if the target device does not support the specific sensor.
710         * -# E_DEVICE_UNAVAILABLE exception is removed.
711         * @endif
712         */
713
714 private:
715         /**
716          * This is the copy constructor for %SensorManager class.
717          *
718          * @since 2.0
719          */
720         SensorManager(const SensorManager& sensorManager);
721
722         /**
723          * Assigns the value of the specified %SensorManager object to the current instance.
724          *
725          * @since 2.0
726          */
727         SensorManager& operator =(const SensorManager& sensorManager);
728
729 private:
730         class _SensorManagerImpl* __pSensorManagerImpl;
731         friend class _SensorManagerImpl;
732
733 }; // SensorManager
734
735 } } }// Tizen::Uix::Sensor
736
737 #endif // _FUIX_SENSOR_SENSOR_MANAGER_H_