75 lines
1.6 KiB
C++
75 lines
1.6 KiB
C++
/*----------------------------------------------------------------------------
|
|
* Copyright (c) TJD Technologies Co., Ltd. 2025. All rights reserved.
|
|
*
|
|
* Description: TjdUiAppMainModel.h
|
|
*
|
|
* Author: luziquan@ss-tjd.com
|
|
*
|
|
* Create: 2025-03-13
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#ifndef TJD_UI_APP_MAIN_MODEL_H
|
|
#define TJD_UI_APP_MAIN_MODEL_H
|
|
|
|
#include <list>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace TJD {
|
|
|
|
typedef enum
|
|
{
|
|
TJD_CARD_FAVORITE,
|
|
TJD_CARD_WATCH_FACE,
|
|
TJD_CARD_HEALTH,
|
|
TJD_CARD_TOOL,
|
|
TJD_CARD_WEATHER,
|
|
TJD_CARD_MUSIC,
|
|
TJD_CARD_MAKE_FRIEND,
|
|
TJD_CARD_MAP,
|
|
TJD_CARD_FOUR_LEAF_CLOVER,
|
|
TJD_CARD_MAX_CARD,
|
|
} TjdCardId;
|
|
|
|
typedef enum
|
|
{
|
|
TJD_VER_CARD_SHORTCUT,
|
|
TJD_VER_CARD_WATCH_FACE,
|
|
TJD_VER_CARD_MESSAGE,
|
|
} TjdVerCardId;
|
|
|
|
struct CardInfo
|
|
{
|
|
TjdCardId id;
|
|
std::string name;
|
|
int resId;
|
|
};
|
|
|
|
class TjdUiAppMainModel
|
|
{
|
|
public:
|
|
TjdUiAppMainModel();
|
|
virtual ~TjdUiAppMainModel();
|
|
static TjdUiAppMainModel &GetInstance(void);
|
|
void Init();
|
|
void DeleteCardSetting(uint8_t index);
|
|
void AddCardSetting(uint8_t index);
|
|
const std::vector<TjdCardId> &GetCardSettings(void);
|
|
const CardInfo *GetCardInfo(TjdCardId id);
|
|
|
|
bool IsFromComponentsView(void) const;
|
|
void SetFromComponentsView(bool isFrom);
|
|
void SetFromCardId(uint8_t cardId);
|
|
uint8_t GetFromComponentsCardId(void);
|
|
void InitCardSettings();
|
|
|
|
private:
|
|
std::vector<TjdCardId> cardSettings;
|
|
std::vector<CardInfo> cardInfos;
|
|
bool isFromComponentsView{false};
|
|
uint8_t fromCardId{TjdCardId::TJD_CARD_MAX_CARD};
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |