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.

142 lines
4.3 KiB

  1. // expire.h : Declaration of the CNntpAdminExpiration
  2. /////////////////////////////////////////////////////////////////////////////
  3. // Dependencies:
  4. #include "metafact.h"
  5. #include "expinfo.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // nntpadm
  8. class CNntpAdminExpiration :
  9. public INntpAdminExpiration,
  10. public IPrivateUnknown,
  11. public IPrivateDispatch,
  12. public IADsExtension,
  13. public INonDelegatingUnknown,
  14. public ISupportErrorInfo,
  15. public CComObjectRoot,
  16. public CComCoClass<CNntpAdminExpiration,&CLSID_CNntpAdminExpiration>
  17. {
  18. public:
  19. CNntpAdminExpiration();
  20. virtual ~CNntpAdminExpiration ();
  21. BEGIN_COM_MAP(CNntpAdminExpiration)
  22. COM_INTERFACE_ENTRY(IDispatch)
  23. COM_INTERFACE_ENTRY(IADs)
  24. COM_INTERFACE_ENTRY(INntpAdminExpiration)
  25. COM_INTERFACE_ENTRY(IADsExtension)
  26. COM_INTERFACE_ENTRY(IPrivateUnknown)
  27. COM_INTERFACE_ENTRY(IPrivateDispatch)
  28. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  29. END_COM_MAP()
  30. //DECLARE_NOT_AGGREGATABLE(CNntpAdminExpiration)
  31. // Remove the comment from the line above if you don't want your object to
  32. // support aggregation. The default is to support it
  33. DECLARE_REGISTRY(CNntpAdminExpiration, _T("Nntpadm.Expiration.1"), _T("Nntpadm.Expiration"), IDS_NNTPADMINEXPIRATION_DESC, THREADFLAGS_BOTH)
  34. // ISupportsErrorInfo
  35. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  36. //
  37. // This declares methods for the following:
  38. // IADsExtension
  39. // IUnknown
  40. // IDispatch
  41. // IPrivateUnknown
  42. // IPrivateDispatch
  43. //
  44. #define THIS_LIBID LIBID_NNTPADMLib
  45. #define THIS_IID IID_INntpAdminExpiration
  46. #include "adsimp.inl"
  47. #undef THIS_LIBID
  48. #undef THIS_IID
  49. // INntpAdminExpiration
  50. public:
  51. //
  52. // IADs methods:
  53. //
  54. DECLARE_IADS_METHODS()
  55. // Which service to configure:
  56. STDMETHODIMP get_Server ( BSTR * pstrServer );
  57. STDMETHODIMP put_Server ( BSTR strServer );
  58. STDMETHODIMP get_ServiceInstance ( long * plServiceInstance );
  59. STDMETHODIMP put_ServiceInstance ( long lServiceInstance );
  60. // Enumeration Properties:
  61. STDMETHODIMP get_Count ( long * plCount );
  62. // Cursor Feed Properties:
  63. STDMETHODIMP get_ExpireId ( long * plId );
  64. STDMETHODIMP put_ExpireId ( long lId );
  65. STDMETHODIMP get_PolicyName ( BSTR * pstrPolicyName );
  66. STDMETHODIMP put_PolicyName ( BSTR strPolicyName );
  67. STDMETHODIMP get_ExpireTime ( long * plExpireTime );
  68. STDMETHODIMP put_ExpireTime ( long lExpireTime );
  69. STDMETHODIMP get_ExpireSize ( long * plExpireSize );
  70. STDMETHODIMP put_ExpireSize ( long lExpireSize );
  71. STDMETHODIMP get_Newsgroups ( SAFEARRAY ** ppsastrNewsgroups );
  72. STDMETHODIMP put_Newsgroups ( SAFEARRAY * psastrNewsgroups );
  73. STDMETHODIMP get_NewsgroupsVariant ( SAFEARRAY ** ppsastrNewsgroups );
  74. STDMETHODIMP put_NewsgroupsVariant ( SAFEARRAY * psastrNewsgroups );
  75. //////////////////////////////////////////////////////////////////////
  76. // Methods:
  77. //////////////////////////////////////////////////////////////////////
  78. STDMETHODIMP Default ( );
  79. STDMETHODIMP Enumerate ( );
  80. STDMETHODIMP GetNth ( long lIndex );
  81. STDMETHODIMP FindID ( long lID, long * plIndex );
  82. STDMETHODIMP Add ( );
  83. STDMETHODIMP Set ( );
  84. STDMETHODIMP Remove ( long lID);
  85. //////////////////////////////////////////////////////////////////////
  86. // Data:
  87. //////////////////////////////////////////////////////////////////////
  88. private:
  89. CIADsImpl m_iadsImpl;
  90. BOOL m_fEnumerated;
  91. DWORD m_cCount;
  92. CExpirationPolicy * m_rgExpires;
  93. // The current expiration policy. All properties manipulate this policy:
  94. CExpirationPolicy m_expireCurrent;
  95. DWORD m_bvChangedFields;
  96. //////////////////////////////////////////////////////////////////////
  97. // Private Methods:
  98. //////////////////////////////////////////////////////////////////////
  99. long IndexFromID ( long dwExpireId );
  100. /*
  101. HRESULT EnumerateMetabaseExpirationPolicies ( IMSAdminBase * pMetabase);
  102. HRESULT AddPolicyToMetabase ( IMSAdminBase * pMetabase);
  103. HRESULT AddPolicyToArray ( );
  104. HRESULT SetPolicyToMetabase ( IMSAdminBase * pMetabase);
  105. HRESULT SetPolicyToArray ( );
  106. HRESULT RemovePolicyFromMetabase ( IMSAdminBase * pMetabase, DWORD index);
  107. HRESULT RemovePolicyFromArray ( DWORD index );
  108. DWORD IndexFromID ( DWORD dwID );
  109. */
  110. };