-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathWindowManager.h
More file actions
66 lines (53 loc) · 1.67 KB
/
WindowManager.h
File metadata and controls
66 lines (53 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef UI_CORE_WINDOW_MANAGER_H_
#define UI_CORE_WINDOW_MANAGER_H_
#include "duilib/Core/UiTypes.h"
#include "duilib/Core/ControlPtrT.h"
namespace ui
{
class Window;
class WindowBase;
/** 用于管理所有窗口的生命周期
*/
class UILIB_API WindowManager
{
public:
WindowManager();
~WindowManager();
WindowManager(const WindowManager&) = delete;
WindowManager& operator = (const WindowManager&) = delete;
public:
/** 添加一个窗口接口(主要用于换肤、切换语言之后的重绘、资源同步等操作)
* @param [in] pWindow 窗口的接口
*/
void AddWindow(Window* pWindow);
/** 移除一个窗口
* @param [in] pWindow 窗口的接口
*/
void RemoveWindow(Window* pWindow);
/** 判断当前是否含有窗口
* @param [in] pWindow 窗口的接口
*/
bool HasWindow(Window* pWindow) const;
bool HasWindowBase(WindowBase* pWindowBase) const;
/** 获取所有窗口列表
*/
std::vector<WindowPtr> GetAllWindowList() const;
/** 获取指定窗口类下的所有窗口
* @param [in] windowClassName 创建窗口时传入的窗口类名
*/
std::vector<WindowPtr> GetAllWindowList(const DString& windowClassName) const;
/** 获取指定窗口ID对应的窗口
* @param [in] windowId 窗口ID, 理论上该Id是唯一的
* @return 返回该窗口ID对应的窗口,如果存在多个,则返回第一个匹配的窗口
*/
WindowPtr GetWindowById(const DString& windowId) const;
/** 清空
*/
void Clear();
private:
/** 窗口列表
*/
std::vector<WindowPtr> m_windowList;
};
} //namespace ui
#endif //UI_CORE_WINDOW_MANAGER_H_