File Manager / inc / model /

fs-manager.h

  1. /*
  2. * Copyright 2014 -2015 Samsung Electronics Co., Ltd All Rights Reserved
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17.  
  18. #ifndef _FS_MANAGER_H_
  19. #define _FS_MANAGER_H_
  20.  
  21. #include <Eina.h>
  22.  
  23. /* Forward declaration: */
  24.  
  25. typedef struct _fs_manager fs_manager;
  26.  
  27. /**
  28. * @brief Prototype of operation complete user callback function
  29. */
  30. typedef void (*fs_manager_complete_cb_func)(void *cb_data, int result);
  31.  
  32. /**
  33. * @brief Create file system manager instance
  34. * @return File system manager instance on success, otherwise NULL
  35. */
  36. fs_manager *fs_manager_create();
  37.  
  38. /**
  39. * @brief Destroy file system manager instance
  40. * @param[in] manager File system manager instance
  41. */
  42. void fs_manager_destroy(fs_manager *manager);
  43.  
  44. /**
  45. * @brief Gets list of available storages
  46. * @param[in] manager File system manager instance
  47. * @param[out] storage_list Storage list to be set
  48. * @return Error code. RESULT_TYPE_OK if operation success.
  49. */
  50. int fs_manager_get_storage_list(fs_manager *manager, Eina_List **storage_list);
  51.  
  52. /**
  53. * @brief Gets from directory lists of its files and sub directories
  54. * @param[in] manager File system manager instance
  55. * @param[in] dir_path Directory fullpath
  56. * @param[out] file_list List of directory sub directories and files
  57. * @return Error code. RESULT_TYPE_OK if operation success.
  58. */
  59. int fs_manager_get_file_list(fs_manager *manager,
  60. const char *dir_path,
  61. Eina_List **file_list);
  62.  
  63. /**
  64. * @brief Copy selected files to set destination
  65. * @param[in] manager File system manager instance
  66. * @param[in] selected_list Selected files list to copy
  67. * @param[in] dest_path Destination path
  68. * @param[in] cb_func Operation complete user callback function
  69. * @param[in] cb_data User callback data
  70. * @return Error code. RESULT_TYPE_OK if operation success.
  71. */
  72. int fs_manager_copy_files(fs_manager *manager,
  73. Eina_List *selected_list,
  74. const char *dest_path,
  75. fs_manager_complete_cb_func cb_func,
  76. void *cb_data);
  77.  
  78. /**
  79. * @brief Move selected files to set destination
  80. * @param[in] manager File system manager instance
  81. * @param[in] selected_list Selected files list to move
  82. * @param[in] dest_path Destination path
  83. * @param[in] cb_func Operation complete user callback function
  84. * @param[in] cb_data User callback data
  85. * @return Error code. RESULT_TYPE_OK if operation success.
  86. */
  87. int fs_manager_move_files(fs_manager *manager,
  88. Eina_List *selected_list,
  89. const char *dest_path,
  90. fs_manager_complete_cb_func cb_func,
  91. void *cb_data);
  92.  
  93. /**
  94. * @brief Delete selected files
  95. * @param[in] manager File system manager instance
  96. * @param[in] selected_list Selected files list to delete
  97. * @param[in] cb_func Operation complete user callback function
  98. * @param[in] cb_data User callback data
  99. * @return Error code. RESULT_TYPE_OK if operation success.
  100. */
  101. int fs_manager_delete_files(fs_manager *manager,
  102. Eina_List *selected_list,
  103. fs_manager_complete_cb_func cb_func,
  104. void *cb_data);
  105.  
  106. /**
  107. * @brief Creates new folder by set folder full path
  108. * @param[in] manager File system manager instance
  109. * @param[in] dir New directory full path
  110. * @return Error code. RESULT_TYPE_OK if operation success.
  111. */
  112. int fs_manager_create_folder(fs_manager *manager, const char *dir);
  113.  
  114. #endif /* _FS_MANAGER_H_ */