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.

127 lines
3.3 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. CLASSINF.H
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef __HMM_CLASS_INFO__H_
  9. #define __HMM_CLASS_INFO__H_
  10. #include <windows.h>
  11. #include <objbase.h>
  12. #include "providl.h"
  13. #include "unk.h"
  14. #include "arrtempl.h"
  15. #include "hmmstr.h"
  16. #include <wstring.h>
  17. #include "project.h"
  18. #include "trees.h"
  19. class CHmmClassInfo
  20. {
  21. protected:
  22. WString m_wsClassName;
  23. BOOL m_bIncludeChildren;
  24. CPropertyList m_Selected;
  25. public:
  26. CHmmClassInfo(CLifeControl* pControl)
  27. : m_bIncludeChildren(FALSE), m_Selected(pControl, NULL)
  28. {
  29. m_Selected.AddRef();
  30. if(pControl) pControl->Release(&m_Selected);
  31. }
  32. void SetControl(CLifeControl* pControl)
  33. {
  34. m_Selected.SetControl(pControl);
  35. }
  36. void Load(HMM_CLASS_INFO ci);
  37. void Save(HMM_CLASS_INFO& ci);
  38. inline CPropertyList& GetSelected() {return m_Selected;}
  39. inline WString& AccessClassName() {return m_wsClassName;}
  40. inline BOOL& AccessIncludeChildren() {return m_bIncludeChildren;}
  41. public:
  42. static HRESULT CheckObjectAgainstMany(
  43. IN long lNumInfos,
  44. IN CHmmClassInfo** apInfos,
  45. IN IHmmPropertySource* pSource,
  46. OUT IHmmPropertyList** ppList,
  47. OUT long* plIndex);
  48. CHmmNode* GetTree();
  49. };
  50. //*****************************************************************************
  51. //
  52. // IMPORTANT: there is an issue with someone holding on to a CPropertyList
  53. // pointer while someone else calls RemoveAllInfos!
  54. //
  55. //*****************************************************************************
  56. class CClassInfoFilter : public CUnk
  57. {
  58. protected:
  59. class XFilter : public CImpl<IHmmClassInfoFilter, CClassInfoFilter>
  60. {
  61. public:
  62. XFilter(CClassInfoFilter* pObj)
  63. : CImpl<IHmmClassInfoFilter, CClassInfoFilter>(pObj){}
  64. STDMETHOD(CheckObject)(IN IHmmPropertySource* pObject,
  65. IN OUT IHmmPropertyList** ppList,
  66. IN OUT IUnknown** ppHint);
  67. STDMETHOD(IsSpecial)();
  68. STDMETHOD(GetType)(OUT IID* piid);
  69. STDMETHOD(GetSelectedPropertyList)(
  70. IN long lFlags, // necessary, sufficient
  71. OUT IHmmPropertyList** ppList);
  72. STDMETHOD(GetClassInfos)(
  73. IN long lFirstIndex,
  74. IN long lNumInfos,
  75. OUT long* plInfosReturned,
  76. OUT HMM_CLASS_INFO* aInfos);
  77. } m_XFilter;
  78. friend XFilter;
  79. class XConfigure : public CImpl<IConfigureHmmClassInfoFilter, CClassInfoFilter>
  80. {
  81. public:
  82. XConfigure(CClassInfoFilter* pObj)
  83. : CImpl<IConfigureHmmClassInfoFilter, CClassInfoFilter>(pObj){}
  84. STDMETHOD(AddClassInfos)(IN long lNumInfos, IN HMM_CLASS_INFO* aInfos);
  85. STDMETHOD(RemoveAllInfos)();
  86. } m_XConfigure;
  87. friend XConfigure;
  88. protected:
  89. CUniquePointerArray<CHmmClassInfo> m_apTokens;
  90. CContainerControl m_MemberLife;
  91. CHmmNode* m_pTree;
  92. inline void InvalidateTree() {if(m_pTree) m_pTree->Release(); m_pTree = NULL;}
  93. public:
  94. CClassInfoFilter(CLifeControl* pControl, IUnknown* pOuter)
  95. : CUnk(pControl, pOuter), m_XFilter(this), m_XConfigure(this),
  96. m_MemberLife(GetUnknown()), m_pTree(NULL)
  97. {}
  98. ~CClassInfoFilter();
  99. void* GetInterface(REFIID riid);
  100. CHmmNode* GetTree();
  101. };
  102. #endif