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.

130 lines
3.1 KiB

  1. // TreeWindow.h: interface for the CTreeWindow class.
  2. // implements the subclassed tree control for the common prop page
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_TREEWINDOW_H__5AAE4BD7_4DA7_4064_88BB_8C7FDF9A1464__INCLUDED_)
  5. #define AFX_TREEWINDOW_H__5AAE4BD7_4DA7_4064_88BB_8C7FDF9A1464__INCLUDED_
  6. #include "resource.h" // main symbols
  7. #include "misccell.h"
  8. using namespace std;
  9. class CNP_CommonPage;
  10. class CTreeWin :
  11. public CWindowImpl<CTreeWin>
  12. {
  13. public:
  14. CTreeWin(
  15. CNP_CommonPage* pParent
  16. );
  17. virtual ~CTreeWin();
  18. private:
  19. //typedef CAdapt <CComPtr <ILocator> > PAdaptILocator;
  20. //typedef CAdapt <CComPtr <ITuningSpace> > PAdaptITuningSpace;
  21. typedef map <ITuningSpace*, ILocator*> TREE_MAP;
  22. typedef enum
  23. {
  24. CarrierFrequency,
  25. InnerFEC,
  26. InnerFECRate,
  27. Modulation,
  28. OuterFEC,
  29. OuterFECRate,
  30. SymbolRate,
  31. UniqueName,
  32. FriendlyName,
  33. TunSpace_CLSID,
  34. FrequencyMapping
  35. }TreeParams; //all possible param values for the Tree leafs
  36. TREE_MAP m_treeMap; //list used for the tree
  37. CNP_CommonPage* m_pCommonPage;
  38. CBDAMiscellaneous m_misc;
  39. void
  40. CleanMapList ();//release all tree interface pointers
  41. //the message map for the sublassed tree control
  42. BEGIN_MSG_MAP(CTreeWin)
  43. //we would like to do smtg like that
  44. //NOTIFY_HANDLER(IDC_TREE_TUNING_SPACES, NM_CLICK, OnClickTree_tuning_spaces)
  45. //but it seems ATL is not reflecting same WM_NOTIFY MESSAGE
  46. MESSAGE_HANDLER(OCM__BASE+WM_NOTIFY, ON_REFLECT_WM_NOTIFY)
  47. DEFAULT_REFLECTION_HANDLER ()
  48. END_MSG_MAP()
  49. LRESULT OnClickTree_tuning_spaces(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
  50. {
  51. return 0;
  52. }
  53. LRESULT OnItemexpandedTree_tuning_spaces(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
  54. {
  55. return 0;
  56. }
  57. LRESULT ON_REFLECT_WM_NOTIFY(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  58. {
  59. if (lParam == NM_CLICK )
  60. return 0;
  61. LPNMHDR lpnmh = (LPNMHDR) lParam;
  62. switch (lpnmh->code)
  63. {
  64. case TVN_ITEMEXPANDED:
  65. return OnItemexpandedTree_tuning_spaces (
  66. IDC_TREE_TUNING_SPACES,
  67. lpnmh,
  68. bHandled
  69. );
  70. case NM_CLICK:
  71. return OnClickTree_tuning_spaces (
  72. IDC_TREE_TUNING_SPACES,
  73. lpnmh,
  74. bHandled
  75. );
  76. }
  77. return 0;
  78. }
  79. HTREEITEM
  80. InsertLocator (
  81. HTREEITEM hParentItem,
  82. ILocator* pLocator
  83. );
  84. HTREEITEM
  85. InsertTuningSpace (
  86. ITuningSpace* pTunSpace,
  87. TCHAR* szCaption = _T("")
  88. );
  89. HTREEITEM
  90. InsertTreeItem (
  91. HTREEITEM hParentItem ,
  92. LONG lParam,
  93. TCHAR* pszText,
  94. bool bBold = false
  95. );
  96. public:
  97. //============================================================
  98. // It's refreshing the tree with the new TunningSpace info
  99. // from the NP.
  100. //
  101. //============================================================
  102. HRESULT
  103. RefreshTree (
  104. IScanningTuner* pTuner
  105. );
  106. //============================================================
  107. // Will set the current tuning space locator to the NP
  108. //
  109. //
  110. //============================================================
  111. HRESULT
  112. SubmitCurrentLocator ();
  113. };
  114. #endif // !defined(AFX_TREEWINDOW_H__5AAE4BD7_4DA7_4064_88BB_8C7FDF9A1464__INCLUDED_)