soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SEventSet Class Reference

表示一组事件对象 More...

#include <SEventSet.h>

Inheritance diagram for SEventSet:
SNotifyCenter

Public Member Functions

 SEventSet (void)
 构造函数
 
virtual ~SEventSet (void)
 析构函数
 
BOOL addEvent (DWORD dwEventID, LPCWSTR pszEventHandlerName)
 添加一个新事件到事件集
 
BOOL removeEvent (DWORD dwEventID)
 移除指定ID的事件
 
void removeAllEvents (void)
 移除所有事件对象
 
BOOL isEventPresent (DWORD dwEventID)
 检查事件集是否包含指定ID的事件
 
BOOL setEventScriptHandler (const SStringW &strEventName, const SStringA strScriptHandler)
 设置事件的脚本处理程序
 
SStringA getEventScriptHandler (const SStringW &strEventName) const
 获取事件的脚本处理程序
 
BOOL subscribeEvent (DWORD dwEventID, const IEvtSlot &subscriber)
 订阅事件
 
BOOL subscribeEvent (DWORD dwEventID, const IEvtSlot *subscriber)
 订阅事件
 
template<typename T, typename A>
BOOL subscribeEvent (BOOL(T::*pFn)(A *), T *pObject)
 订阅事件(模板函数)
 
template<typename A>
BOOL subscribeEvent (BOOL(*pFn)(A *))
 订阅事件(模板函数)
 
template<typename T>
BOOL subscribeEvent (DWORD dwEventID, BOOL(T::*pFn)(IEvtArgs *), T *pObject)
 订阅事件(模板函数)
 
BOOL unsubscribeEvent (DWORD dwEventID, const IEvtSlot *subscriber)
 取消订阅事件
 
BOOL unsubscribeEvent (DWORD dwEventID, const IEvtSlot &subscriber)
 取消订阅事件
 
template<typename T, typename A>
BOOL unsubscribeEvent (BOOL(T::*pFn)(A *), T *pObject)
 取消订阅事件(模板函数)
 
template<typename A>
BOOL unsubscribeEvent (BOOL(*pFn)(A *))
 取消订阅事件(模板函数)
 
template<typename T>
BOOL unsubscribeEvent (DWORD dwEventID, BOOL(T::*pFn)(IEvtArgs *), T *pObject)
 取消订阅事件(模板函数)
 
void FireEvent (IEvtArgs *args)
 触发事件
 
BOOL isMuted (void) const
 检查事件集是否被静音
 
void setMutedState (BOOL setting)
 设置事件集的静音状态
 

Protected Member Functions

SEventGetEventObject (const DWORD dwEventID)
 获取事件对象
 

Protected Attributes

SArray< SEvent * > m_evtArr
 事件数组
 
int m_nMuted
 静音状态计数
 

Friends

class SWindow
 

Detailed Description

表示一组事件对象

Definition at line 89 of file SEventSet.h.

Constructor & Destructor Documentation

◆ SEventSet()

SEventSet::SEventSet ( void )

构造函数

Definition at line 100 of file SEventSet.cpp.

◆ ~SEventSet()

SEventSet::~SEventSet ( void )
virtual

析构函数

Definition at line 105 of file SEventSet.cpp.

Member Function Documentation

◆ addEvent()

BOOL SEventSet::addEvent ( DWORD dwEventID,
LPCWSTR pszEventHandlerName )

添加一个新事件到事件集

Parameters
dwEventID事件ID
pszEventHandlerName事件处理程序名称
Returns
成功返回TRUE,失败返回FALSE

Definition at line 141 of file SEventSet.cpp.

◆ FireEvent()

void SEventSet::FireEvent ( IEvtArgs * args)

触发事件

Parameters
args事件参数对象

Definition at line 129 of file SEventSet.cpp.

◆ GetEventObject()

SEvent * SEventSet::GetEventObject ( const DWORD dwEventID)
protected

获取事件对象

Parameters
dwEventID事件ID
Returns
事件对象指针,未找到返回NULL

Definition at line 119 of file SEventSet.cpp.

◆ getEventScriptHandler()

SStringA SEventSet::getEventScriptHandler ( const SStringW & strEventName) const

获取事件的脚本处理程序

Parameters
strEventName事件名称
Returns
脚本处理程序字符串

Definition at line 214 of file SEventSet.cpp.

◆ isEventPresent()

BOOL SEventSet::isEventPresent ( DWORD dwEventID)

检查事件集是否包含指定ID的事件

Parameters
dwEventID事件ID
Returns
存在返回TRUE,不存在返回FALSE

Definition at line 163 of file SEventSet.cpp.

◆ isMuted()

BOOL SEventSet::isMuted ( void ) const
inline

检查事件集是否被静音

Returns
被静音返回TRUE,否则返回FALSE

Definition at line 281 of file SEventSet.h.

◆ removeAllEvents()

void SEventSet::removeAllEvents ( void )

移除所有事件对象

Definition at line 168 of file SEventSet.cpp.

◆ removeEvent()

BOOL SEventSet::removeEvent ( DWORD dwEventID)

移除指定ID的事件

Parameters
dwEventID事件ID
Returns
成功返回TRUE,失败返回FALSE

Definition at line 149 of file SEventSet.cpp.

◆ setEventScriptHandler()

BOOL SEventSet::setEventScriptHandler ( const SStringW & strEventName,
const SStringA strScriptHandler )

设置事件的脚本处理程序

Parameters
strEventName事件名称
strScriptHandler脚本处理程序字符串
Returns
成功返回TRUE,失败返回FALSE

Definition at line 201 of file SEventSet.cpp.

◆ setMutedState()

void SEventSet::setMutedState ( BOOL setting)

设置事件集的静音状态

Parameters
settingTRUE表示静音,FALSE表示取消静音

Definition at line 110 of file SEventSet.cpp.

◆ subscribeEvent() [1/5]

template<typename A>
BOOL SEventSet::subscribeEvent ( BOOL(* pFn )(A *))
inline

订阅事件(模板函数)

Template Parameters
A事件参数类型
Parameters
pFn函数指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 195 of file SEventSet.h.

◆ subscribeEvent() [2/5]

template<typename T, typename A>
BOOL SEventSet::subscribeEvent ( BOOL(T::* pFn )(A *),
T * pObject )
inline

订阅事件(模板函数)

Template Parameters
T对象类型
A事件参数类型
Parameters
pFn成员函数指针
pObject对象指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 183 of file SEventSet.h.

◆ subscribeEvent() [3/5]

template<typename T>
BOOL SEventSet::subscribeEvent ( DWORD dwEventID,
BOOL(T::* pFn )(IEvtArgs *),
T * pObject )
inline

订阅事件(模板函数)

Template Parameters
T对象类型
Parameters
pFn成员函数指针
pObject对象指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 208 of file SEventSet.h.

◆ subscribeEvent() [4/5]

BOOL SEventSet::subscribeEvent ( DWORD dwEventID,
const IEvtSlot & subscriber )
inline

订阅事件

Parameters
dwEventID事件ID
subscriber事件槽对象
Returns
成功返回TRUE,失败返回FALSE

Definition at line 151 of file SEventSet.h.

◆ subscribeEvent() [5/5]

BOOL SEventSet::subscribeEvent ( DWORD dwEventID,
const IEvtSlot * subscriber )

订阅事件

Parameters
dwEventID事件ID
subscriber事件槽对象指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 177 of file SEventSet.cpp.

◆ unsubscribeEvent() [1/5]

template<typename A>
BOOL SEventSet::unsubscribeEvent ( BOOL(* pFn )(A *))
inline

取消订阅事件(模板函数)

Template Parameters
A事件参数类型
Parameters
pFn函数指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 253 of file SEventSet.h.

◆ unsubscribeEvent() [2/5]

template<typename T, typename A>
BOOL SEventSet::unsubscribeEvent ( BOOL(T::* pFn )(A *),
T * pObject )
inline

取消订阅事件(模板函数)

Template Parameters
T对象类型
A事件参数类型
Parameters
pFn成员函数指针
pObject对象指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 241 of file SEventSet.h.

◆ unsubscribeEvent() [3/5]

template<typename T>
BOOL SEventSet::unsubscribeEvent ( DWORD dwEventID,
BOOL(T::* pFn )(IEvtArgs *),
T * pObject )
inline

取消订阅事件(模板函数)

Template Parameters
T对象类型
Parameters
pFn成员函数指针
pObject对象指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 266 of file SEventSet.h.

◆ unsubscribeEvent() [4/5]

BOOL SEventSet::unsubscribeEvent ( DWORD dwEventID,
const IEvtSlot & subscriber )
inline

取消订阅事件

Parameters
dwEventID事件ID
subscriber事件槽对象
Returns
成功返回TRUE,失败返回FALSE

Definition at line 227 of file SEventSet.h.

◆ unsubscribeEvent() [5/5]

BOOL SEventSet::unsubscribeEvent ( DWORD dwEventID,
const IEvtSlot * subscriber )

取消订阅事件

Parameters
dwEventID事件ID
subscriber事件槽对象指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 184 of file SEventSet.cpp.

Friends And Related Symbol Documentation

◆ SWindow

friend class SWindow
friend

Definition at line 90 of file SEventSet.h.

Member Data Documentation

◆ m_evtArr

SArray<SEvent *> SEventSet::m_evtArr
protected

事件数组

Definition at line 300 of file SEventSet.h.

◆ m_nMuted

int SEventSet::m_nMuted
protected

静音状态计数

Definition at line 301 of file SEventSet.h.


The documentation for this class was generated from the following files: