1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup Environment 18 * @{ 19 * 20 * @brief This module provides the ability to access the environment directory and obtain the native interface 21 for public root directory. 22 * @since 12 23 */ 24 25 /** 26 * @file oh_environment.h 27 * 28 * @brief Provide environment APIS. 29 * @kit CoreFileKit 30 * @library libohenvironment.so 31 * @syscap SystemCapability.FileManagement.File.Environment.FolderObtain 32 * @since 12 33 */ 34 35 #ifndef FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H 36 #define FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H 37 38 #include "error_code.h" 39 40 #ifdef __cplusplus 41 extern "C" { 42 #endif 43 /** 44 * @brief Get the user Download directory. 45 * 46 * @param result Output a pointer to a string. Please use free() to clear the resource. 47 * @return Return the status code of the execution. 48 * {@link PARAMETER_ERROR} 401 - Invalid input parameter, pointer is null. 49 * {@link DEVICE_NOT_SUPPORTED} 801 - Device not supported. 50 * {@link E_NOMEM} 13900011 - Failed to apply for memory. 51 * @since 12 52 */ 53 FileManagement_ErrCode OH_Environment_GetUserDownloadDir(char **result); 54 55 /** 56 * @brief Get the user Desktop directory. 57 * 58 * @param result Output a pointer to a string. Please use free() to clear the resource. 59 * @return Return the status code of the execution. 60 * {@link PARAMETER_ERROR} 401 - Invalid input parameter, pointer is null. 61 * {@link DEVICE_NOT_SUPPORTED} 801 - Device not supported. 62 * {@link E_NOMEM} 13900011 - Failed to apply for memory. 63 * @since 12 64 */ 65 FileManagement_ErrCode OH_Environment_GetUserDesktopDir(char **result); 66 67 /** 68 * @brief Get the user Document directory. 69 * 70 * @param result Output a pointer to a string. Please use free() to clear the resource. 71 * @return Return the status code of the execution. 72 * {@link PARAMETER_ERROR} 401 - Invalid input parameter, pointer is null. 73 * {@link DEVICE_NOT_SUPPORTED} 801 - Device not supported. 74 * {@link E_NOMEM} 13900011 - Failed to apply for memory. 75 * @since 12 76 */ 77 FileManagement_ErrCode OH_Environment_GetUserDocumentDir(char **result); 78 79 #ifdef __cplusplus 80 }; 81 #endif 82 83 #endif //FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H 84 /** @} */ 85