1 /* 2 * Copyright (c) 2020 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 AbilityKit 18 * @{ 19 * 20 * @brief Provides ability-related functions, including ability lifecycle callbacks and functions for connecting to or 21 * disconnecting from Particle Abilities. 22 * 23 * Abilities are classified into Feature Abilities and Particle Abilities. Feature Abilities support the Page template, 24 * and Particle Abilities support the Service template. An ability using the Page template is called a Page ability for 25 * short and that using the Service template is called a Service ability. 26 * 27 * @since 1.0 28 * @version 1.0 29 */ 30 31 /** 32 * @file ability_env.h 33 * 34 * @brief Declares functions for obtaining information about the runtime environment of the application to which the 35 * ability belongs, including the bundle name, source code path, and data path. 36 * 37 * @since 1.0 38 * @version 1.0 39 */ 40 #ifndef OHOS_ABILITY_ENV_H 41 #define OHOS_ABILITY_ENV_H 42 43 #ifdef __cplusplus 44 #if __cplusplus 45 extern "C" { 46 #endif 47 #endif 48 49 /** 50 * @brief Obtains the bundle name of the application to which this ability belongs. 51 * 52 * @return Returns the pointer to the bundle name if the operation is successful; returns a null pointer otherwise. 53 */ 54 const char *GetBundleName(void); 55 56 /** 57 * @brief Obtains the source code path of this ability. 58 * 59 * @return Returns the pointer to the source code path of this ability. 60 */ 61 const char *GetSrcPath(void); 62 63 /** 64 * @brief Obtains the data path of this ability. 65 * 66 * @return Returns the pointer to the data path of this ability. 67 */ 68 const char *GetDataPath(void); 69 70 #ifdef __cplusplus 71 #if __cplusplus 72 } 73 #endif 74 #endif 75 76 #endif // OHOS_ABILITY_ENV_H