• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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
21  *        or disconnecting from AAs.
22  *
23  * Abilities are classified into Feature Abilities (FAs) and Atomic Abilities (AAs). FAs support the Page template,
24  * and AAs support the Service template. An ability using the Page template is called Page ability for short and that
25  * using the Service template is called Service ability.
26  *
27  * @since 1
28  * @version 1
29  */
30 
31 /**
32  * @file ability_state.h
33  *
34  * @brief Declares ability-related functions, including ability lifecycle callbacks and functions for connecting to
35  *        or disconnecting from AAs.
36  * As the fundamental unit of OpenHarmony, abilities are classified into Feature Abilities (FAs) and Atomic
37  * Abilities (AAs). FAs support the Page template, and AAs support the Service template. An ability using the Page
38  * template is called Page ability for short and that using the Service template is called Service ability.
39  *
40  * @since 1
41  * @version 1
42  */
43 #ifndef OHOS_ABILITY_STATE_H
44 #define OHOS_ABILITY_STATE_H
45 
46 #ifdef __cplusplus
47 #if __cplusplus
48 extern "C" {
49 #endif
50 #endif /* __cplusplus */
51 /**
52  * @brief Enumerates all lifecycle states that an ability will go through over the course of its lifetime.
53  *
54  * @since 1
55  * @version 1
56  */
57 typedef enum {
58     /**
59      * Initial state: An ability is in this state after it is initialized or stopped.
60      */
61     STATE_INITIAL,
62 
63     /**
64      * Inactive state: An ability is in this state when it is switched to the foreground but is not interactive.
65      */
66     STATE_INACTIVE,
67 
68     /**
69      * Active state: An ability is in this state when it is switched to the foreground and is interactive.
70      */
71     STATE_ACTIVE,
72 
73     /**
74      * Background state: An ability is in this state after it returns to the background.
75      */
76     STATE_BACKGROUND,
77     STATE_SUSPENDED,
78     STATE_INACTIVATING,
79     STATE_ACTIVATING,
80     STATE_MOVING_BACKGROUND,
81     STATE_TERMINATING,
82 } State;
83 #ifdef __cplusplus
84 #if __cplusplus
85 }
86 #endif
87 #endif /* __cplusplus */
88 
89 #endif  // OHOS_ABILITY_STATE_H
90