• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2023 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 AccessToken
18  * @{
19  *
20  * @brief Provides permission management interfaces.
21  *
22  * Provides tokenID-based application permission verification mechanism.
23  * When an application accesses sensitive data or APIs, this module can check
24  * whether the application has the corresponding permission. Allows applications
25  * to query their access token information or APL levcels based on token IDs.
26  *
27  * @since 7.0
28  * @version 7.0
29  */
30 
31 /**
32  * @file perm_state_change_callback_customize.h
33  *
34  * @brief Declares permission state change callback class.
35  *
36  * @since 8.0
37  * @version 8.0
38  */
39 
40 #ifndef INTERFACES_INNER_KITS_PERM_STATE_CALLBACK_CUSTOMIZE_H
41 #define INTERFACES_INNER_KITS_PERM_STATE_CALLBACK_CUSTOMIZE_H
42 
43 #include "permission_state_change_info.h"
44 
45 namespace OHOS {
46 namespace Security {
47 namespace AccessToken {
48 /**
49  * @brief Declares permission state change callback customize class
50  */
51 class PermStateChangeCallbackCustomize {
52 public:
53     /**
54      * @brief Constructor without any param.
55      */
56     PermStateChangeCallbackCustomize();
57     /**
58      * @brief Constructor with param.
59      * @param scopeInfo struct PermStateChangeScope quote
60      */
61     explicit PermStateChangeCallbackCustomize(const PermStateChangeScope &scopeInfo);
62     /**
63      * @brief Destructor without any param.
64      */
65     virtual ~PermStateChangeCallbackCustomize();
66 
67     /**
68      * @brief Pure virtual function for callback.
69      * @param result PermStateChangeInfo quote
70      */
71     virtual void PermStateChangeCallback(PermStateChangeInfo& result) = 0;
72 
73     /**
74      * @brief Get private variable scopeInfo_.
75      * @param scopeInfo struct PermStateChangeScope quote as return value
76      */
77     void GetScope(PermStateChangeScope &scopeInfo) const;
78 
79 private:
80     /** private variable struct PermStateChangeScope */
81     PermStateChangeScope scopeInfo_;
82 };
83 } // namespace AccessToken
84 } // namespace Security
85 } // namespace OHOS
86 
87 #endif  // INTERFACES_INNER_KITS_PERM_STATE_CALLBACK_CUSTOMIZE_H