ChatPanelBar.h
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:3k
源码类别:

网格计算

开发平台:

Visual C++

  1. #ifndef _CHATPANELBAR_H
  2. #define _CHATPANELBAR_H
  3. #include "udp.h"
  4. #include "chatPublic.h"
  5. #include "..publicsizecbar.h"
  6. #include "..publicInfoTopicBar.h"
  7. #include "..publicTaskbarNotifier.h"
  8. #include "ChatControls.h"
  9. class CChatPanelBar : public CSizingControlBar
  10. {
  11. public:
  12. CChatPanelBar();
  13. ~CChatPanelBar();
  14. //Attributes
  15. public:
  16. CInfoTopicBar m_wndTipInfo,
  17. m_wndRefUsrsBtn,
  18. m_wndBroadcastBtn,
  19. m_wndAddDelFriendBtn;
  20. CChatRichEditCtrl m_wndREChatOutput;
  21. CChatInputEdit m_wndEDChatInput;
  22. CChatGfxOutBarCtrl m_wndUsersBar;
  23. public:
  24. //logon chating room.
  25. BOOL LogonChatingRoom(void);
  26. //get chating logfile.
  27. BOOL GetChatingLogfile(CString &strLogfile);
  28. //user states refreshing thread routine.
  29. static DWORD WINAPI Routine_UserStateRef(LPVOID lpParameters);
  30. //broadcast working thread.
  31. static DWORD WINAPI Routine_BroadcastMsg(LPVOID lpParameters);
  32. public:
  33. // Overridables
  34.     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  35.     // Generated message map functions
  36. protected:
  37.     //{{AFX_MSG(CChatPanelBar)
  38.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  39.     afx_msg void OnSize(UINT nType, int cx, int cy);
  40. afx_msg void OnDestroy();
  41. //}}AFX_MSG
  42. afx_msg void OnChatingMsg(WPARAM wparam, LPARAM lparam);
  43. afx_msg void OnChatStartLogon(WPARAM wparam, LPARAM lparam);
  44. afx_msg void OnStaticClickedMsg(WPARAM wparam, LPARAM lparam);
  45. afx_msg void OnInputChatMsgOver(WPARAM wparam, LPARAM lparam);
  46. afx_msg long OnChatUsersBarNotify(WPARAM wParam, LPARAM lParam);
  47. afx_msg LRESULT OnTaskbarNotifierClicked(WPARAM wParam,LPARAM lParam);
  48.     DECLARE_MESSAGE_MAP()
  49. protected:
  50. int  m_ncurmsgagent, //current agent that receiving message from ...
  51.  m_nchatingAgent; //current session agent id.
  52. CFont  m_guifont;
  53. CUDPClient  m_udpclt;
  54. CTaskbarNotifier m_wndTaskbar;
  55. HANDLE  m_hUserStateRefThread,
  56.  m_hUserStateRefThreadKillEvent,
  57.  m_hBroadcastWorkThread,
  58.  m_hBroadcastEvent,
  59.  m_hBroadcastWorkThreadKillEvent;
  60. private:
  61. void AdjustChildrenRegion(void);
  62. void ProcessClientLogon(LPCHATINGPACKAGE pcp);
  63. void ProcessClientLogoff(LPCHATINGPACKAGE pcp);
  64. void ProcessClientMsgtxt(LPCHATINGPACKAGE pcp);
  65. int GetUDPPort(void);
  66. int GetUserHeadportrait(void);
  67. void InitMyFriendsFolder(void);
  68. BOOL AddMyFriend(DWORD dwItemData);
  69. BOOL DeleteMyFriend(const int nAgentId);
  70. BOOL InFriendsGroup(const int nAgentId);
  71. void UpdateAddDelFriendBtnCaption(void);
  72. BOOL GetMyFriendsList(CArray<DWORD, DWORD> &arrMyfriends);
  73. BOOL AgentIsOnline(const int nAgentid);
  74. BOOL GetAgentFolderItemIndex(const int nAgentId, int &nFolderIndex, int &nItemIndex);
  75. BOOL GetAgentNameIpInfo(const int nAgentId, std::string &strName, std::string &strIp);
  76. };
  77. #endif //!_CHATPANELBAR_H