// MsgMap.h: interface for the CMsgMap class.
|
//
|
//////////////////////////////////////////////////////////////////////
|
|
#if _MSC_VER > 1000
|
#pragma once
|
#endif // _MSC_VER > 1000
|
|
class CQLSession;
|
|
// AddIn_Flag
|
#define ADDIN_FLAG_ONSTART_PIPE ( 1 ) // ÔÚ AM Pipe Æô¶¯Ê±ºòµÄ×Ô¶¯Æô¶¯
|
#define ADDIN_FLAG_ONSTART_CONECT ( 2 ) // ÔÚ AM Pipe Æô¶¯Connect µÄʱ¼ä×Ô¶¯Æô¶¯
|
#define ADDIN_FLAG_MSGER_CMD ( 4 ) // ˵Ã÷ΪÃüÁî¶ÔÏó,½«ÔÚAmsger ÖеÄÀ©Õ¹ÃüÁî²Ëµ¥ÖÐÁгö
|
#define ADDIN_FLAG_MSGER_SETTING ( 8 ) // ÔÊÐíÔÚ AMsger ÖнøÐÐ Option ÉèÖÃ
|
#define ADDIN_FLAG_ONSTART_MSGER ( 16 ) // ÔÚ AMsger Æô¶¯Ê±ºòµÄ×Ô¶¯Æô¶¯
|
|
// AddIn Target Type
|
#define ADDIN_TARGETTYPE_GUID ( 0 ) // Target ÖÐΪ CLSID
|
#define ADDIN_TARGETTYPE_PROID ( 1 ) // Target ÖÐΪ ProID
|
#define ADDIN_TARGETTYPE_VBSCRIPT ( 2 ) // Target ÖÐΪ VBS FileName
|
|
#define MSGMAP_FLAG_ENGROSS ( 1 ) // ¶ÀÕ¼
|
#define MSGMAP_FLAG_CONCEDE ( 2 ) // Èò½
|
#define MSGMAP_FLAG_CLOSEADDIN ( 4 ) // ÔÚµ÷ÓúÃÖ®ºóÒªCloseAddIn
|
|
// Msg Categroy
|
#define MSGCATEGORY_SYSMSG _T( "SYSMSG" ) // ϵͳʼþÏûÏ¢
|
#define MSGCATEGORY_MSG _T( "MSG" ) // ÐÂÏûÏ¢µ½´ï
|
|
// Msg Type of SYSMSG
|
#define MSGTYPE_SYS_NLN _T( "NLN" ) // ֪ͨÓû§×´Ì¬¸Ä±ä
|
#define MSGTYPE_SYS_FLN _T( "FLN" ) // ֪ͨÓû§ÀëÏß
|
#define MSGTYPE_SYS_NTY _T( "NTY" ) // ϵͳ֪ͨ
|
|
// Msg Type of MSG
|
#define MSGTYPE_GEN _T( "GEN" ) // ³£¹æÏûÏ¢
|
|
|
class AFX_EXT_CLASS CMsgTag : public CObject
|
{
|
public:
|
CMsgTag();
|
virtual ~CMsgTag();
|
void operator = ( const CMsgTag &Item );
|
|
// Attributers
|
public:
|
CString m_strMapStr;
|
|
CString m_strName;
|
CStringArray m_asParamName;
|
CStringArray m_asParamValue;
|
|
protected:
|
|
// Operations
|
public:
|
BOOL SetData( CString strTag );
|
BOOL ParseData( CString strTag, CString &strName, CStringArray &asParamName, CStringArray &asParamValue );
|
|
void AddParam( CString strName, CString strValue );
|
BOOL RemoveParam( CString strName, CString strValue = _T( "" ) );
|
int FindParam( CStringArray &asParamName, CStringArray &asParamValue, CString strName, CString strValue );
|
|
BOOL IsSubscibe( CString strTag );
|
BOOL IsSame( CString strTag );
|
|
protected:
|
BOOL GetStrItem( CString &strBuff, CString &strItem, char chApart );
|
|
};
|
|
class AFX_EXT_CLASS CMsgMap : public CObject
|
{
|
public:
|
CMsgMap();
|
virtual ~CMsgMap();
|
|
// Attributers
|
public:
|
CString m_strMsgCategory;
|
CMsgTag m_MsgTag; // ÏûÏ¢ÀàÐÍ£¬±êʶ×Ö´®
|
|
// Online Msg Map
|
CQLSession *m_pSession;
|
|
// Offline Msg Map
|
CString m_strAddInName; // AddIn Name
|
UINT m_nTargetType; // Target Type
|
CString m_strTarget; // ¸ù¾Ý TargetType µÄ²»Í¬£¬Æä´ú±íµÄÒâÒåÒ²¾Í²»Í¬
|
UINT m_nOwnerSessionID; // Owner's Session ID
|
|
DWORD m_dwFlag; //
|
CString m_strParam; //
|
|
// Operations
|
public:
|
BOOL IsSubscibe( CString strMsgCategory, CString strMapStr );
|
BOOL IsSame( CString strMsgCategory, CString strMapStr );
|
|
};
|
|
///////////////////////////////////
|
// ÏûÏ¢¶¨ÔĹÜÀí
|
///////////////////////////////////
|
class AFX_EXT_CLASS CMsgMapMgr
|
{
|
public:
|
CMsgMapMgr();
|
virtual ~CMsgMapMgr();
|
|
// Attributers
|
public:
|
CList<CMsgMap*, CMsgMap*> m_listMsgMap;
|
|
// Operations
|
public:
|
// Session
|
BOOL AddMsgMap( CString strMsgCategory, CString strMapStr, CQLSession *pSession, DWORD dwFlag, CString strParam, int nLevel = 0 );
|
BOOL RemoveMsgMap( CString strMsgCategory, CString strMapStr, CQLSession *pSession );
|
BOOL RemoveMsgMap( CQLSession *pSession );
|
POSITION FindMsgMap( CString strMsgCategory, CString strMapStr, CQLSession *pSession = NULL );
|
|
// AddIn
|
BOOL AddMsgMap( CString strMsgCategory, CString strMapStr, CString strAddInName, UINT nTargetType, CString strTarget, DWORD dwFlag, CString strParam = _T( "" ), UINT nOwnerSessionID = 0, int nLevel = 0 );
|
BOOL RemoveMsgMap( CString strMsgCategory, CString strMapStr, CString strAddInName );
|
BOOL RemoveMsgMap( CString strAddInName );
|
POSITION FindMsgMap( CString strMsgCategory, CString strMapStr, CString strAddInName );
|
|
// Common
|
void RemoveAllMsgMap();
|
POSITION FindSubscibe( CString strMsgCategory, CString strMapStr,
|
POSITION posStart = NULL , UINT nOwnerSessionID = 0 );
|
BOOL LoadAddInMap( CString strKeyParent, CString strSubKey, UINT nOwnerSessionID = 0 );
|
|
protected:
|
|
};
|