Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
4.2 KiB

  1. // bllist.h : Declaration of the CMsgrList
  2. // Messenger integration to OE
  3. // Created 05/07/98 by YST
  4. //
  5. #ifndef __BLLIST_H_
  6. #define __BLLIST_H_
  7. #include "basicim2.h"
  8. #include "blobevnt.h"
  9. #define MAXNAME 256
  10. // message for all Msgr client windows
  11. #define WM_USER_STATUS_CHANGED (WM_USER + 1)
  12. #define WM_MSGR_LOGOFF (WM_USER + 2)
  13. #define WM_MSGR_LOGRESULT (WM_USER + 3)
  14. #define WM_USER_MUSER_REMOVED (WM_USER + 4)
  15. #define WM_USER_MUSER_ADDED (WM_USER + 5)
  16. #define WM_USER_NAME_CHANGED (WM_USER + 6)
  17. #define WM_LOCAL_STATUS_CHANGED (WM_USER + 7)
  18. #define WM_MSGR_SHUTDOWN (WM_USER + 8)
  19. typedef struct _tag_OEMsgrInfo
  20. {
  21. WCHAR * pchMsgrName;
  22. WCHAR * pchID;
  23. WCHAR * pchHomePhone;
  24. WCHAR * pchWorkPhone;
  25. WCHAR * pchMobilePhone;
  26. int nStatus;
  27. struct _tag_OEMsgrInfo * pPrev;
  28. struct _tag_OEMsgrInfo * pNext;
  29. } oeMsgrInfo;
  30. typedef oeMsgrInfo * LPMINFO;
  31. typedef struct _tag_MsgrWndList
  32. {
  33. HWND hWndUI;
  34. struct _tag_MsgrWndList * pPrev;
  35. struct _tag_MsgrWndList * pNext;
  36. } MsgrWndList;
  37. typedef MsgrWndList * LPMWNDLIST;
  38. class CMsgrList
  39. {
  40. public:
  41. CMsgrList();
  42. ~CMsgrList();
  43. void AddWndEntry(HWND hWnd);
  44. void FindAndDelEntry(HWND hWnd, LPMWNDLIST pWndEntry=NULL);
  45. LPMINFO GetRootMsgrItem(void) { return(m_pblInfRoot); }
  46. void RegisterUIWnd(HWND hWndUI);
  47. void UnRegisterUIWnd(HWND hWndUI);
  48. LPMINFO GetFirstMsgrItem(void) { CheckAndInitMsgr(); return (m_pblInfRoot); };
  49. LPMINFO GetNextMsgrItem(LPMINFO pEntry) { return(pEntry ? pEntry->pNext : NULL); }
  50. int AddRef(void) { return(++m_nRef); }
  51. void Release(void); /* { return(--m_nRef); } */
  52. HRESULT CheckAndInitMsgr(void);
  53. HRESULT SendInstMessage(WCHAR *pchID);
  54. HRESULT EventUserStateChanged(IBasicIMUser * pUser);
  55. HRESULT EventUserRemoved(IBasicIMUser * pUser);
  56. HRESULT EventUserAdded(IBasicIMUser * pUser);
  57. HRESULT EventUserNameChanged(IBasicIMUser * pUser);
  58. HRESULT EventLocalStateChanged(BIMSTATE State);
  59. HRESULT UserLogon(void);
  60. HRESULT AutoLogon(void);
  61. HRESULT GetLocalState(BIMSTATE *pState);
  62. HRESULT SetLocalState(BIMSTATE State);
  63. HRESULT EventLogoff(void);
  64. HRESULT EventAppShutdown(void);
  65. HRESULT EventLogonResult(long lResult);
  66. HRESULT HrInitMsgr(void);
  67. HRESULT FillList(void);
  68. HRESULT UserLogoff(void);
  69. HRESULT FindAndDeleteUser(WCHAR * pchID, BOOL fDelete);
  70. HRESULT NewOnlineContact(void);
  71. HRESULT LaunchOptionsUI(void);
  72. HRESULT LaunchPhoneUI(WCHAR *Phone);
  73. HRESULT AddUser(WCHAR * pchID);
  74. void DelAllEntries(LPMWNDLIST pWndEntry);
  75. long GetCount(void);
  76. BOOL IsLocalOnline(void);
  77. BOOL IsLocalName(WCHAR *pchName);
  78. BOOL IsContactOnline(WCHAR *pchID, LPMINFO pEntry);
  79. private:
  80. void FreeWndList(LPMWNDLIST pWndEntry);
  81. void FreeMsgrInfoList(LPMINFO pEntry);
  82. void RemoveMsgrInfoEntry(LPMINFO pEntry);
  83. void RemoveWndEntry(LPMWNDLIST pWndEntry);
  84. void SendMsgToAllUIWnd(UINT msg, WPARAM wParam, LPARAM lParam, LPMWNDLIST pWndEntry=NULL);
  85. void AddMsgrListEntry(WCHAR *szName, WCHAR *szID, int nState, WCHAR *wszHomePhone = NULL, WCHAR *wszWorkPhone = NULL, WCHAR *wszMobilePhone = NULL);
  86. void FindAndRemoveBlEntry(WCHAR *szID, LPMINFO pEntry=NULL);
  87. private:
  88. LPMINFO m_pblInfRoot;
  89. LPMINFO m_pblInfLast;
  90. LPMWNDLIST m_pWndLRoot;
  91. LPMWNDLIST m_pWndLLast;
  92. int m_nRef;
  93. // Smart pointer
  94. CComPtr<IBasicIM> m_spMsgrObject;
  95. CMsgrObjectEvents* m_pMsgrObjectEvents;
  96. long m_MsgrCookie;
  97. };
  98. // Global functions available for everybody
  99. CMsgrList * OE_OpenMsgrList(void);
  100. void OE_CloseMsgrList(CMsgrList *pCMsgrList);
  101. HRESULT OE_Msgr_Logoff(void);
  102. HRESULT InstallMessenger(HWND hWnd);
  103. #ifdef NEEDED
  104. HRESULT OE_Msgr_Logon(void);
  105. #endif // NEEDED
  106. #endif // __BLLIST_H_