nim_duilib/examples/multi_browser/control/browser_tab_item.h
jiajia_deng 4933d1f2bc Remove dependency on shared
Signed-off-by: jiajia_deng <2894220@gmail.com>
2019-09-20 16:27:58 +08:00

78 lines
1.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
/** @class BrowserTabItem
* @brief 多标签浏览器窗口顶部标签控件
* @copyright (c) 2016, NetEase Inc. All rights reserved
* @author Redrain
* @date 2019/3/20
*/
class BrowserTabItem : public ui::ListContainerElement
{
public:
BrowserTabItem();
/**
* 初始化控件内部指针
* @param[in] browser_id 浏览器id
* @return void 无返回值
*/
void InitControl(std::string browser_id);
/**
* 设置显示的浏览器标题
* @param[in] name 标题
* @return void 无返回值
*/
void SetTitle(std::wstring name);
/**
* 设置显示的浏览器头像
* @param[in] icon 头像路径
* @return void 无返回值
*/
void SetIcon(std::wstring icon);
private:
/**
* 处理鼠标移入消息
* @param[in] msg 消息的相关信息
* @return bool true 继续传递控件消息false 停止传递控件消息
*/
bool OnMouseEnter(ui::EventArgs* msg);
/**
* 处理鼠标移出消息
* @param[in] msg 消息的相关信息
* @return bool true 继续传递控件消息false 停止传递控件消息
*/
bool OnMouseLeave(ui::EventArgs* msg);
/**
* 处理控件的菜单消息
* @param[in] msg 消息的相关信息
* @return bool true 继续传递控件消息false 停止传递控件消息
*/
bool OnItemMenu(ui::EventArgs* msg);
/**
* 弹出菜单
* @param[in] point 弹出坐标
* @return void 无返回值
*/
void PopupItemMenu(POINT point);
/**
* 处理菜单项被单击的消息
* @param[in] msg 消息的相关信息
* @return bool true 继续传递控件消息false 停止传递控件消息
*/
bool MergeItemMenuItemClick(ui::EventArgs* msg);
private:
ui::Control *icon_;
ui::Label *name_;
ui::Button *button_close_;
std::wstring session_id_;
};