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.

148 lines
4.1 KiB

  1. // groups.h : Declaration of the CNntpAdminGroups
  2. /////////////////////////////////////////////////////////////////////////////
  3. // Dependencies:
  4. #include "nntptype.h"
  5. #include "nntpapi.h"
  6. #include <mimeole.h>
  7. /////////////////////////////////////////////////////////////////////////////
  8. // nntpadm
  9. class CNntpAdminGroups :
  10. public INntpAdminGroups,
  11. public IPrivateUnknown,
  12. public IPrivateDispatch,
  13. public IADsExtension,
  14. public INonDelegatingUnknown,
  15. public ISupportErrorInfo,
  16. public CComObjectRoot,
  17. public CComCoClass<CNntpAdminGroups,&CLSID_CNntpAdminGroups>
  18. {
  19. public:
  20. CNntpAdminGroups();
  21. virtual ~CNntpAdminGroups();
  22. BEGIN_COM_MAP(CNntpAdminGroups)
  23. COM_INTERFACE_ENTRY(IDispatch)
  24. COM_INTERFACE_ENTRY(IADs)
  25. COM_INTERFACE_ENTRY(INntpAdminGroups)
  26. COM_INTERFACE_ENTRY(IADsExtension)
  27. COM_INTERFACE_ENTRY(IPrivateUnknown)
  28. COM_INTERFACE_ENTRY(IPrivateDispatch)
  29. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  30. END_COM_MAP()
  31. //DECLARE_NOT_AGGREGATABLE(CNntpAdminGroups)
  32. // Remove the comment from the line above if you don't want your object to
  33. // support aggregation. The default is to support it
  34. DECLARE_REGISTRY(CNntpAdminGroups, _T("Nntpadm.Groups.1"), _T("Nntpadm.Groups"), IDS_NNTPADMINGROUPS_DESC, THREADFLAGS_BOTH)
  35. // ISupportsErrorInfo
  36. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  37. //
  38. // This declares methods for the following:
  39. // IADsExtension
  40. // IUnknown
  41. // IDispatch
  42. // IPrivateUnknown
  43. // IPrivateDispatch
  44. //
  45. #define THIS_LIBID LIBID_NNTPADMLib
  46. #define THIS_IID IID_INntpAdminGroups
  47. #include "adsimp.inl"
  48. #undef THIS_LIBID
  49. #undef THIS_IID
  50. // INntpAdminGroups
  51. public:
  52. //
  53. // IADs methods:
  54. //
  55. DECLARE_IADS_METHODS()
  56. //////////////////////////////////////////////////////////////////////
  57. // Properties:
  58. //////////////////////////////////////////////////////////////////////
  59. // Which service to configure:
  60. STDMETHODIMP get_Server ( BSTR * pstrServer );
  61. STDMETHODIMP put_Server ( BSTR strServer );
  62. STDMETHODIMP get_ServiceInstance ( long * plServiceInstance );
  63. STDMETHODIMP put_ServiceInstance ( long lServiceInstance );
  64. // Enumeration Properties:
  65. STDMETHODIMP get_Count ( long * plCount );
  66. // Newsgroup Properties:
  67. STDMETHODIMP get_Newsgroup ( BSTR * pstrNewsgroup );
  68. STDMETHODIMP put_Newsgroup ( BSTR strNewsgroup );
  69. STDMETHODIMP get_Description ( BSTR * pstrDescription );
  70. STDMETHODIMP put_Description ( BSTR strDescription );
  71. STDMETHODIMP get_PrettyName ( BSTR * pstrPrettyName );
  72. STDMETHODIMP put_PrettyName ( BSTR strPrettyName );
  73. STDMETHODIMP get_IsModerated ( BOOL * pfIsModerated );
  74. STDMETHODIMP put_IsModerated ( BOOL fIsModerated );
  75. STDMETHODIMP get_Moderator ( BSTR * pstrModerator );
  76. STDMETHODIMP put_Moderator ( BSTR strModerator );
  77. STDMETHODIMP get_ReadOnly ( BOOL * pfReadOnly );
  78. STDMETHODIMP put_ReadOnly ( BOOL fReadOnly );
  79. STDMETHODIMP get_CreationTime ( DATE * pdateCreation );
  80. STDMETHODIMP put_CreationTime ( DATE dateCreation );
  81. STDMETHODIMP get_MatchingCount ( long * plCount );
  82. //////////////////////////////////////////////////////////////////////
  83. // Methods:
  84. //////////////////////////////////////////////////////////////////////
  85. STDMETHODIMP Default ( );
  86. STDMETHODIMP Add ( );
  87. STDMETHODIMP Remove ( BSTR strNewsgroup );
  88. STDMETHODIMP Get ( BSTR strNewsgroup );
  89. STDMETHODIMP Set ( );
  90. STDMETHODIMP MatchingGroup ( long iGroup, BSTR * pstrNewsgroup );
  91. STDMETHODIMP Find ( BSTR strWildmat, long cMaxResults );
  92. STDMETHODIMP CancelMessage ( BSTR strMessageID );
  93. //////////////////////////////////////////////////////////////////////
  94. // Data:
  95. //////////////////////////////////////////////////////////////////////
  96. private:
  97. CIADsImpl m_iadsImpl;
  98. CComPtr<IMimeAllocator> m_pMimeAlloc;
  99. CComPtr<IMimeInternational> m_pMimeInternational;
  100. CComBSTR m_strNewsgroup;
  101. CComBSTR m_strDescription;
  102. CComBSTR m_strPrettyName;
  103. BOOL m_fModerated;
  104. CComBSTR m_strModerator;
  105. BOOL m_fReadOnly;
  106. DATE m_dateCreation;
  107. DWORD m_cMatchingGroups;
  108. LPNNTP_FIND_LIST m_pFindList;
  109. HRESULT AllocateMimeOleObjects ( );
  110. HRESULT UnicodeToMime2 ( LPCWSTR wszUnicode, LPSTR * pszMime2 );
  111. HRESULT Mime2ToUnicode ( LPCSTR szMime2, CComBSTR & strUnicode );
  112. };