soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
STimer.h
1#ifndef __STIMER__H__
2#define __STIMER__H__
3
4#include <interface/STimer-i.h>
5#include <helper/obj-ref-impl.hpp>
6
7SNSBEGIN
8
9/**
10 * @class STimer
11 * @brief 定时器类
12 */
13class SOUI_EXP STimer : public TObjRefImpl<ITimer> {
14 public:
15 /**
16 * @brief 构造函数
17 * @param pSlot 事件槽对象指针
18 */
19 STimer(IEvtSlot *pSlot);
20
21 /**
22 * @brief 析构函数
23 */
24 ~STimer(void);
25
26 public:
27 /**
28 * @brief 启动定时器
29 * @param nElapse 定时器间隔时间(毫秒)
30 * @param bRepeat 是否重复定时器
31 * @param uData 用户数据(默认为0)
32 * @return 如果成功启动定时器返回TRUE,否则返回FALSE
33 */
34 STDMETHOD_(BOOL, StartTimer)(THIS_ int nElapse, BOOL bRepeat, LPARAM uData DEF_VAL(0)) OVERRIDE;
35
36 /**
37 * @brief 停止定时器
38 */
39 STDMETHOD_(void, KillTimer)(THIS) OVERRIDE;
40
41 private:
42 UINT m_uTimerId; // 定时器ID
43 SAutoRefPtr<IEvtSlot> m_evtSlot; // 事件槽对象指针
44};
45
46SNSEND
47
48#endif // __STIMER__H__
Smart pointer class for managing COM-style reference-counted objects.
STimer(IEvtSlot *pSlot)
构造函数
Definition STimer.cpp:6
BOOL StartTimer(int nElapse, BOOL bRepeat, LPARAM uData=0) OVERRIDE
启动定时器
Definition STimer.cpp:17
void KillTimer() OVERRIDE
停止定时器
Definition STimer.cpp:24