1 /* 2 * Copyright (c) 2023-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 I_SECURITY_COMPONENT_LOCATION_BUTTON_H 16 #define I_SECURITY_COMPONENT_LOCATION_BUTTON_H 17 18 #include <string> 19 #include "nlohmann/json.hpp" 20 #include "sec_comp_base.h" 21 #include "sec_comp_info.h" 22 23 namespace OHOS { 24 namespace Security { 25 namespace SecurityComponent { 26 enum class LocationDesc : int32_t { 27 CURRENT_LOCATION = 0, 28 ADD_LOCATION = 1, 29 SELECT_LOCATION = 2, 30 SHARE_LOCATION = 3, 31 SEND_LOCATION = 4, 32 LOCATING = 5, 33 LOCATION = 6, 34 SEND_CURRENT_LOCATION = 7, 35 RELOCATION = 8, 36 PUNCH_IN = 9, 37 CURRENT_POSITION = 10, 38 MAX_LABEL_TYPE 39 }; 40 41 enum class LocationIcon : int32_t { 42 FILLED_ICON = 0, 43 LINE_ICON = 1, 44 MAX_ICON_TYPE 45 }; 46 47 class __attribute__((visibility("default"))) LocationButton : public SecCompBase { 48 public: 49 virtual bool IsTextIconTypeValid() override; 50 virtual bool IsCorrespondenceType() override; 51 virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const override; 52 private: 53 bool ParseStyle(const nlohmann::json& json, const std::string& tag); 54 }; 55 } // namespace SecurityComponent 56 } // namespace Security 57 } // namespace OHOS 58 #endif // I_SECURITY_COMPONENT_LOCATION_BUTTON_H 59