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 * @brief This module provides the ability to access the environment directory and obtain the native interface 20 for public root directory. 21 * @since 12 22 */ 23 24 /** 25 * @file oh_environment.h 26 * 27 * @brief Provide environment APIS. 28 * @kit CoreFileKit 29 * @library libohenvironment.so 30 * @syscap SystemCapability.FileManagement.File.Environment.FolderObtain 31 * @since 12 32 */ 33 34 #ifndef FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H 35 #define FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H 36 37 #include "error_code.h" 38 39 #ifdef __cplusplus 40 extern "C" { 41 #endif 42 /** 43 * @brief Get the user Download directory. 44 * 45 * @param result Output a pointer to a string. Please use free() to clear the resource. 46 * @return Return the status code of the execution. 47 * {@link PARAMETER_ERROR} 401 - Invalid input parameter, pointer is null. 48 * {@link DEVICE_NOT_SUPPORTED} 801 - Device not supported. 49 * {@link E_NOMEM} 13900011 - Failed to apply for memory. 50 * @since 12 51 */ 52 FileManagement_ErrCode OH_Environment_GetUserDownloadDir(char **result); 53 54 /** 55 * @brief Get the user Desktop directory. 56 * 57 * @param result Output a pointer to a string. Please use free() to clear the resource. 58 * @return Return the status code of the execution. 59 * {@link PARAMETER_ERROR} 401 - Invalid input parameter, pointer is null. 60 * {@link DEVICE_NOT_SUPPORTED} 801 - Device not supported. 61 * {@link E_NOMEM} 13900011 - Failed to apply for memory. 62 * @since 12 63 */ 64 FileManagement_ErrCode OH_Environment_GetUserDesktopDir(char **result); 65 66 /** 67 * @brief Get the user Document directory. 68 * 69 * @param result Output a pointer to a string. Please use free() to clear the resource. 70 * @return Return the status code of the execution. 71 * {@link PARAMETER_ERROR} 401 - Invalid input parameter, pointer is null. 72 * {@link DEVICE_NOT_SUPPORTED} 801 - Device not supported. 73 * {@link E_NOMEM} 13900011 - Failed to apply for memory. 74 * @since 12 75 */ 76 FileManagement_ErrCode OH_Environment_GetUserDocumentDir(char **result); 77 78 #ifdef __cplusplus 79 }; 80 #endif 81 82 #endif //FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H 83