• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 #ifndef I_SECURITY_COMPONENT_SAVE_BUTTON_H
16 #define I_SECURITY_COMPONENT_SAVE_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 SaveDesc : int32_t {
27     DOWNLOAD = 0,
28     DOWNLOAD_FILE = 1,
29     SAVE = 2,
30     SAVE_IMAGE = 3,
31     SAVE_FILE = 4,
32     DOWNLOAD_AND_SHARE = 5,
33     RECEIVE = 6,
34     CONTINUE_TO_RECEIVE = 7,
35     MAX_LABEL_TYPE
36 };
37 
38 enum class SaveIcon : int32_t {
39     FILLED_ICON = 0,
40     LINE_ICON = 1,
41     MAX_ICON_TYPE
42 };
43 
44 class SaveButton : public SecCompBase {
45 public:
46     virtual bool IsTextIconTypeValid() override;
47     virtual bool IsCorrespondenceType() override;
48     virtual bool CompareComponentBasicInfo(SecCompBase *other, bool isRectCheck) const override;
49 private:
50     bool ParseStyle(const nlohmann::json& json, const std::string& tag);
51 };
52 }  // namespace SecurityComponent
53 }  // namespace Security
54 }  // namespace OHOS
55 #endif  // I_SECURITY_COMPONENT_SAVE_BUTTON_H
56