99e98c2c13402c2aef3f2fea3897d512d474704e
[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
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 #include "aivoice/include/AiVoiceConnectingView.h"
21 namespace OHOS
22 {
23     // 返回setting视图界面
24     class BluetoothServiceOptionsPresenter;
25     class BluetoothServiceOptionsView : public View<BluetoothServiceOptionsPresenter>
26     {
27     public:
28         struct LabelConfig
29         {
30             int16_t left;
31             int16_t top;
32             int16_t width;
33             int16_t height;
34             int16_t fontSize;      // 字体大小
35             int16_t lineHeigh;     // 行高
36             //const char *text;      // 文本
37             uint16_t textId;      
38             uint8_t lineBreakMode; // 断行模式。
39         };
40
41         typedef enum 
42         {
43             CONNECT_HFP = 0,
44             DISCONNECT_HFP,
45             CONNECT_A2DP,
46             DISCONNECT_A2DP,
47         } BluetoothServiceOptionsView_state;
48
49         BluetoothServiceOptionsView();
50         virtual ~BluetoothServiceOptionsView();
51         static BluetoothServiceOptionsView *GetInstance(void);
52         void BluetoothServiceOptionsViewInit(void);
53         void ClearAll(void);
54         UIToggleButton *GetHFP_ToggleButton(void);
55         UIToggleButton *GetA2DP_ToggleButton(void);
56         void show_connecting_view(bool data);
57         void Button_UPdata(void);
58         bool init_connect_timer(uint8_t type);
59         bool get_connectview_Visible(void);
60     public:
61         virtual void OnStart() override;
62         virtual void OnStop() override;
63
64     private:
65         bool SetUpBlueToothScrollView(void);
66         UILabelExt *SetBluetoothServiceOptionsViewLabel(LabelConfig &labelconfig);
67         bool SetUpBlueToothLabel(void);
68         bool SetUpBlueToothToggleButton(void);
69         bool SetUpBlueToothImageView(void);
70         UIScrollView *BlueToothScrollView = nullptr;
71         UILabelExt *Title = nullptr;
72         UILabelExt *HFP_Label{nullptr};
73         UILabelExt *A2DP_Label{nullptr};
74         UIImageView *HFP_Image{nullptr};
75         UIImageView *A2DP_Image{nullptr};
76         UIToggleButton *HFP_ToggleButton{nullptr};  // HFP
77         UIToggleButton *A2DP_ToggleButton{nullptr}; // A2DP
78         UIScrollView * connectingScrollView{nullptr};
79         AiVoiceConnectingView* p_AiVoiceConnectingView{nullptr};
80         
81         bool initViewStatus{false};
82     };
83 }
84 #endif