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

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. #if !defined(AFX_MYICQCTRL_H__EB8DBF55_4F3E_41D2_8726_515944D25531__INCLUDED_)
  12. #define AFX_MYICQCTRL_H__EB8DBF55_4F3E_41D2_8726_515944D25531__INCLUDED_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif // _MSC_VER > 1000
  16. // MyICQCtrl.h : header file
  17. //
  18. #include "OutBarCtrl.h"
  19. #include "icqdb.h"
  20. class IcqContact;
  21. class DBInStream;
  22. class DBOutStream;
  23. class IcqSkin;
  24. /////////////////////////////////////////////////////////////////////////////
  25. // MyICQCtrl window
  26. class MyICQCtrl : public OutBarCtrl, public DBSerialize {
  27. // Construction
  28. public:
  29. MyICQCtrl();
  30. // Attributes
  31. public:
  32. BOOL showOnlineOnly() {
  33. return onlineOnly;
  34. }
  35. void setShowOnlineOnly(int b) {
  36. onlineOnly = b;
  37. repaintInsideRect();
  38. }
  39. IcqContact *contact(int item) {
  40. return contact(selFolder, item);
  41. }
  42. IcqContact *contact(int folder, int item);
  43. void setSkin(IcqSkin *skin) {
  44. this->skin = skin;
  45. }
  46. // Operations
  47. public:
  48. void update(uint32 uin, BOOL move = FALSE);
  49. void addContact(int folder, IcqContact *c);
  50. void removeContact(uint32 uin);
  51. void blinkText(uint32 uin);
  52. void blinkImage(uint32 uin, BOOL blink = TRUE);
  53. void load(DBInStream &in);
  54. void save(DBOutStream &out);
  55. // Overrides
  56. // ClassWizard generated virtual function overrides
  57. //{{AFX_VIRTUAL(MyICQCtrl)
  58. //}}AFX_VIRTUAL
  59. // Implementation
  60. public:
  61. virtual ~MyICQCtrl();
  62. private:
  63. class BlinkInfo {
  64. public:
  65. BlinkInfo(uint32 uin, int frame) {
  66. this->uin = uin;
  67. this->frame = frame;
  68. }
  69. uint32 uin;
  70. int frame;
  71. };
  72. typedef list<BlinkInfo> BlinkList;
  73. virtual int getMaxVisibleItem();
  74. virtual void drawBackground(CDC *pDC, CRect &rc);
  75. virtual void drawItemText(CDC *pDC, int i, COLORREF color);
  76. virtual void drawFolder(CDC *pDC, int i, BOOL pressed, BOOL hilight);
  77. virtual void drawScroll(CDC *pDC, int i, BOOL pressed);
  78. BOOL findItem(uint32 uin, int &folder, int &item);
  79. void doBlinkText();
  80. void doBlinkImage();
  81. BOOL onlineOnly;
  82. BlinkList blinkTextList;
  83. BlinkList blinkImageList;
  84. IcqSkin *skin;
  85. // Generated message map functions
  86. protected:
  87. //{{AFX_MSG(MyICQCtrl)
  88. afx_msg void OnTimer(UINT nIDEvent);
  89. //}}AFX_MSG
  90. DECLARE_MESSAGE_MAP()
  91. };
  92. /////////////////////////////////////////////////////////////////////////////
  93. //{{AFX_INSERT_LOCATION}}
  94. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  95. #endif // !defined(AFX_MYICQCTRL_H__EB8DBF55_4F3E_41D2_8726_515944D25531__INCLUDED_)