139 lines
4.3 KiB
C++
139 lines
4.3 KiB
C++
#ifndef TJDUI_APP_SETTING_MODEL_H
|
|
#define TJDUI_APP_SETTING_MODEL_H
|
|
|
|
#include "list.h"
|
|
#include "sys_typedef.h"
|
|
#include <cstdint>
|
|
#include <list>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace TJD {
|
|
|
|
class TjdUiAppSettingModel
|
|
{
|
|
public:
|
|
struct MenuItemInfo
|
|
{
|
|
uint16_t itemName;
|
|
int enumValue;
|
|
int resId;
|
|
const char *path;
|
|
};
|
|
|
|
TjdUiAppSettingModel();
|
|
virtual ~TjdUiAppSettingModel(){};
|
|
static TjdUiAppSettingModel *GetInstance(void);
|
|
|
|
std::string GetConnectUrl();
|
|
|
|
/* 用户 */
|
|
bool IsOpenBle();
|
|
bool SetOpenBle(bool status);
|
|
bool IsConnectApp();
|
|
const std::string &GetUserName();
|
|
const std::string &GetBleName();
|
|
uint8_t GetUserHeight();
|
|
uint8_t GetUserWeight();
|
|
const std::string GetMacAddress();
|
|
const std::string GetVersion();
|
|
const std::string GetKernelVersion();
|
|
void SetNotification(bool notification);
|
|
bool GetNotification(void);
|
|
void SetScreenWakes(bool screenWakes);
|
|
bool GetScreenWakes(void);
|
|
void SetLanguage(language_enum language);
|
|
language_enum GetLanguage(void);
|
|
|
|
/* 勿扰模式 */
|
|
void SetDoNotDisturb(bool status);
|
|
bool GetDoNotDisturb(void);
|
|
void SetDoNotDisturbPeriodEnable(bool status);
|
|
bool GetDoNotDisturbPeriodEnable(void);
|
|
void SetDoNotDisturbPeriod(uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute);
|
|
void GetDoNotDisturbPeriod(uint8_t &startHour, uint8_t &startMinute, uint8_t &endHour, uint8_t &endMinute);
|
|
|
|
/* 显示与亮度 */
|
|
void SetScreenBrightnessLevel(uint8_t brightness, bool isSave);
|
|
uint8_t GetScreenBrightness();
|
|
void SetScreenAutoBrightness(bool autoBrightness);
|
|
bool GetScreenAutoBrightness();
|
|
void SetPowerSavingMode(bool status);
|
|
bool GetPowerSavingMode(void);
|
|
void SetShowOffScreenView(bool status);
|
|
bool GetShowOffScreenView(void);
|
|
void SetShowOffScreenViewType(uint8_t type);
|
|
uint8_t GetShowOffScreenViewType(void);
|
|
void SetBedsideClock(bool status);
|
|
bool GetBedsideClock(void);
|
|
void SetKeepScreenSec(uint16_t sec);
|
|
uint16_t GetKeepScreenTime(void);
|
|
|
|
/* 运动 */
|
|
void SetMotionEnable(bool status);
|
|
bool GetMotionEnable(void);
|
|
void SetMotionEndEnable(bool status);
|
|
bool GetMotionEndEnable(void);
|
|
void SetMotionOutTime(uint32_t time);
|
|
uint32_t GetMotionOutTime(void);
|
|
|
|
/* 密码 */
|
|
void SetPasswordEnable(bool status);
|
|
bool GetPasswordEnable(void);
|
|
void SetPassword(const char *password);
|
|
std::string &GetPassword(void);
|
|
|
|
/* GUI管理 */
|
|
void SetPinchToAnswer(bool status);
|
|
bool GetPinchToAnswer(void);
|
|
void SetCoverToTurnOffScreen(bool status);
|
|
bool GetCoverToTurnOffScreen(void);
|
|
void SetLeftKeySetting(uint32_t setting);
|
|
uint32_t GetLeftKeySetting(void);
|
|
void SetFloatingWindow(uint16_t *id);
|
|
const uint16_t *GetFloatingWindow();
|
|
void SetAnimation(uint8_t animation);
|
|
uint8_t GetAnimation(void);
|
|
E_MenuStyle GetWatchFaceMenuStyle(void);
|
|
bool GetSwitchBrightScreen();
|
|
void SetSwitchBrightScreen(bool status);
|
|
|
|
/* 声音与触摸 */
|
|
void SetVolume(uint8_t volume);
|
|
uint8_t GetVolume(void);
|
|
void SetVolumeMute(bool mute);
|
|
bool GetVolumeMute(void);
|
|
void SetTouchShake(bool shake);
|
|
bool GetTouchShake(void);
|
|
void SetTouchShakeLevel(uint8_t level);
|
|
uint8_t GetTouchShakeLevel(void);
|
|
|
|
uint8_t GetPower(void);
|
|
|
|
void SetStartIndex(uint16_t index) { startIndex = index; }
|
|
uint16_t GetStartIndex(void) { return startIndex; }
|
|
void SetHeadItemY(int index) { headItemY = index; }
|
|
int GetHeadItemY(void) { return headItemY; }
|
|
|
|
std::list<MenuItemInfo> &GetMotionImageInfoList() { return motionIconList_; }
|
|
std::list<MenuItemInfo> &GetMenuStyleImageInfoList() { return styleIconList_; }
|
|
|
|
void SetShowConnectQrCode(bool status) { isShowConnectQrCode_ = status; }
|
|
bool GetShowConnectQrCode() { return isShowConnectQrCode_; }
|
|
|
|
private:
|
|
std::string userName_ = "Lefun21357575";
|
|
std::string bleName_ = "";
|
|
std::string password_ = "";
|
|
uint16_t startIndex = 0;
|
|
int headItemY = 0;
|
|
|
|
std::list<MenuItemInfo> motionIconList_;
|
|
std::list<MenuItemInfo> styleIconList_;
|
|
|
|
bool isShowConnectQrCode_ = false;
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |