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.

142 lines
5.1 KiB

  1. #ifndef __SDKWindow_h__
  2. #define __SDKWindow_h__
  3. class CNmChannelAppShareObj;
  4. class CNmCallObj;
  5. class CSDKWindow : public CWindowImpl<CSDKWindow>
  6. {
  7. static CSDKWindow* ms_pSDKWnd;
  8. private:
  9. // Conference Notification Parameter structures
  10. struct ConferenceMemberChanged
  11. {
  12. NM_MEMBER_NOTIFY uNotify;
  13. INmMember *pMember;
  14. };
  15. struct ConferenceChannelChanged
  16. {
  17. NM_CHANNEL_NOTIFY uNotify;
  18. INmChannel *pChannel;
  19. };
  20. struct StateChanged
  21. {
  22. NM_SHAPP_STATE uNotify;
  23. INmSharableApp *pApp;
  24. };
  25. CONSTANT(DELAY_UNLOAD_TIMER = 123);
  26. CONSTANT(DELAY_UNLOAD_INTERVAL = 10000);
  27. static int ms_NumUnlocks;
  28. // This will prevent soemone creating us other than Init
  29. CSDKWindow() { ; }
  30. public:
  31. // NmManagerNotify
  32. CONSTANT(WM_APP_NOTIFY_MANAGER_NMUI = (WM_APP + 10));
  33. CONSTANT(WM_APP_NOTIFY_CALL_CREATED = (WM_APP + 11));
  34. CONSTANT(WM_APP_NOTIFY_CONFERENCE_CREATED = (WM_APP + 12));
  35. //NmConferenceNotify
  36. CONSTANT(WM_APP_NOTIFY_CONFERENCE_NMUI = (WM_APP + 20));
  37. CONSTANT(WM_APP_NOTIFY_CONFERENCE_STATE_CHANGED = (WM_APP + 21));
  38. CONSTANT(WM_APP_NOTIFY_CONFERENCE_MEMBER_CHANGED = (WM_APP + 22));
  39. CONSTANT(WM_APP_NOTIFY_CONFERENCE_CHANNEL_CHANGED = (WM_APP + 23));
  40. // NmCallNotify
  41. CONSTANT(WM_APP_NOTIFY_NMUI = (WM_APP + 31));
  42. CONSTANT(WM_APP_NOTIFY_CALL_STATE_CHANGED = (WM_APP + 32));
  43. CONSTANT(WM_APP_NOTIFY_FAILED = (WM_APP + 33));
  44. CONSTANT(WM_APP_NOTIFY_ACCEPTED = (WM_APP + 34));
  45. CONSTANT(WM_APP_NOTIFY_STATE_CHANGED = (WM_APP + 35));
  46. DECLARE_WND_CLASS(NULL);
  47. BEGIN_MSG_MAP(CSDKWindow)
  48. // Manager Notifications
  49. MESSAGE_HANDLER(WM_APP_NOTIFY_MANAGER_NMUI, _OnMsgManagerNmUI)
  50. MESSAGE_HANDLER(WM_APP_NOTIFY_CALL_CREATED, _OnMsgCallCreated)
  51. MESSAGE_HANDLER(WM_APP_NOTIFY_CONFERENCE_CREATED, _OnMsgConferenceCreated)
  52. // Conference Notify
  53. MESSAGE_HANDLER(WM_APP_NOTIFY_CONFERENCE_NMUI, _OnMsgConferenceNmUI)
  54. MESSAGE_HANDLER(WM_APP_NOTIFY_CONFERENCE_STATE_CHANGED, _OnMsgConferenceStateChanged)
  55. MESSAGE_HANDLER(WM_APP_NOTIFY_CONFERENCE_MEMBER_CHANGED, _OnMsgConferenceMemberChanged)
  56. MESSAGE_HANDLER(WM_APP_NOTIFY_CONFERENCE_CHANNEL_CHANGED, _OnMsgConferenceChannelChanged)
  57. // Call Notifications
  58. MESSAGE_HANDLER(WM_APP_NOTIFY_CALL_STATE_CHANGED, _OnMsgCallStateChanged)
  59. MESSAGE_HANDLER(WM_APP_NOTIFY_NMUI, _OnMsgCallNmUI)
  60. MESSAGE_HANDLER(WM_APP_NOTIFY_FAILED, _OnMsgFailed)
  61. MESSAGE_HANDLER(WM_APP_NOTIFY_ACCEPTED, _OnMsgAccepted)
  62. MESSAGE_HANDLER(WM_APP_NOTIFY_STATE_CHANGED, _OnStateChanged);
  63. MESSAGE_HANDLER(WM_TIMER, _OnTimer)
  64. END_MSG_MAP();
  65. public:
  66. // Initialization
  67. static HRESULT InitSDK();
  68. static void CleanupSDK();
  69. static HRESULT PostDelayModuleUnlock();
  70. // Manager Notificyations
  71. static HRESULT PostManagerNmUI(CNmManagerObj* pMgr, CONFN uNotify);
  72. static HRESULT PostCallCreated(CNmManagerObj* pMgr, INmCall* pInternalNmCall);
  73. static HRESULT PostConferenceCreated(CNmManagerObj* pMgr, INmConference* pInternalNmConference);
  74. // Conference Notificyations
  75. static HRESULT PostConferenceNmUI(CNmConferenceObj* pConf, CONFN uNotify);
  76. static HRESULT PostConferenceStateChanged(CNmConferenceObj* pConf, NM_CONFERENCE_STATE uState);
  77. static HRESULT PostConferenceMemberChanged(CNmConferenceObj* pConf, NM_MEMBER_NOTIFY uNotify, INmMember *pMember);
  78. static HRESULT PostConferenceChannelChanged(CNmConferenceObj* pConf, NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel);
  79. // Call Notificyations
  80. static HRESULT PostCallNmUi(CNmCallObj* pCall, CONFN uNotify);
  81. static HRESULT PostCallStateChanged(CNmCallObj* pCall, NM_CALL_STATE uState);
  82. static HRESULT PostFailed(CNmCallObj* pCall, ULONG uError);
  83. static HRESULT PostAccepted(CNmCallObj* pCall, INmConference* pConference);
  84. static HRESULT PostStateChanged(CNmChannelAppShareObj* pAppShareChan, NM_SHAPP_STATE uNotify, INmSharableApp *pApp);
  85. private: // Helpers
  86. // Manager Mssages
  87. LRESULT _OnMsgManagerNmUI(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  88. LRESULT _OnMsgConferenceCreated(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  89. LRESULT _OnMsgCallCreated(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  90. // Conference message
  91. LRESULT _OnMsgConferenceNmUI(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  92. LRESULT _OnMsgConferenceStateChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  93. LRESULT _OnMsgConferenceMemberChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  94. LRESULT _OnMsgConferenceChannelChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  95. // Call Messages
  96. LRESULT _OnMsgCallStateChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  97. LRESULT _OnMsgCallNmUI(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  98. LRESULT _OnMsgFailed(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  99. LRESULT _OnMsgAccepted(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  100. LRESULT _OnStateChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  101. LRESULT _OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  102. };
  103. #endif // __SDKWindow_h__