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