-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathCursorManager.h
More file actions
57 lines (43 loc) · 1.17 KB
/
Copy pathCursorManager.h
File metadata and controls
57 lines (43 loc) · 1.17 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
#ifndef UI_CORE_CURSOR_MANAGER_H_
#define UI_CORE_CURSOR_MANAGER_H_
#include "duilib/duilib_defs.h"
#include "duilib/Utils/FilePath.h"
namespace ui {
/** 光标的ID(有效值是非零值)
*/
typedef std::size_t CursorID;
class Window;
/** 设置光标
*/
class DUILIB_API CursorManager
{
public:
CursorManager();
~CursorManager();
/** 设置光标
* @param [in] cursorType 光标类型
*/
bool SetCursor(CursorType cursorType);
/** 设置图片为光标
* @param [in] pWindow 关联的窗口
* @param [in] imagePath 光标图片的路径(后缀名为.cur)
*/
bool SetImageCursor(const Window* pWindow, const FilePath& curImagePath);
/** 显示或者光标光标
* @param [in] bShow true表示显示光标,false表示隐藏光标
*/
bool ShowCursor(bool bShow);
/** 获取当前光标的光标ID
*/
CursorID GetCursorID() const;
/** 根据ID设置光标
* @param [in] cursorId 光标的ID,该值由GetCursorID()返回
*/
bool SetCursorByID(CursorID cursorId);
private:
//内部实现
class TImpl;
TImpl* m_impl;
};
} // namespace ui
#endif // UI_CORE_CURSOR_MANAGER_H_