eb20dde57f194d00a6ee83487720e0237b422467
[mirrors/FD230.git] /
1 /*
2  * @Author: luozheng 1732036298@qq.com
3  * @Date: 2024-04-25 11:49:58
4  * @LastEditors: luozheng 1732036298@qq.com
5  * @LastEditTime: 2024-05-06 15:00:23
6  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h
7  */
8
9 #ifndef BLUETOOTH_SERVICE_OPTIONS_VIEW_H
10 #define BLUETOOTH_SERVICE_OPTIONS_VIEW_H
11
12 #include "BaseView.h"
13 #include "View.h"
14 #include "components/root_view.h"
15 #include "components/ui_scroll_view.h"
16 #include "components/ui_label_ext.h"
17 #include "components/ui_button.h"
18 #include "components/ui_image_view.h"
19 #include "components/ui_toggle_button.h"
20 namespace OHOS
21 {
22     // 返回setting视图界面
23     class BluetoothServiceOptionsPresenter;
24     class BluetoothServiceOptionsView : public View<BluetoothServiceOptionsPresenter>
25     {
26     public:
27         struct LabelConfig
28         {
29             int16_t left;
30             int16_t top;
31             int16_t width;
32             int16_t height;
33             int16_t fontSize;      // 字体大小
34             int16_t lineHeigh;     // 行高
35             //const char *text;      // 文本
36             uint16_t textId;      
37             uint8_t lineBreakMode; // 断行模式。
38         };
39         BluetoothServiceOptionsView();
40         virtual ~BluetoothServiceOptionsView();
41         static BluetoothServiceOptionsView *GetInstance(void);
42         void BluetoothServiceOptionsViewInit(void);
43         void ClearAll(void);
44         UIToggleButton *GetHFP_ToggleButton(void);
45         UIToggleButton *GetA2DP_ToggleButton(void);
46
47     public:
48         virtual void OnStart() override;
49         virtual void OnSetUpView() override;
50         virtual void OnTearDownView() override;
51         virtual void OnStop() override;
52
53     private:
54         bool SetUpBlueToothScrollView(void);
55         UILabelExt *SetBluetoothServiceOptionsViewLabel(LabelConfig &labelconfig);
56         bool SetUpBlueToothLabel(void);
57         bool SetUpBlueToothToggleButton(void);
58         bool SetUpBlueToothImageView(void);
59         UIScrollView *BlueToothScrollView = nullptr;
60         UILabelExt *Title = nullptr;
61         UILabelExt *HFP_Label{nullptr};
62         UILabelExt *A2DP_Label{nullptr};
63         UIImageView *HFP_Image{nullptr};
64         UIImageView *A2DP_Image{nullptr};
65         UIToggleButton *HFP_ToggleButton{nullptr};  // HFP
66         UIToggleButton *A2DP_ToggleButton{nullptr}; // A2DP
67         bool initViewStatus{false};
68     };
69 }
70 #endif