Source code of Windows XP (NT5)
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.

141 lines
4.5 KiB

  1. /*++
  2. Copyright (C) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. ctvctl.h
  5. Abstract:
  6. header file for ctvctl.cpp
  7. Author:
  8. William Hsieh (williamh) created
  9. Revision History:
  10. --*/
  11. #include "..\inc\tvintf.h"
  12. // CTVCtl.h : Declaration of the CTVCtrl OLE control class.
  13. const int MAX_CONNECTIONS = 10;
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CTVCtrl : See CTVCtl.cpp for implementation.
  16. class CTVCtrl : public COleControl
  17. {
  18. DECLARE_DYNCREATE(CTVCtrl)
  19. // Constructor
  20. public:
  21. CTVCtrl();
  22. // Overrides
  23. // ClassWizard generated virtual function overrides
  24. //{{AFX_VIRTUAL(CTVCtrl)
  25. public:
  26. virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  27. virtual void DoPropExchange(CPropExchange* pPX);
  28. virtual void OnResetState();
  29. virtual BOOL PreTranslateMessage(MSG* pMsg);
  30. //}}AFX_VIRTUAL
  31. // Implementation
  32. protected:
  33. ~CTVCtrl();
  34. DECLARE_OLECREATE_EX(CTVCtrl) // Class factory and guid
  35. DECLARE_OLETYPELIB(CTVCtrl) // GetTypeInfo
  36. DECLARE_OLECTLTYPE(CTVCtrl) // Type name and misc status
  37. // Subclassed control support
  38. BOOL PreCreateWindow(CREATESTRUCT& cs);
  39. BOOL IsSubclassedControl();
  40. LRESULT OnOcmCommand(WPARAM wParam, LPARAM lParam);
  41. // Message maps
  42. //{{AFX_MSG(CTVCtrl)
  43. afx_msg void OnDestroy();
  44. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  45. //}}AFX_MSG
  46. afx_msg LRESULT OnOcmNotify(WPARAM wParam, LPARAM lParam);
  47. DECLARE_MESSAGE_MAP()
  48. // Dispatch maps
  49. //{{AFX_DISPATCH(CTVCtrl)
  50. //}}AFX_DISPATCH
  51. DECLARE_DISPATCH_MAP()
  52. // Event maps
  53. //{{AFX_EVENT(CTVCtrl)
  54. //}}AFX_EVENT
  55. DECLARE_EVENT_MAP()
  56. // Dispatch and event IDs
  57. public:
  58. enum {
  59. //{{AFX_DISP_ID(CTVCtrl)
  60. //}}AFX_DISP_ID
  61. };
  62. protected:
  63. DECLARE_INTERFACE_MAP()
  64. BEGIN_INTERFACE_PART(DMTVOCX, IDMTVOCX)
  65. public: virtual HTREEITEM InsertItem(LPTV_INSERTSTRUCT pis);
  66. public: virtual HRESULT DeleteItem(HTREEITEM hItem);
  67. public: virtual HRESULT DeleteAllItems();
  68. public: virtual HIMAGELIST SetImageList(INT iImage, HIMAGELIST himl);
  69. public: virtual HRESULT SetItem(TV_ITEM* pitem);
  70. public: virtual HRESULT Expand(UINT Flags, HTREEITEM htiem);
  71. public: virtual HRESULT SelectItem(UINT Flags, HTREEITEM hitem);
  72. public: virtual HRESULT SetStyle(DWORD dwStyle);
  73. public: virtual HWND GetWindowHandle();
  74. public: virtual HRESULT GetItem(TV_ITEM* pti);
  75. public: virtual HTREEITEM GetNextItem(UINT Flags, HTREEITEM htiRef);
  76. public: virtual HRESULT SelectItem(HTREEITEM hti);
  77. public: virtual UINT GetCount();
  78. public: virtual HTREEITEM GetSelectedItem();
  79. public: virtual HRESULT Connect(IComponent* pIComponent, MMC_COOKIE);
  80. public: virtual HRESULT SetActiveConnection(MMC_COOKIE cookie);
  81. public: virtual MMC_COOKIE GetActiveConnection();
  82. public: virtual HRESULT SetRedraw(BOOL Redraw);
  83. public: virtual BOOL EnsureVisible(HTREEITEM hitem);
  84. END_INTERFACE_PART(DMTVOCX)
  85. private:
  86. HTREEITEM InsertItem(LPTV_INSERTSTRUCT pis);
  87. HRESULT DeleteItem(HTREEITEM hItem);
  88. HRESULT DeleteAllItems();
  89. HIMAGELIST SetImageList(INT iImage, HIMAGELIST himl);
  90. HRESULT SetItem(TV_ITEM* pitem);
  91. HRESULT Expand(UINT Flags, HTREEITEM htiem);
  92. HRESULT SelectItem(UINT Flags, HTREEITEM hitem);
  93. HRESULT SetStyle(DWORD dwStyle);
  94. HWND GetWindowHandle();
  95. HRESULT GetItem(TV_ITEM* pti);
  96. HTREEITEM GetNextItem(UINT Flags, HTREEITEM htiRef);
  97. HRESULT SelectItem(HTREEITEM hti);
  98. UINT GetCount();
  99. HTREEITEM HitTest(LONG x, LONG y, UINT* phtFlags);
  100. HTREEITEM GetSelectedItem();
  101. HRESULT Connect(IComponent* pIComponent, MMC_COOKIE cookie);
  102. HRESULT SetActiveConnection(MMC_COOKIE cookie);
  103. MMC_COOKIE GetActiveConnection();
  104. HRESULT SetRedraw(BOOL Redraw);
  105. BOOL EnsureVisible(HTREEITEM hitem);
  106. TV_NOTIFY_CODE DoMouseNotification(UINT code, MMC_COOKIE* pcookie,LPARAM* parg, LPARAM* param);
  107. // private data
  108. MMC_COOKIE m_ActiveCookie;
  109. int m_nConnections;
  110. BOOL m_HasFocus;
  111. IComponent* m_pIComponent;
  112. ISnapinCallback* m_pISnapinCallback;
  113. BOOL m_Destroyed;
  114. };