📄 im_user_struct.h
字号:
#ifndef _IM_USER_STRUCT_H
#define _IM_USER_STRUCT_H
#include "IM_def.h"
#include "XHC_struct.h"
typedef struct
{
S32 width, height;
S32 max_height;
U32 flags;
U32 ext_flags;
/* theme */
UI_filled_area *normal_filler;
UI_filled_area *selected_filler;
color normal_text_color;
color selected_text_color;
UI_font_type text_font;
/* parent menu */
fixed_list_menu *parent_list;
} im_common_menuitem_struct;
typedef struct
{
void (*item_display_function)(void *item, void *common_item_data, S32 x, S32 y);
void (*item_measure_function)(void *item, void *common_item_data, S32 *width, S32 *height);
void (*item_highlight_function)(void *item, void *common_item_data);
void (*item_remove_highlight_function)(void *item, void *common_item_data);
void (*item_selected_function)(void *item);
void (*item_left_softkey_function)(void *item);
void (*item_right_softkey_function)(void *item);
void (*item_center_softkey_function)(void *item);
U8 (*item_arrow_key_function)(void *item, U16 key);
U8 (*item_pen_function)(void *item, mmi_pen_point_struct point, mmi_pen_event_type_enum pen_event);
S32 (*free_function)(void **obj);
} im_common_obj_func_struct;
typedef struct
{
U8 object_type; //对象类型:IM_OBJECT_TYPE_XXX
U8 ui_flag; //UI操作标志
U8 cont_flag; //内容更新标志
S8* icon; //图标
UI_string_type name; //名称
void* parent; //上级结点
S16 x; //x
S16 y; //y
S16 width; //宽
S16 height; //高
im_common_obj_func_struct* obj_func; //显示此对象
} im_common_obj_struct;
#define IM_COMMON_OBJ_STRUCT \
U8 object_type; \
U8 ui_flag; \
U8 cont_flag;\
S8* icon;\
UI_string_type name; \
void* parent; \
S16 x; \
S16 y; \
S16 width; \
S16 height; \
im_common_obj_func_struct* obj_func;
typedef struct
{
im_user_common_state_enum state;
im_user_common_state_enum new_state;
U32 ticks_on_state;
MYTIME um_time;
MYTIME sleep_start_time;
S8 login_finish;
S8 read_local_success;
void* curr_system_status;
} im_user_common_process_struct;
#define IM_USER_COMMON_PROCESS_STRUCT \
im_user_common_state_enum state;\
im_user_common_state_enum new_state;\
U32 ticks_on_state;\
MYTIME um_time; \
MYTIME sleep_start_time; \
S8 login_finish;\
S8 read_local_success;\
void* curr_system_status;
typedef struct
{
U16 user_icon;
U8 is_open; //在界面中分组是否展开
U32 ticks_on_state;
U16 user_state_icon;
} im_user_common_ui_struct;
#define IM_USER_COMMON_UI_STRUCT \
U16 user_icon;\
U8 is_open;\
U32 ticks_on_state;\
U16 user_state_icon;
typedef struct
{
U8 is_only_show_online;
} im_user_common_option_struct;
#define IM_USER_COMMON_OPTION_STRUCT \
U8 is_only_show_online;
typedef struct
{
U32 ticks_on_state;
} im_user_common_net_struct;
#define IM_USER_COMMON_NET_STRUCT \
U32 ticks_on_state;
typedef struct
{
UI_string_type name;
UI_string_type nike_name;
UI_string_type pass_word;
U8 face;
} im_user_common_info_struct;
#define IM_USER_COMMON_INFO_STRUCT \
UI_string_type name;\
UI_string_type nike_name;\
UI_string_type pass_word;\
U8 face;
typedef struct
{
IM_COMMON_OBJ_STRUCT
UI_string_type nike_name; //昵称
UI_string_type info; //个性签名/个人消息/心情短语
S16 face; //头像
S16 state; //当前状态
void* chat_history; //消息历史
void* msg_node; //通知
S16 team_index; //所属分组索引
void* team; //所属分组
U8 is_online; //是否在线
XHC_CALLBACK_PTR create_chat_history; //获取聊天列表信息
void* curr_buddy_msg_status; //信息条文本索引
}im_user_common_friend_type_struct;
#define IM_USER_COMMON_FRIEND_TYPE_STRUCT \
IM_COMMON_OBJ_STRUCT\
UI_string_type nike_name; \
UI_string_type info; \
S16 face; \
S16 state; \
void* chat_history; \
void* msg_node; \
S16 team_index;\
void* team;\
U8 is_online; \
XHC_CALLBACK_PTR create_chat_history; \
void* curr_buddy_msg_status;
typedef struct
{
IM_COMMON_OBJ_STRUCT
S8* close_icon; //图标
S8* open_icon; //图标
S16 online_num; //在线好友数目
U8 is_open; //在界面中分组是否展开
U16 unread_msg; //未读消息数
xhc_array_struct friend_list; //好友列表数组(所有好友)
}im_user_common_team_type_struct;
#define IM_USER_COMMON_TEAM_TYPE_STRUCT \
IM_COMMON_OBJ_STRUCT\
S8* close_icon;\
S8* open_icon;\
S16 online_num; \
U8 is_open; \
U16 unread_msg; \
xhc_array_struct friend_list;
typedef struct
{
IM_COMMON_OBJ_STRUCT
UI_string_type msg; //消息
MYTIME time; //时间
U8 msg_from_friend; //消息来自于好友(非本人发送的消息)
}im_user_common_chat_msg_type_struct;
typedef struct
{
IM_COMMON_OBJ_STRUCT
xhc_array_struct chat_msg_history; //聊天历史记录
void* friend; //所属好友
U8 unread_msg; //未读消息数
S8 chat_history_file[128]; //聊天记录保存文件
XHC_CALLBACK_PTR send_msg_func; //发送消息
U8 is_new_msg_entry; //有新消息进来
U8 in_use; //正在使用
}im_user_common_chat_history_type_struct;
#define IM_USER_COMMON_CHAT_HISTORY_TYPE_STRUCT \
IM_COMMON_OBJ_STRUCT\
xhc_array_struct chat_msg_history; \
void* friend; \
U8 unread_msg; \
S8 chat_history_file[128];\
XHC_CALLBACK_PTR send_msg_func;\
U8 is_new_msg_entry; \
U8 in_use;
typedef struct
{
//好友列表
xhc_array_struct friend_list; //好友列表数组(所有好友)
//分组列表
xhc_array_struct system_team_list; //系统分组
xhc_array_struct custom_team_list; //用户自定义分组
xhc_array_struct chat_list; //聊天列表
S8 simple_path_name[96]; //好友本地信息保存文件(简单信息)
S8 complex_path_root[96]; //好友本地信息保存目录(复杂信息)
U8 is_friends_change;
} im_user_common_friends_struct;
#define IM_USER_COMMON_FRIENDS_STRUCT \
xhc_array_struct friend_list;\
xhc_array_struct system_team_list;\
xhc_array_struct custom_team_list;\
xhc_array_struct chat_list; \
S8 simple_path_name[96]; \
S8 complex_path_root[96]; \
U8 is_friends_change;\
typedef struct
{
UI_string_type name;
UI_string_type pass_word;
U8 def_login_state;
S8 path_root[64];
} im_user_common_data_struct;
#define IM_USER_COMMON_DATA_STRUCT \
UI_string_type name;\
UI_string_type pass_word;\
U8 def_login_state;\
S8 path_root[64];
typedef struct
{
im_common_obj_func_struct user_func;
im_common_obj_func_struct team_func;
im_common_obj_func_struct friend_func;
im_common_obj_func_struct chat_history_func;
im_common_obj_func_struct chat_msg_func;
im_common_obj_func_struct system_msg_func;
XHC_CALLBACK_PTR login_checkup_func;
XHC_CALLBACK_PTR create_user_func;
XHC_CALLBACK_PTR load_local_func;
XHC_CALLBACK_PTR free_local_friends;
XHC_CALLBACK_PTR free_local_all;
XHC_CALLBACK_PTR login_prepare_func;
XHC_CALLBACK_PTR start_login_func;
XHC_CALLBACK_PTR offline_func;
XHC_CALLBACK_PTR timer_tick_func;
// XHC_CALLBACK_PTR socket_notify_hdlr;
XHC_CALLBACK_PTR prompt_recv_msg_func;
XHC_CALLBACK_PTR prompt_online_func;
XHC_CALLBACK_PTR create_file_system;
UI_string_type str_login_user_menuitem;
FuncPtr login_user_menuitem_func;
U16 login_title_str;
U16 login_title_icon;
UI_string_type login_item_name_str;
U32 login_name_input_type;
U32 login_password_input_type;
UI_string_type def_login_state_str[IM_MAX_USER_STATE_NUM];
S8 def_login_state_num;
U8 login_is_enable_edit;
}im_user_type_struct;
typedef struct
{
IM_COMMON_OBJ_STRUCT
im_user_common_process_struct* process; //核心流程管理
im_user_common_ui_struct* ui; //界面流程管理
im_user_common_net_struct* net; //网络流程管理
im_user_common_info_struct* info; //个人信息管理
im_user_common_friends_struct* friends; //好友数据管理
im_user_common_option_struct* option; //选项数据管理
im_user_common_data_struct* data; //临时数据管理
im_user_type_struct* user_type; //用户类型
} im_user_common_struct;
#define IM_USER_COMMON_STRUCT \
IM_COMMON_OBJ_STRUCT\
im_user_common_process_struct* process;\
im_user_common_ui_struct* ui;\
im_user_common_net_struct* net;\
im_user_common_info_struct* info;\
im_user_common_friends_struct* friends;\
im_user_common_option_struct* option;\
im_user_common_data_struct* data;\
im_user_type_struct* user_type;
typedef struct
{
U8 user_index;
UI_string_type name;
UI_string_type pass_word;
S32 def_login_state;
void* app;
}im_user_login_data_struct;
#endif //_IM_USER_STRUCT_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -