• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 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 #ifndef OHOS_SETTING_WIFI_INPUT_PASSWORD_ABILITY_SLICE_H
17 #define OHOS_SETTING_WIFI_INPUT_PASSWORD_ABILITY_SLICE_H
18 
19 #include "ability_loader.h"
20 #include "common/task.h"
21 #include "components/ui_checkbox.h"
22 #include "components/ui_image_view.h"
23 #include "components/ui_label.h"
24 #include "components/ui_label_button.h"
25 #include "components/ui_list.h"
26 #include "components/ui_scroll_view.h"
27 #include "components/ui_view_group.h"
28 #include "event_listener.h"
29 #include "parameter.h"
30 #include "setting_utils.h"
31 #include "setting_wifi_input_password_ability_slice.h"
32 #include "wpa_work.h"
33 
34 namespace OHOS {
35 class SettingWifiInputPasswordAbilitySlice : public AbilitySlice {
36 public:
SettingWifiInputPasswordAbilitySlice()37     SettingWifiInputPasswordAbilitySlice() : headView_(nullptr), inputView_(nullptr), lablelCursorText_(nullptr),
38                                              scrollView_(nullptr), rootView_(nullptr), lablelInputText_(nullptr),
39                                              buttonBackListener_(nullptr) {}
40     virtual ~SettingWifiInputPasswordAbilitySlice();
41 
42 protected:
43     void OnStart(const Want& want) override;
44     void OnInactive() override;
45     void OnActive(const Want& want) override;
46     void OnBackground() override;
47     void OnStop() override;
48 
49 private:
50     void SetHead();
51     void SetInput();
52     void AddInputKeyBoardZero();
53     void SetScrollView();
54     void SetButtonListener();
55     UIViewGroup* headView_;
56     UIViewGroup* inputView_;
57     UILabel* lablelCursorText_;
58     UIScrollView* scrollView_;
59     RootView* rootView_;
60     UILabel* lablelInputText_;
61     EventListener* buttonBackListener_;
62 
63     constexpr static int CURSOR_POSITION_OFFSET = 16;
64     constexpr static int RECT_RADIUS = 6;
65     constexpr static int INPUT_X = 36;
66     constexpr static int INPUT_Y = 108;
67     constexpr static int INPUT_WIDTH = 888;
68     constexpr static int INPUT_HEIGHT = 54;
69     constexpr static int INPUT_RADIUS = 32;
70     constexpr static int INPUT_CURSOR_X = 20;
71     constexpr static int INPUT_CURSOR_Y = 10;
72     constexpr static int INPUT_CURSOR_WIDTH = 2;
73     constexpr static int INPUT_CURSOR_HEIGHT = 36;
74     constexpr static int INPUT_TEXT_X = 24;
75     constexpr static int INPUT_TEXT_Y = 11;
76     constexpr static int INPUT_TEXT_WIDTH = 480;
77     constexpr static int INPUT_TEXT_HEIGHT = 38;
78     constexpr static int INPUT_FONT_SIZE = 28;
79     constexpr static int INPUT_ENTER_X = 824;
80     constexpr static int INPUT_ENTER_Y = 6;
81     constexpr static int INPUT_ENTER_WIDTH = 58;
82     constexpr static int INPUT_ENTER_HEIGHT = 42;
83     constexpr static int INPUT_ENTER_RADIUS = 32;
84 
85     constexpr static int INPUT_IMAGE_X = 10;
86     constexpr static int INPUT_IMAGE_Y = 2;
87     constexpr static int INPUT_IMAGE_WIDTH = 38;
88     constexpr static int INPUT_IMAGE_HEIGHT = 38;
89 
90     constexpr static int BUTTON_NUM = 3;
91 
92     constexpr static int BUTTON_INTERVAL_X = 172;
93     constexpr static int BUTTON_INTERVAL_Y = 66;
94     constexpr static int BUTTON_WIDTH = 160;
95     constexpr static int BUTTON_HEIGHT = 54;
96 
97     constexpr static int SCROLL_WIFI_INPUT_X = 228;
98     constexpr static int SCROLL_WIFI_INPUT_Y = 198;
99     constexpr static int SCROLL_WIFI_INPUT_WIDTH = 530;
100     constexpr static int SCROLL_WIFI_INPUT_HEIGHT = 252;
101 };
102 
103 } // namespace OHOS
104 #endif
105