#ifndef MENU_MODEL_H
#define MENU_MODEL_H

#include "display.h"
#include "def.h"

#define MENU_MODEL_MAX_ITEM       300   /* 最大菜单项数 */
#define MENU_MODEL_MAX_LEVEL      4     /* 最大菜单层级 */

typedef struct menu_model_t menu_model_t;

struct menu_model_t
{
    uint16_t maxItem;
    tagMenuItem menuItems[MENU_MODEL_MAX_ITEM];
};



void MenuModel_Init(menu_model_t *model);



/* whitebox test hooks */
#ifdef UNIT_TEST
void MenuModel_IndexMenuItems(tagMenuItem *menuItems, uint32_t modelCount);
void MenuModel_PositionCal(tagPMenuItem ptMenuHead, uint16_t by0LevelNum);
uint8_t MenuModel_Utf8LenCal(uint8_t *str);
uint8_t MenuModel_GetMenuMaxDisplayLen(tagPMenuItem ptFirst);
uint16_t MenuModel_CountTopLevel(uint16_t maxItem);
void MenuModel_BuildTree(tagMenuItem *menuItems, const tagMenuModel *modelTab, uint32_t modelCount);
void MenuModel_DecorateDisplayNames(tagMenuItem *menuItems, uint32_t modelCount);
#endif


#endif
