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 Privacy 18 * @{ 19 * 20 * @brief Provides sensitive data access management. 21 * 22 * @since 8.0 23 * @version 8.0 24 */ 25 26 /** 27 * @file perm_active_status_customized_cbk.h 28 * 29 * @brief Declares PermActiveStatusCustomizedCbk class. 30 * 31 * @since 8.0 32 * @version 8.0 33 */ 34 35 #ifndef PERM_ACTIVE_STATUS_CUSTOMIZED_CBK_H 36 #define PERM_ACTIVE_STATUS_CUSTOMIZED_CBK_H 37 38 #include <string> 39 #include <vector> 40 41 #include "access_token.h" 42 #include "active_change_response_info.h" 43 44 namespace OHOS { 45 namespace Security { 46 namespace AccessToken { 47 /** 48 * @brief Declares PermActiveStatusCustomizedCbk class 49 */ 50 class PermActiveStatusCustomizedCbk { 51 public: 52 /** 53 * @brief Constructor without any param. 54 */ 55 PermActiveStatusCustomizedCbk(); 56 /** 57 * @brief Constructor with param. 58 * @param permList permission name list quote 59 */ 60 explicit PermActiveStatusCustomizedCbk(const std::vector<std::string>& permList); 61 /** 62 * @brief Destructor without any param. 63 */ 64 virtual ~PermActiveStatusCustomizedCbk(); 65 66 /** 67 * @brief Pure virtual function for callback. 68 * @param result ActiveChangeResponse quote 69 */ 70 virtual void ActiveStatusChangeCallback(ActiveChangeResponse& result) = 0; 71 72 /** 73 * @brief Get private permission name list permList_. 74 * @param permList string list quote as return value 75 */ 76 void GetPermList(std::vector<std::string>& permList) const; 77 78 private: 79 /** private variable permission name list */ 80 std::vector<std::string> permList_; 81 }; 82 } // namespace AccessToken 83 } // namespace Security 84 } // namespace OHOS 85 86 #endif // PERM_ACTIVE_STATUS_CUSTOMIZED_CBK_H