ChatPanelBar.h
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:3k
- #ifndef _CHATPANELBAR_H
- #define _CHATPANELBAR_H
- #include "udp.h"
- #include "chatPublic.h"
- #include "..publicsizecbar.h"
- #include "..publicInfoTopicBar.h"
- #include "..publicTaskbarNotifier.h"
- #include "ChatControls.h"
- class CChatPanelBar : public CSizingControlBar
- {
- public:
- CChatPanelBar();
- ~CChatPanelBar();
- //Attributes
- public:
- CInfoTopicBar m_wndTipInfo,
- m_wndRefUsrsBtn,
- m_wndBroadcastBtn,
- m_wndAddDelFriendBtn;
- CChatRichEditCtrl m_wndREChatOutput;
- CChatInputEdit m_wndEDChatInput;
- CChatGfxOutBarCtrl m_wndUsersBar;
- public:
- //logon chating room.
- BOOL LogonChatingRoom(void);
-
- //get chating logfile.
- BOOL GetChatingLogfile(CString &strLogfile);
- //user states refreshing thread routine.
- static DWORD WINAPI Routine_UserStateRef(LPVOID lpParameters);
- //broadcast working thread.
- static DWORD WINAPI Routine_BroadcastMsg(LPVOID lpParameters);
- public:
- // Overridables
- virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
- // Generated message map functions
- protected:
- //{{AFX_MSG(CChatPanelBar)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnDestroy();
- //}}AFX_MSG
-
- afx_msg void OnChatingMsg(WPARAM wparam, LPARAM lparam);
- afx_msg void OnChatStartLogon(WPARAM wparam, LPARAM lparam);
- afx_msg void OnStaticClickedMsg(WPARAM wparam, LPARAM lparam);
- afx_msg void OnInputChatMsgOver(WPARAM wparam, LPARAM lparam);
- afx_msg long OnChatUsersBarNotify(WPARAM wParam, LPARAM lParam);
- afx_msg LRESULT OnTaskbarNotifierClicked(WPARAM wParam,LPARAM lParam);
- DECLARE_MESSAGE_MAP()
- protected:
- int m_ncurmsgagent, //current agent that receiving message from ...
- m_nchatingAgent; //current session agent id.
-
- CFont m_guifont;
- CUDPClient m_udpclt;
- CTaskbarNotifier m_wndTaskbar;
- HANDLE m_hUserStateRefThread,
- m_hUserStateRefThreadKillEvent,
- m_hBroadcastWorkThread,
- m_hBroadcastEvent,
- m_hBroadcastWorkThreadKillEvent;
- private:
- void AdjustChildrenRegion(void);
-
- void ProcessClientLogon(LPCHATINGPACKAGE pcp);
- void ProcessClientLogoff(LPCHATINGPACKAGE pcp);
- void ProcessClientMsgtxt(LPCHATINGPACKAGE pcp);
- int GetUDPPort(void);
- int GetUserHeadportrait(void);
- void InitMyFriendsFolder(void);
- BOOL AddMyFriend(DWORD dwItemData);
- BOOL DeleteMyFriend(const int nAgentId);
- BOOL InFriendsGroup(const int nAgentId);
- void UpdateAddDelFriendBtnCaption(void);
- BOOL GetMyFriendsList(CArray<DWORD, DWORD> &arrMyfriends);
-
- BOOL AgentIsOnline(const int nAgentid);
- BOOL GetAgentFolderItemIndex(const int nAgentId, int &nFolderIndex, int &nItemIndex);
- BOOL GetAgentNameIpInfo(const int nAgentId, std::string &strName, std::string &strIp);
- };
- #endif //!_CHATPANELBAR_H