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.

181 lines
5.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : CoverPages.h //
  3. // //
  4. // DESCRIPTION : Header file for the fax cover pages node //
  5. // //
  6. // AUTHOR : yossg //
  7. // //
  8. // HISTORY : //
  9. // Feb 9 2000 yossg Create //
  10. // Oct 17 2000 yossg //
  11. // //
  12. // Copyright (C) 2000 Microsoft Corporation All Rights Reserved //
  13. /////////////////////////////////////////////////////////////////////////////
  14. #ifndef H_FAXCOVERPAGES_H
  15. #define H_FAXCOVERPAGES_H
  16. #include "snapin.h"
  17. #include "snpnres.h"
  18. #include "CoverPage.h"
  19. #include "CovNotifyWnd.h"
  20. class CFaxServerNode;
  21. class CFaxCoverPageNode;
  22. class CFaxCoverPageNotifyWnd;
  23. class CFaxCoverPagesNode : public CNodeWithResultChildrenList<
  24. CFaxCoverPagesNode,
  25. CFaxCoverPageNode,
  26. CSimpleArray<CFaxCoverPageNode*>,
  27. FALSE>
  28. {
  29. public:
  30. BEGIN_SNAPINCOMMAND_MAP(CFaxCoverPagesNode, FALSE)
  31. SNAPINCOMMAND_ENTRY(IDM_OPEN_COVERPAGE, OnAddCoverPageFile)
  32. SNAPINCOMMAND_ENTRY(IDM_NEW_COVERPAGE, OnNewCoverPage)
  33. END_SNAPINCOMMAND_MAP()
  34. BEGIN_SNAPINTOOLBARID_MAP(CFaxCoverPagesNode)
  35. END_SNAPINTOOLBARID_MAP()
  36. SNAPINMENUID(IDR_COVERPAGES_MENU)
  37. //
  38. // Constructor
  39. //
  40. CFaxCoverPagesNode(CSnapInItem * pParentNode, CSnapin * pComponentData) :
  41. CNodeWithResultChildrenList<CFaxCoverPagesNode, CFaxCoverPageNode, CSimpleArray<CFaxCoverPageNode*>, FALSE>(pParentNode, pComponentData )
  42. {
  43. m_bIsFirstPopulateCall = TRUE;
  44. m_NotifyWin = NULL;
  45. m_hNotifyThread = NULL;
  46. }
  47. //
  48. // Destructor
  49. //
  50. ~CFaxCoverPagesNode()
  51. {
  52. DEBUG_FUNCTION_NAME(_T("CFaxCoverPagesNode::~CFaxCoverPagesNode"));
  53. //
  54. // StopNotificationThread
  55. //
  56. HRESULT hRc = StopNotificationThread();
  57. if (S_OK != hRc)
  58. {
  59. DebugPrintEx(
  60. DEBUG_ERR,
  61. _T("Failed to StopNotificationThread. (hRc : %08X)"),
  62. hRc);
  63. }
  64. //
  65. // Close Shutdown Event handle
  66. //
  67. if (m_hStopNotificationThreadEvent)
  68. {
  69. CloseHandle (m_hStopNotificationThreadEvent);
  70. m_hStopNotificationThreadEvent = NULL;
  71. }
  72. //
  73. // Destroy Window
  74. //
  75. if (NULL != m_NotifyWin)
  76. {
  77. if (m_NotifyWin->IsWindow())
  78. {
  79. m_NotifyWin->DestroyWindow();
  80. }
  81. delete m_NotifyWin;
  82. m_NotifyWin = NULL;
  83. }
  84. }
  85. //
  86. // get data from RPC
  87. //
  88. virtual HRESULT PopulateResultChildrenList();
  89. virtual HRESULT InsertColumns(IHeaderCtrl *pHeaderCtrl);
  90. virtual HRESULT SetVerbs(IConsoleVerb *pConsoleVerb);
  91. void InitParentNode(CFaxServerNode *pParentNode)
  92. {
  93. m_pParentNode = pParentNode;
  94. }
  95. virtual HRESULT OnRefresh(LPARAM arg,
  96. LPARAM param,
  97. IComponentData *pComponentData,
  98. IComponent * pComponent,
  99. DATA_OBJECT_TYPES type);
  100. HRESULT DoRefresh(CSnapInObjectRootBase *pRoot);
  101. HRESULT DoRefresh();
  102. HRESULT Init();
  103. HRESULT InitDisplayName();
  104. HRESULT DeleteCoverPage(BSTR bstrName, CFaxCoverPageNode *pChildNode);
  105. HRESULT OnNewCoverPage(bool &bHandled, CSnapInObjectRootBase *pRoot);
  106. HRESULT OnAddCoverPageFile(bool &bHandled, CSnapInObjectRootBase *pRoot);
  107. DWORD OpenCoverPageEditor( BSTR bstrFileName);
  108. HRESULT OnShowContextHelp(
  109. IDisplayHelp* pDisplayHelp, LPOLESTR helpFile);
  110. void UpdateMenuState (UINT id, LPTSTR pBuf, UINT *flags);
  111. private:
  112. BOOL BrowseAndCopyCoverPage(
  113. LPTSTR pInitialDir,
  114. LPWSTR pCovPageExtensionLetters
  115. );
  116. //
  117. // Notification thread
  118. //
  119. HRESULT StartNotificationThread();
  120. HRESULT StopNotificationThread();
  121. HRESULT RestartNotificationThread();
  122. //
  123. // members
  124. //
  125. static CColumnsInfo m_ColsInfo;
  126. CFaxServerNode * m_pParentNode;
  127. BOOL m_bIsFirstPopulateCall;
  128. static HANDLE m_hStopNotificationThreadEvent;
  129. HANDLE m_hNotifyThread; // Handle of background notify thread
  130. static DWORD WINAPI NotifyThreadProc (LPVOID lpParameter);
  131. CFaxCoverPageNotifyWnd * m_NotifyWin; //: public CWindowImpl
  132. WCHAR m_pszCovDir[MAX_PATH+1];
  133. };
  134. typedef CNodeWithResultChildrenList<CFaxCoverPagesNode, CFaxCoverPageNode, CSimpleArray<CFaxCoverPageNode*>, FALSE>
  135. CBaseFaxOutboundRulesNode;
  136. #endif //H_FAXCOVERPAGES_H