2.0 alpha
[platform/core/system/devman.git] / include / devman.h
old mode 100755 (executable)
new mode 100644 (file)
similarity index 68%
rename from devman.h
rename to include/devman.h
index 57e802b..d2e3f33
--- a/devman.h
@@ -4,7 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: DongGi Jang <dg0402.jang@samsung.com>
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -17,7 +17,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
-*/ 
+*/
 
 
 #ifndef __DEVMAN_H__
 #define DEPRECATED __attribute__((deprecated))
 #endif
 
+#include "devman_error.h"
+/** START: This code related to the opensource api will be removed */
+#include "devman_managed.h"
+/** END: Will be remved */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/** 
+/**
  * @file        devman.h
  * @ingroup     DEVICE_MANAGER
  * @brief       This file contains the API for the status of devices
@@ -57,24 +62,24 @@ extern "C" {
  *     device type enum
  */
        typedef enum devtype_list {
-               DEVTYPE_POWERSUPPLY,    /**< battery, PMIC, etc about power */
+               DEVTYPE_POWERSUPPLY,            /**< battery, PMIC, etc about power */
                DEVTYPE_DISPLAY0,               /**< main screen */
                DEVTYPE_DISPLAY1,               /**< sub screen */
                DEVTYPE_HAPTIC,                 /**< motor */
                DEVTYPE_LED,                    /**< LED */
                DEVTYPE_JACK,                   /**< jack - Micro USB, 3.5 pi jack etc */
-               DEVTYPE_TOUCHSCREEN,    /**< main touch screen */
+               DEVTYPE_TOUCHSCREEN,            /**< main touch screen */
                DEVTYPE_TOUCHKEY,               /**< touchkey */
                DEVTYPE_GPS,
                DEVTYPE_UART,
                DEVTYPE_MMC,                    /**< MMC card(Micro SD) */
-               DEVTYPE_EFFECT_HAPTIC,  /**< extended touchsense */
+               DEVTYPE_EFFECT_HAPTIC,          /**< extended touchsense */
                DEVTYPE_POWER,
 
                DEVTYPE_MAX
        } devtype_t;
 
-/** 
+/**
  * @par Description:
  *     DEVTYPE_POWER property for generic APIs
  */
@@ -83,7 +88,7 @@ extern "C" {
                POWER_PROP_WAKEUP_COUNT,
        };
 
-/** 
+/**
  * @par Description:
  *     DEVTYPE_POWERSUPPLY property for generic APIs
  */
@@ -96,6 +101,8 @@ extern "C" {
                POWER_SUPPLY_PROP_CAPACITY,
                /**< iBattery status about cahrge */
                POWER_SUPPLY_PROP_BATTERY_HEALTH,
+               /**< Current remaining battery expressed 1/10000 */
+               POWER_SUPPLY_PROP_CAPACITY_RAW,
        };
 
 /**
@@ -105,6 +112,7 @@ extern "C" {
        enum {
                DISPLAY_PROP_ONOFF,
                DISPLAY_PROP_BRIGHTNESS,
+               DISPLAY_PROP_MIN_BRIGHTNESS,
                DISPLAY_PROP_MAX_BRIGHTNESS,
                DISPLAY_PROP_GAMMA,
                DISPLAY_PROP_DISPLAY_COUNT,
@@ -113,6 +121,7 @@ extern "C" {
                DISPLAY_PROP_IMAGE_ENHANCE_SCENARIO,
                DISPLAY_PROP_IMAGE_ENHANCE_TONE,
                DISPLAY_PROP_IMAGE_ENHANCE_OUTDOOR,
+               DISPLAY_PROP_IMAGE_ENHANCE_INFO,
        };
 
 /**
@@ -175,7 +184,7 @@ extern "C" {
  * @par Description:
  *     This generic API is used to get the property values of supported devices.\n
  *     If the caller process does not have permission, it returns failure.
- * @param[in] devtype device type that you want to get the value 
+ * @param[in] devtype device type that you want to get the value
  * @param[in] property value property that you want to get the value
  * @param[out] *value current value of device property
  * @return 0 on success, -1 if failed
@@ -185,7 +194,7 @@ extern "C" {
  *     ...
  *     if( device_get_property(DEVTYPE_POWERSUPPLY, POWER_SUPPLY_PROP_CAPACITY, &val) < 0 )
  *             printf("Fail to get property\n");
- *     else 
+ *     else
  *             printf("Property is %d\n", val);
  *     ...
  * @endcode
@@ -195,7 +204,7 @@ extern "C" {
 /**
  * @fn int device_set_property(devtype_t devtype, int property, int value)
  * @par Description:
- *     This generic API is used to set the property values of supported devices.\n 
+ *     This generic API is used to set the property values of supported devices.\n
  *     If the caller process does not have permission, it returns failure.
  * @param[in] devtype device type that you want to set the value
  * @param[in] property value property that you want to set the value
@@ -222,9 +231,9 @@ extern "C" {
  *     It gets the Battery percentage by calling device_get_property() function.\n
  *     It returns integer value(0~100) that indicate remaining batterty percentage on success.\n
  *     Or a negative value(-1) is returned on failure.
- * @return On success, integer value(0~100) is returned. 
- *             Or a negative value(-1) is returned on failure.
- * @see device_is_battery_full()
+ * @return On success, integer value(0~100) is returned.
+ *  Or a negative value(-1) is returned on failure.
+ * @see device_is_battery_full(), device_get_battery_pct_raw()
  * @par Example
  * @code
  *     ...
@@ -234,15 +243,38 @@ extern "C" {
  *             printf("Fail to get the remaining battery percentage.\n");
  *     else
  *             printf("remaining battery percentage : %d\n", battery);
- *     ...         
+ *     ...
  * @endcode
  */
        int device_get_battery_pct(void);
 
 /**
  * @par Description:
+ *     This API is used to get the remaining battery percentage expressed 1/10000.\n
+ *     It gets the Battery percentage by calling device_get_property() function.\n
+ *     It returns integer value(0~10000) that indicate remaining batterty percentage on success.\n
+ *     Or a negative value(-1) is returned on failure.
+ * @return On success, integer value(0~10000) is returned.
+ *  Or a negative value(-1) is returned on failure.
+ * @see device_is_battery_full(), device_get_battery_pct()
+ * @par Example
+ * @code
+ *     ...
+ *     int battery;
+ *     battery = device_get_battery_pct_raw();
+ *     if( battery < 0 )
+ *             printf("Fail to get the remaining battery percentage.\n");
+ *     else
+ *             printf("remaining battery percentage expressed 1/10000 : %d\n", battery);
+ *     ...
+ * @endcode
+ */
+       int device_get_battery_pct_raw(void);
+
+/**
+ * @par Description:
  *     This API is used to get the fully charged status of battery.\n
- *     It gets the fully charged status of Battery by calling device_get_property() function.\n
+ *  It gets the fully charged status of Battery by calling device_get_property() function.\n
  *     If the status of battery is full, it returns 1.\n
  *     Or a negative value(-1) is returned, if the status of battery is not full.
  * @return 1 with battery full, or 0 on not full-charged, -1 if failed
@@ -252,7 +284,7 @@ extern "C" {
  *     ...
  *     if ( device_is_battery_full() > 0 )
  *             printf("battery fully chared\n");
- *     ...         
+ *     ...
  * @endcode
  */
        int device_is_battery_full(void);
@@ -287,7 +319,7 @@ extern "C" {
  *  bat_health =device_get_battery_health();
  *  if(bat_health != BAT_GOOD)
  *      printf("battery health is not good\n");
- *  ...         
+ *  ...
  * @endcode
  */
        int device_get_battery_health(void);
@@ -327,11 +359,11 @@ extern "C" {
 
 /**
  * @par Description:
- *     This API is used to set the current brightness of the display.\n 
- *     It sets the current brightness of the display by calling device_set_property() function.\n
+ *     This API is used to set the current brightness of the display.\n
+ *  It sets the current brightness of the display by calling device_set_property() function.\n
  *     MUST use this API very carefully. \n
- *     you MUST set original brightness by device_release_brt_ctrl(), 
- *     after you finish your job using this API. 
+ *     you MUST set original brightness by device_release_brt_ctrl(),
+ *     after you finish your job using this API.
  * @param[in] num display number that you want to set the brightness value
  * @param[in] val brightness value that you want to set
  * @return 0 on success, -1 if failed
@@ -340,9 +372,9 @@ extern "C" {
  * @code
  *     ...
  *     if( device_set_display_brt(0,6) < 0 )
- *                     printf("Fail to set the current brightness of the display0\n");
+ *         printf("Fail to set the current brightness of the display0\n");
  *     else
- *                     printf("The current brightness of the display0 is set 6\n");
+ *         printf("The current brightness of the display0 is set 6\n");
  *     ...
  * @endcode
  */
@@ -351,7 +383,7 @@ extern "C" {
 /**
  * @par Description:
  *     This API is used to release brightness control.\n
- *     It sets the current brightness of the display by calling device_set_property() function.\n
+ *  It sets the current brightness of the display by calling device_set_property() function.\n
  *     MUST call this API after you finished the job which need to change the brightness.
  * @param[in] num display number
  * @return 0 on success, -1 if failed
@@ -372,27 +404,49 @@ extern "C" {
 
 /**
  * @par Description:
- *      This API is used to get the max brightness of the display.\n
- *      It gets the current brightness of the display by calling device_get_property() function.\n
- *      It returns integer value which is the max brightness on success.\n
- *      Or a negative value(-1) is returned on failure
+ *  This API is used to get the min brightness of the display.\n
+ *  It gets the current brightness of the display by calling device_get_property() function.\n
+ *  It returns integer value which is the min brightness on success.\n
+ *  Or a negative value(-1) is returned on failure
+ * @param[in] num display number
+ * @return min brightness value on success, -1 if failed
+ * @par Example
+ * @code
+ *  ...
+ *  int min_brt;
+ *  min_brt = device_get_min_brt(0);
+ *  if( min_brt < 0 )
+ *      printf("Fail to get the min brightness of the display.\n");
+ *  else
+ *      printf("Min brightness of the display is %d\n", min_brt);
+ *  ...
+ * @endcode
+ */
+       int device_get_min_brt(display_num_t num);
+
+/**
+ * @par Description:
+ *  This API is used to get the max brightness of the display.\n
+ *  It gets the current brightness of the display by calling device_get_property() function.\n
+ *  It returns integer value which is the max brightness on success.\n
+ *  Or a negative value(-1) is returned on failure
  * @param[in] num display number
  * @return max brightness value on success, -1 if failed
  * @par Example
  * @code
- *      ...
- *      int max_brt;
- *      max_brt = device_get_max_brt(0);
- *      if( max_brt < 0 )
- *              printf("Fail to get the max brightness of the display.\n");
- *      else
- *              printf("Max brightness of the display is %d\n", max_brt);
- *      ...
+ *  ...
+ *  int max_brt;
+ *  max_brt = device_get_max_brt(0);
+ *  if( max_brt < 0 )
+ *      printf("Fail to get the max brightness of the display.\n");
+ *  else
+ *      printf("Max brightness of the display is %d\n", max_brt);
+ *  ...
  * @endcode
  */
        int device_get_max_brt(display_num_t num);
 
-/** 
+/**
  * @par Description:
  *     LCD gamma values
  */
@@ -410,264 +464,91 @@ extern "C" {
 /**
  * @par Description:
  *     This API is used to get the current gamma of the display.\n
- *      It gets the current gamma of the display by calling device_get_property() function.\n
- *      It returns enum value which is the current gamma on success.\n
- *      Or a negative value(-1) is returned on failure.
+ *  It gets the current gamma of the display by calling device_get_property() function.\n
+ *  It returns enum value which is the current gamma on success.\n
+ *  Or a negative value(-1) is returned on failure.
  * @param[in] num display number that you want to get the gamma value
  * @return current gamma enum value on success, -1 if failed
  * @see device_set_diplay_gamma()
  * @par Example
  * @code
- *      ...
- *      int cur_brt;
- *      cur_brt = device_get_display_gamma(0);
- *      if( cur_brt < 0 )
- *              printf("Fail to get the current gamma of the display.\n");
- *      else
- *              printf("Current gamma of the display is %d\n", cer_brt);
- *      ...
+ *  ...
+ *  int cur_brt;
+ *  cur_brt = device_get_display_gamma(0);
+ *  if( cur_brt < 0 )
+ *     printf("Fail to get the current gamma of the display.\n");
+ *  else
+ *     printf("Current gamma of the display is %d\n", cer_brt);
+ *  ...
  * @endcode
  */
        int device_get_display_gamma(display_num_t num);
 
 /**
  * @par Description:
- *     This API is used to set the specific gamma value of the display .\n 
- *      It sets the specific gamma value of the display by calling device_set_property() function.\n
- *      MUST use this API very carefully. \n
- *      you MUST set original gamma by device_release_gamma_ctrl(), 
- *      after you finish your job using this API. 
+ *     This API is used to set the specific gamma value of the display .\n
+ *  It sets the specific gamma value of the display by calling device_set_property() function.\n
+ *  MUST use this API very carefully. \n
+ *  you MUST set original gamma by device_release_gamma_ctrl(),
+ *  after you finish your job using this API.
  * @param[in] num display number that you want to set the gamma value
  * @param[in] new_val lcd gamma enum value that you want to set
  * @return 0 on success, -1 if failed
  * @see device_get_diplay_gammat(), device_release_gamma_ctrl()
  * @par Example
  * @code
- *      ...
- *      if( device_set_display_gamma(0,1) < 0 )
- *                      printf("Fail to set the specific gamma of the display0\n");
- *      else
- *                      printf("The gamma of the display0 is set 1(LCD_GAMMA_22)\n");
- *      ...
+ *  ...
+ *  if( device_set_display_gamma(0,1) < 0 )
+ *      printf("Fail to set the specific gamma of the display0\n");
+ *  else
+ *      printf("The gamma of the display0 is set 1(LCD_GAMMA_22)\n");
+ *  ...
  * @endcode
  */
        int device_set_display_gamma(display_num_t num,
-                                    display_gamma_t new_val);
+                       display_gamma_t new_val);
 
 /**
  * @par Description:
  *     This API is used to release gamma control.\n
- *      It sets the gamma of the display by calling device_set_property() function.\n
- *      MUST call this API after you finished the job which need to change the gamma.
+ *  It sets the gamma of the display by calling device_set_property() function.\n
+ *  MUST call this API after you finished the job which need to change the gamma.
  * @param[in] num display number
  * @param[in] org_val original gamma enums value before you control the gamma
  * @return 0 on success, -1 if failed
  * @see device_set_display_gamma()
  * @par Example
  * @code
- *      ...
- *      org_val = device_get_display_gamma(0);
- *      device_set_display_gamma(0,2);
- *      ...
- *      ret = device_release_gamma_ctrl(0, org_val);
- *      if( ret < 0 )
- *              printf("Fail to release gamma control\n");
- *      ...
- * @endcode
- */
-       int device_release_gamma_ctrl(display_num_t num,
-                                     display_gamma_t org_val);
-
-/**
- * @par Description:
- *     This API is used to get number of displays on the phone.\n
- *      It gets the current number of displays by calling device_get_display_count() function.\n
- *      It returns enum value which is the current number on success.\n
- *      Or a negative value(-1) is returned on failure.
- * @return 0 on success, -1 if failed
- * @par Example
- * @code
- *     ...
- *     ret = device_get_display_count();
- *     if( ret < 0 )
- *              printf("Fail to get number of displays\n");
- *      ...
- * @endcode
- */
-       int device_get_display_count(void);
-
-/**
- * @par Description:
- * mode - dynamic, standard, natural, movie 
- */
-       enum image_enhance_mode {
-               MODE_DYNAMIC = 0,
-               MODE_STANDARD,
-               MODE_NATURAL,
-               MODE_MOVIE,
-       };
-
-/**
- * @par Description:
- *  This API is used to get image enhance mode.\n
- *  It returns enum value which is the current mode on success.\n
- *  Or a negative value(-1) is returned on failure.
- * @return enum value for current mode on success, -1 if failed
- * @par Example
- * @code
  *  ...
- *  ret = device_get_image_enhance_mode();
- *  if( ret < 0 )
- *      printf("Fail to get current image enhance mode\n");
- *  ...
- * @endcode
- */
-       int device_get_image_enhance_mode(void);
-
-/**
- * @par Description:
- *  This API is used to set image enhance mode.\n
- * @param[in] val mode enum vlaue
- * @return 0 on success, -1 if failed
- * @par Example
- * @code
- *  ...
- *  if( device_set_image_enhance_mode(MODE_DYNAMIC) < 0 )
- *      printf("Fail to set the image enhance mode\n");
- *  ...
- * @endcode
- */
-       int device_set_image_enhance_mode(int val);
-
-/** 
- * @par Description:
- * scenario - ui, gallery, video, vtcall, camera, browser, negative, bypass 
- */
-       enum image_enhance_scenario {
-               SCENARIO_UI = 0,
-               SCENARIO_GALLERY,
-               SCENARIO_VIDEO,
-               SCENARIO_VTCALL,
-               SCENARIO_CAMERA,
-               SCENARIO_BROWSER,
-               SCENARIO_NEGATIVE,
-               SCENARIO_BYPASS,
-       };
-
-/**
- * @par Description:
- *  This API is used to get image enhance scenario.\n
- *  It returns enum value which is the current scenario on success.\n
- *  Or a negative value(-1) is returned on failure.
- * @return enum value for current wcenario on success, -1 if failed
- * @par Example
- * @code
- *  ...
- *  ret = device_get_image_enhance_scenario();
- *  if( ret < 0 )
- *      printf("Fail to get current image enhance scenarioe\n");
- *  ...
- * @endcode
- */
-       int device_get_image_enhance_scenario(void);
-
-/**
- * @par Description:
- *  This API is used to set image enhance scenario.\n
- * @param[in] val scenario enum vlaue
- * @return 0 on success, -1 if failed
- * @par Example
- * @code
- *  ...
- *  if( device_set_image_enhance_scenario(SCENARIO_UI) < 0 )
- *      printf("Fail to set the image enhance scenario\n");
- *  ...
- * @endcode
- */
-       int device_set_image_enhance_scenario(int val);
-
-/** 
- * @par Description:
- * tone - normal, warm, cold 
- */
-       enum image_enhance_tone {
-               TONE_NORMAL = 0,
-               TONE_WARM,
-               TONE_COLD,
-       };
-
-/**
- * @par Description:
- *  This API is used to get image enhance tone.\n
- *  It returns enum value which is the current mode on success.\n
- *  Or a negative value(-1) is returned on failure.
- * @return enum value for current tone on success, -1 if failed
- * @par Example
- * @code
+ *  org_val = device_get_display_gamma(0);
+ *  device_set_display_gamma(0,2);
  *  ...
- *  ret = device_get_image_enhance_tone();
+ *  ret = device_release_gamma_ctrl(0, org_val);
  *  if( ret < 0 )
- *      printf("Fail to get current image enhance tone\n");
- *  ...
- * @endcode
- */
-       int device_get_image_enhance_tone(void);
-
-/**
- * @par Description:
- *  This API is used to set image enhance tone.\n
- * @param[in] val tone vlaue
- * @return 0 on success, -1 if failed
- * @par Example
- * @code
- *  ...
- *  if( device_set_image_enhance_tone(TONE_NORMAL) < 0 )
- *      printf("Fail to set the image enhance tone\n");
+ *      printf("Fail to release gamma control\n");
  *  ...
  * @endcode
  */
-       int device_set_image_enhance_tone(int val);
-
-/** 
- * @par Description:
- * outdoor - off, on
- */
-       enum image_enhance_outdoor {
-               OUTDOOR_OFF = 0,
-               OUTDOOR_ON,
-       };
+       int device_release_gamma_ctrl(display_num_t num,
+                       display_gamma_t org_val);
 
 /**
  * @par Description:
- *  This API is used to get image enhance outdoor.\n
- *  It returns enum value which is the current outdoor on success.\n
+ *     This API is used to get number of displays on the phone.\n
+ *  It gets the current number of displays by calling device_get_display_count() function.\n
+ *  It returns enum value which is the current number on success.\n
  *  Or a negative value(-1) is returned on failure.
- * @return enum value for current outdoor on success, -1 if failed
- * @par Example
- * @code
- *  ...
- *  ret = device_get_image_enhance_ourdoor();
- *  if( ret < 0 )
- *      printf("Fail to get current image enhance outdoor\n");
- *  ...
- * @endcode
- */
-       int device_get_image_enhance_outdoor(void);
-
-/**
- * @par Description:
- *  This API is used to set image enhance outdoor.\n
- * @param[in] val outdoor vlaue
  * @return 0 on success, -1 if failed
  * @par Example
  * @code
- *  ...
- *  if( device_set_image_enhance_outdoor(TONE_NORMAL) < 0 )
- *      printf("Fail to set the image enhance outdoor\n");
+ *     ...
+ *     ret = device_get_display_count();
+ *     if( ret < 0 )
+ *      printf("Fail to get number of displays\n");
  *  ...
  * @endcode
  */
-       int device_set_image_enhance_outdoor(int val);
+       int device_get_display_count(void);
 
 /**
  * @par Description:
@@ -680,8 +561,8 @@ extern "C" {
  *     ...
  *     ret = device_power_suspend();
  *     if( ret < 0 )
- *              printf("Fail to make the phone go to a suspend (sleep) state\n");
- *      ...
+ *      printf("Fail to make the phone go to a suspend (sleep) state\n");
+ *  ...
  * @endcode
  */
        int device_power_suspend(void);
@@ -710,7 +591,7 @@ extern "C" {
 
 /**
  * @par Description:
- *  This API is used to set the current brightness of the led.\n 
+ *  This API is used to set the current brightness of the led.\n
  *      It sets the current brightness of the led by calling device_set_property() function.\n
  * @param[in] val brightness value that you want to set
  * @return 0 on success, -1 if failed
@@ -766,7 +647,7 @@ extern "C" {
 
 /**
  * @par Description:
- *  This API is used to set the current status for acl.\n 
+ *  This API is used to set the current status for acl.\n
  *  It sets the current status for acl by calling device_set_property() function.\n
  * @param[in] num display number that you want to set the brightness value
  * @param[in] val status for acl(1 on, 0 off) that you want to set