62 lines
1.5 KiB
C++
62 lines
1.5 KiB
C++
/*----------------------------------------------------------------------------
|
|
* Copyright (c) TJD Technologies Co., Ltd. 2025. All rights reserved.
|
|
*
|
|
* Description: TjdUiAppListModel.h
|
|
*
|
|
* Author: luziquan@ss-tjd.com
|
|
*
|
|
* Create: 2025-02-11
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#ifndef TJD_UI_APP_LIST_MODEL_H
|
|
#define TJD_UI_APP_LIST_MODEL_H
|
|
|
|
#include "ApplistModel.h"
|
|
#include "bundle_info.h"
|
|
#include "sys_typedef.h"
|
|
#include <cstdint>
|
|
|
|
namespace TJD {
|
|
|
|
typedef struct
|
|
{
|
|
int32_t resId;
|
|
int32_t txtId;
|
|
const char *version;
|
|
OHOS::AppItem appItem;
|
|
} TjdAppItem;
|
|
|
|
class TjdUiAppListModel
|
|
{
|
|
public:
|
|
static TjdUiAppListModel &GetInstance();
|
|
void Init();
|
|
const TjdAppItem *GetApplistItems() const;
|
|
uint8_t GetAppListNum() const;
|
|
void ResolvingJSAppItems(void);
|
|
void SetStartIndex(uint16_t index);
|
|
uint16_t GetStartIndex(void);
|
|
void SetHeadItemY(int index);
|
|
int GetHeadItemY(void);
|
|
void ApplistUpdate(void);
|
|
void SetCurrentStyle(E_MenuStyle style);
|
|
E_MenuStyle GetCurrentStyle(void);
|
|
void SetInitFlag(bool flag);
|
|
|
|
private:
|
|
TjdUiAppListModel() {}
|
|
virtual ~TjdUiAppListModel() {}
|
|
TjdUiAppListModel(const TjdUiAppListModel &) = delete;
|
|
TjdAppItem applist[APP_MAX_NUM] = {};
|
|
BundleInfo *bundleInfos = nullptr;
|
|
int32_t bundleLen = 0;
|
|
int32_t appLen = 0;
|
|
|
|
uint16_t startIndex = 0;
|
|
int headItemY = 0;
|
|
bool initFlag{false};
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |