Apply requirement for gcov automation
[platform/core/system/libstorage.git] / include / storage-expand.h
index 48c26b8..dbc24c3 100644 (file)
@@ -50,8 +50,9 @@ typedef enum {
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef enum {
-       STORAGE_TYPE_INTERNAL, /**< Internal device storage (built-in storage in a device, non-removable) */
-       STORAGE_TYPE_EXTERNAL, /**< External storage */
+       STORAGE_TYPE_INTERNAL,          /**< Internal device storage (built-in storage in a device, non-removable) */
+       STORAGE_TYPE_EXTERNAL,          /**< External storage */
+       STORAGE_TYPE_EXTENDED_INTERNAL, /**< Extended internal storage (External storage used as internal storage) (Since 4.0) */
 } storage_type_e;
 
 
@@ -106,8 +107,9 @@ int storage_foreach_device_supported(storage_device_supported_cb callback, void
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @remarks Files saved on the internal/external storage are readable or writable by all applications.\n
  *          When an application is uninstalled, the files written by that application are not removed from the internal/external storage.\n
- *          If you want to access files or directories in internal storage, you must declare http://tizen.org/privilege/mediastorage.\n
- *          If you want to access files or directories in external storage, you must declare http://tizen.org/privilege/externalstorage.\n
+ *          If you want to access files or directories in internal storage, you must declare %http://tizen.org/privilege/mediastorage.\n
+ *          If you want to access files or directories in external storage, you must declare %http://tizen.org/privilege/externalstorage.\n
+ *          Refer to <a href="https://docs.tizen.org/application/native/guides/security/privacy-related-permissions"><b>Privacy-related Permissions</b></a>.\n
  *          You must release @a path using free().
  * @param[in] storage_id The storage device
  * @param[out] path The absolute path to the storage directory
@@ -117,6 +119,7 @@ int storage_foreach_device_supported(storage_device_supported_cb callback, void
  * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STORAGE_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STORAGE_ERROR_NOT_SUPPORTED Storage not supported
+ * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
  * @see storage_get_state()
  */
 int storage_get_root_directory(int storage_id, char **path);
@@ -146,9 +149,9 @@ typedef enum {
  * @remarks Files saved on the internal/external storage are readable or writable by all applications.\n
  *          When an application is uninstalled, the files written by that application are not removed from the internal/external storage.\n
  *          The directory path may not exist, so you must make sure that it exists before using it.\n
- *          If you want to access files or directories in internal storage except #STORAGE_DIRECTORY_SYSTEM_RINGTONES, you must declare http://tizen.org/privilege/mediastorage.\n
- *          If you want to access files or directories in #STORAGE_DIRECTORY_SYSTEM_RINGTONES, you must declare %http://tizen.org/privilege/systemsettings.\n
- *          If you want to access files or directories in external storage, you must declare http://tizen.org/privilege/externalstorage.\n
+ *          If you want to access files or directories in internal storage, you must declare %http://tizen.org/privilege/mediastorage.\n
+ *          If you want to access files or directories in external storage, you must declare %http://tizen.org/privilege/externalstorage.\n
+ *          Refer to <a href="https://docs.tizen.org/application/native/guides/security/privacy-related-permissions"><b>Privacy-related Permissions</b></a>.\n
  *          You must release @a path using free().
  * @param[in] storage_id The storage device
  * @param[in] type The directory type
@@ -159,6 +162,7 @@ typedef enum {
  * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STORAGE_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STORAGE_ERROR_NOT_SUPPORTED Storage not supported
+ * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
  * @see storage_get_state()
  */
 int storage_get_directory(int storage_id, storage_directory_e type, char **path);
@@ -173,7 +177,9 @@ int storage_get_directory(int storage_id, storage_directory_e type, char **path)
  *         otherwise a negative error value
  * @retval #STORAGE_ERROR_NONE Successful
  * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STORAGE_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STORAGE_ERROR_NOT_SUPPORTED Storage not supported
+ * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
  */
 int storage_get_type(int storage_id, storage_type_e *type);
 
@@ -187,7 +193,9 @@ int storage_get_type(int storage_id, storage_type_e *type);
  *         otherwise a negative error value
  * @retval #STORAGE_ERROR_NONE Successful
  * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STORAGE_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STORAGE_ERROR_NOT_SUPPORTED Storage not supported
+ * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
  * @see storage_get_root_directory()
  * @see storage_get_total_space()
  * @see storage_get_available_space()
@@ -249,8 +257,9 @@ int storage_unset_state_changed_cb(int storage_id, storage_state_changed_cb call
  * @since_tizen 3.0
  */
 typedef enum {
-       STORAGE_DEV_EXT_SDCARD = 1001, /**< sdcard device (external storage) */
-       STORAGE_DEV_EXT_USB_MASS_STORAGE, /**< USB storage device (external storage) */
+       STORAGE_DEV_EXT_SDCARD = 1001,     /**< SD card device (external storage) */
+       STORAGE_DEV_EXT_USB_MASS_STORAGE,  /**< USB storage device (external storage) */
+       STORAGE_DEV_EXTENDED_INTERNAL,     /**< Extended internal storage device (External storage used as internal storage) (Since 4.0) */
 } storage_dev_e;
 
 
@@ -258,7 +267,7 @@ typedef enum {
  * @brief Called when the state of a storage type changes.
  * @since_tizen 3.0
  * @param[in] storage_id The unique storage ID
- * @param[in] type The type of the storage device
+ * @param[in] dev The type of the external storage device
  * @param[in] state The state of the storage
  * @param[in] fstype The type of the file system
  * @param[in] fsuuid The uuid of the file system
@@ -321,6 +330,7 @@ int storage_unset_changed_cb(storage_type_e type, storage_changed_cb callback);
  *         otherwise a negative error value
  * @retval #STORAGE_ERROR_NONE Successful
  * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STORAGE_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STORAGE_ERROR_NOT_SUPPORTED Storage not supported
  * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
  * @see storage_get_state()
@@ -338,6 +348,7 @@ int storage_get_total_space(int storage_id, unsigned long long *bytes);
  *         otherwise a negative error value
  * @retval #STORAGE_ERROR_NONE Successful
  * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STORAGE_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STORAGE_ERROR_NOT_SUPPORTED Storage not supported
  * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
  * @see storage_get_state()
@@ -347,6 +358,30 @@ int storage_get_available_space(int storage_id, unsigned long long *bytes);
 
 
 /**
+ * @brief Gets the type and the kind of external device for the given storage id.
+ *
+ * @since_tizen 5.0
+ *
+ * @remarks This function works only for external storages.
+ * If @a type is #STORAGE_TYPE_INTERNAL, this function returns #STORAGE_ERROR_INVALID_PARAMETER and @a dev is unchanged.
+ *
+ * @param[in] storage_id The storage id
+ * @param[out] type The storage @a type (internal or external). If @a type is #STORAGE_TYPE_INTERNAL, this function returns #STORAGE_ERROR_INVALID_PARAMETER and @a dev is unchanged.
+ * @param[out] dev The storage device for external storage.
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #STORAGE_ERROR_NONE               Successful
+ * @retval #STORAGE_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #STORAGE_ERROR_OUT_OF_MEMORY      Out of memory
+ * @retval #STORAGE_ERROR_NOT_SUPPORTED      Storage not supported
+ * @retval #STORAGE_ERROR_OPERATION_FAILED   Operation failed
+ */
+int storage_get_type_dev(int storage_id, storage_type_e *type, storage_dev_e *dev);
+
+
+/**
  * @}
  */