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.

115 lines
2.8 KiB

  1. #ifndef _HSMRULE_
  2. #define _HSMRULE_
  3. /*++
  4. 1998 Seagate Software, Inc. All rights reserved.
  5. Module Name:
  6. hsmrule.cpp
  7. Abstract:
  8. This component represents a rule for a job's policy.
  9. Author:
  10. Chuck Bardeen [cbardeen] 29-Oct-1996
  11. Revision History:
  12. --*/
  13. #include "resource.h" // main symbols
  14. #include "wsb.h"
  15. /*++
  16. Class Name:
  17. CHsmRule
  18. Class Description:
  19. This component represents a rule for a job's policy.
  20. --*/
  21. class CHsmRule :
  22. public IHsmRule,
  23. public CWsbObject,
  24. public CComCoClass<CHsmRule,&CLSID_CHsmRule>
  25. {
  26. public:
  27. CHsmRule() {}
  28. BEGIN_COM_MAP(CHsmRule)
  29. COM_INTERFACE_ENTRY(IHsmRule)
  30. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  31. COM_INTERFACE_ENTRY(IPersistStream)
  32. COM_INTERFACE_ENTRY(IWsbCollectable)
  33. COM_INTERFACE_ENTRY(IWsbTestable)
  34. END_COM_MAP()
  35. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmRule)
  36. // CComObjectRoot
  37. public:
  38. STDMETHOD(FinalConstruct)(void);
  39. // IPersist
  40. public:
  41. STDMETHOD(GetClassID)(LPCLSID pClsid);
  42. // IPersistStream
  43. public:
  44. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  45. STDMETHOD(Load)(IStream* pStream);
  46. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  47. // IWsbCollectable
  48. public:
  49. STDMETHOD(CompareTo)(IUnknown* pUnknown, SHORT* pResult);
  50. // IWsbTestable
  51. STDMETHOD(Test)(USHORT *passed, USHORT* failed);
  52. // CHsmRule
  53. STDMETHOD(DoesNameContainWildcards)(OLECHAR* name);
  54. STDMETHOD(IsNameInExpression)(OLECHAR* expression, OLECHAR* name, BOOL ignoreCase);
  55. STDMETHOD(IsNameInExpressionGuts)(OLECHAR* expression, USHORT expresionLength, OLECHAR* name, USHORT nameLength, BOOL ignoreCase);
  56. STDMETHOD(NameToSearchName)(void);
  57. // IHsmRule
  58. public:
  59. STDMETHOD(CompareToIRule)(IHsmRule* pRule, SHORT* pResult);
  60. STDMETHOD(CompareToPathAndName)(OLECHAR* path, OLECHAR* name, SHORT* pResult);
  61. STDMETHOD(Criteria)(IWsbCollection** ppWsbCollection);
  62. STDMETHOD(EnumCriteria)(IWsbEnum** ppEnum);
  63. STDMETHOD(GetName)(OLECHAR** pName, ULONG bufferSize);
  64. STDMETHOD(GetSearchName)(OLECHAR** pName, ULONG bufferSize);
  65. STDMETHOD(GetPath)(OLECHAR** pPath, ULONG bufferSize);
  66. STDMETHOD(IsInclude)(void);
  67. STDMETHOD(IsUsedInSubDirs)(void);
  68. STDMETHOD(IsUserDefined)(void);
  69. STDMETHOD(MatchesName)(OLECHAR* name);
  70. STDMETHOD(SetIsInclude)(BOOL isIncluded);
  71. STDMETHOD(SetIsUsedInSubDirs)(BOOL isUsed);
  72. STDMETHOD(SetIsUserDefined)(BOOL isUserDefined);
  73. STDMETHOD(SetName)(OLECHAR* name);
  74. STDMETHOD(SetPath)(OLECHAR* path);
  75. protected:
  76. CWsbStringPtr m_name;
  77. CWsbStringPtr m_searchName;
  78. CWsbStringPtr m_path;
  79. BOOL m_isInclude;
  80. BOOL m_isUserDefined;
  81. BOOL m_isUsedInSubDirs;
  82. CComPtr<IWsbCollection> m_pCriteria;
  83. };
  84. #endif // _HSMRULE_