myicqDlg.h
上传用户:zslianheng
上传日期:2013-04-03
资源大小:946k
文件大小:7k
源码类别:

Linux/Unix编程

开发平台:

Visual C++

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *   This program is free software; you can redistribute it and/or modify  *
  4.  *   it under the terms of the GNU General Public License as published by  *
  5.  *   the Free Software Foundation; either version 2 of the License, or     *
  6.  *   (at your option) any later version.                                   *
  7.  *                                                                         *
  8.  *   copyright            : (C) 2002 by Zhang Yong                         *
  9.  *   email                : z-yong163@163.com                              *
  10.  ***************************************************************************/
  11. // myicqDlg.h : header file
  12. //
  13. #if !defined(AFX_MYICQDLG_H__A1176E03_E6E7_4E6C_93BB_503F26D81C97__INCLUDED_)
  14. #define AFX_MYICQDLG_H__A1176E03_E6E7_4E6C_93BB_503F26D81C97__INCLUDED_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif // _MSC_VER > 1000
  18. #include "icqlink.h"
  19. #include "CaptionBtnDlg.h"
  20. #include "MyICQCtrl.h"
  21. #include "BtnST.h"
  22. #include "icqskin.h"
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CIcqDlg dialog
  25. class CIcqDlg : public CCaptionBtnDlg, public IcqLink, public OutBarListener
  26. {
  27. // Construction
  28. public:
  29. CIcqDlg(CWnd* pParent = NULL); // standard constructor
  30. ~CIcqDlg();
  31. void onSendError(uint32 seq);
  32. void onConnect(bool success);
  33. void onNewUINReply(uint32 uin);
  34. void onContactListReply(UinList &l);
  35. void onLoginReply(uint16 error);
  36. void onUserOnline(uint32 uin, uint32 status, uint32 ip, uint16 port, uint32 realIP, bool multi);
  37. void onUserOffline(uint32 uin);
  38. void onStatusChanged(uint32 uin, uint32 status);
  39. void onUpdateContactReply(IcqContact *info);
  40. void onUpdateUserReply();
  41. void onRecvMessage(IcqMsg *msg);
  42. void onUserFound(PtrList *l);
  43. void onAddFriendReply(uint32 uin, uint8 result);
  44. virtual void *getFaceIcon(int face, int status);
  45. virtual void popupMsg(void *icon, const char *text, uint32 t);
  46. virtual void renamed(int obj, int index, const char *text);
  47. virtual void itemDragged(int item, int toFolder);
  48. virtual void selFolderChanged(int folder);
  49. virtual void itemClicked(int item);
  50. virtual void itemDoubleClicked(int item);
  51. virtual void rightButtonDown(int obj, int index);
  52. HANDLE getHostByName(const char *name);
  53. IcqMsg *fetchMsg(uint32 uin);
  54. void showOptions(UINT iSelectPage = 0);
  55. MyICQCtrl outbarCtrl;
  56. private:
  57. virtual void drawCaptionBtn(CDC *pDC, CRect &rc, int button, BOOL pressed);
  58. virtual void onCaptionBtnClicked(int button);
  59. void onError();
  60. void onStatusAway();
  61. void onNotifyDblClk();
  62. void onItemDoubleClicked(IcqContact *c);
  63. void destroyUser();
  64. void resolveHost();
  65. void onHostFound(in_addr &addr);
  66. void onlineNotify(IcqContact *c);
  67. void addNotifyIcon();
  68. void removeNotifyIcon();
  69. void modifyNotifyIcon(HICON hIcon);
  70. void popupMainMenu(UINT nFlags, CPoint &pt);
  71. void popupStatusMenu(UINT nFlags, CPoint &pt);
  72. void updateStatusIcon();
  73. void animateStatus();
  74. void hideWindow(BOOL hide = TRUE);
  75. void addPendingMsg(IcqMsg *msg);
  76. void login(uint32 status = 0);
  77. void logout();
  78. void addContact(IcqContact *c, int folder = 0);
  79. IcqContact *addContact(uint32 uin, int folder = 0);
  80. BOOL doRegWizard();
  81. BOOL doLogin();
  82. void setDefaultOptions();
  83. void addFriend(IcqContact *c, int folder = -1);
  84. BOOL delFriend(IcqContact *c, int folder = -1);
  85. void saveGroupInfo();
  86. BOOL loadGroupInfo();
  87. void initGUI();
  88. BOOL loadPlugins();
  89. HICON iconSysMsg;
  90. HICON iconBlank;
  91. CToolTipCtrl toolTip;
  92. CImageList statusImgList;
  93. IcqContact *curContact;
  94. uint32 pendingStatus;
  95. uint16 lastSeq;
  96. char hostBuf[MAXGETHOSTSTRUCT];
  97. UinList uinList;
  98. int regMode;
  99. int alignType;
  100. CSize winNormalSize;
  101. BOOL isHide;
  102. IcqSkin skin;
  103. CMenu *currentMenu;
  104. // Dialog Data
  105. //{{AFX_DATA(CIcqDlg)
  106. enum { IDD = IDD_MYICQ_DIALOG };
  107. CButtonST m_btnStat;
  108. CButtonST m_btnAbout;
  109. CButtonST m_btnMain;
  110. CButtonST m_btnStatus;
  111. CButtonST m_btnSysMsg;
  112. CButtonST m_btnSearch;
  113. //}}AFX_DATA
  114. // ClassWizard generated virtual function overrides
  115. //{{AFX_VIRTUAL(CIcqDlg)
  116. public:
  117. virtual BOOL PreTranslateMessage(MSG* pMsg);
  118. protected:
  119. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  120. //}}AFX_VIRTUAL
  121. virtual void OnOK();
  122. // Implementation
  123. protected:
  124. // Generated message map functions
  125. //{{AFX_MSG(CIcqDlg)
  126. virtual BOOL OnInitDialog();
  127. afx_msg void OnSize(UINT nType, int cx, int cy);
  128. afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
  129. afx_msg void OnSendMessage();
  130. afx_msg void OnViewDetail();
  131. afx_msg void OnFindContact();
  132. afx_msg void OnTimer(UINT nIDEvent);
  133. afx_msg void OnSysMessage();
  134. afx_msg UINT OnNcHitTest(CPoint point);
  135. afx_msg void OnMainMenu();
  136. afx_msg void OnGfxSmallIcon();
  137. afx_msg void OnUpdateGfxSmallIcon(CCmdUI* pCmdUI);
  138. afx_msg void OnGfxLargeIcon();
  139. afx_msg void OnUpdateGfxLargeIcon(CCmdUI* pCmdUI);
  140. afx_msg void OnGfxFontColor();
  141. afx_msg void OnGfxBackground();
  142. afx_msg void OnGfxAddGroup();
  143. afx_msg void OnUpdateGfxAddGroup(CCmdUI* pCmdUI);
  144. afx_msg void OnGfxRemove();
  145. afx_msg void OnGfxRename();
  146. afx_msg void OnModifyInfo();
  147. afx_msg void OnGfxShowOnline();
  148. afx_msg void OnStatus();
  149. afx_msg void OnStatusOnline();
  150. afx_msg void OnStatusOffline();
  151. afx_msg void OnStatusInvis();
  152. afx_msg void OnSysOption();
  153. afx_msg void OnStatusAwayCustom();
  154. afx_msg void OnStatusAwayNoReply();
  155. afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  156. afx_msg void OnRegWizard();
  157. afx_msg void OnChangeUser();
  158. afx_msg void OnAbout();
  159. afx_msg void OnDestroy();
  160. afx_msg void OnMoving(UINT fwSide, LPRECT pRect);
  161. afx_msg void OnSendEmail();
  162. afx_msg void OnHomePage();
  163. afx_msg void OnAddAsFriend();
  164. afx_msg void OnMsgHistory();
  165. afx_msg void OnMessageMgr();
  166. afx_msg void OnBroadcastMsg();
  167. //}}AFX_MSG
  168. afx_msg LRESULT OnOutBarNotify(WPARAM wParam, LPARAM lParam);
  169. afx_msg LRESULT OnHostFound(WPARAM wParam, LPARAM lParam);
  170. afx_msg LRESULT OnHotKey(WPARAM wParam, LPARAM lParam);
  171. afx_msg LRESULT OnNotifyIcon(WPARAM wParam, LPARAM lParam);
  172. BOOL OnToolTipText(UINT id, NMHDR *pNMHDR, LRESULT *pResult);
  173. afx_msg void OnStatusAway(UINT nID);
  174. afx_msg void OnPlugin(UINT nID);
  175. DECLARE_MESSAGE_MAP()
  176. };
  177. //{{AFX_INSERT_LOCATION}}
  178. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  179. #endif // !defined(AFX_MYICQDLG_H__A1176E03_E6E7_4E6C_93BB_503F26D81C97__INCLUDED_)