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.

116 lines
3.4 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 2000
  4. *
  5. * TITLE: POSTPLUG.H
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ShaunIv
  10. *
  11. * DATE: 4/11/2000
  12. *
  13. * DESCRIPTION:
  14. *
  15. *******************************************************************************/
  16. #ifndef __POSTPLUG_H_INCLUDED
  17. #define __POSTPLUG_H_INCLUDED
  18. #include <windows.h>
  19. #include <atlbase.h>
  20. #include <objbase.h>
  21. #include "itranspl.h"
  22. #include "progressinfo.h"
  23. #include "httpfilepost.h"
  24. class CHttpPostPlugin : public IImageTransferPlugin
  25. {
  26. private:
  27. class CCommunityInfo
  28. {
  29. private:
  30. CSimpleString m_strCommunityId;
  31. CSimpleString m_strCommunityName;
  32. public:
  33. CCommunityInfo(void)
  34. {
  35. }
  36. CCommunityInfo( const CCommunityInfo &other )
  37. : m_strCommunityId(other.CommunityId()),
  38. m_strCommunityName(other.CommunityName())
  39. {
  40. }
  41. CCommunityInfo( const CSimpleString &strCommunityId, const CSimpleString &strCommunityName )
  42. : m_strCommunityId(strCommunityId),
  43. m_strCommunityName(strCommunityName)
  44. {
  45. }
  46. ~CCommunityInfo(void)
  47. {
  48. }
  49. CCommunityInfo &operator=( const CCommunityInfo &other )
  50. {
  51. if (&other != this)
  52. {
  53. m_strCommunityId = other.CommunityId();
  54. m_strCommunityName = other.CommunityName();
  55. }
  56. return *this;
  57. }
  58. CSimpleString CommunityId(void) const
  59. {
  60. return m_strCommunityId;
  61. }
  62. CSimpleString CommunityName(void) const
  63. {
  64. return m_strCommunityName;
  65. }
  66. void CommunityId( const CSimpleString &strCommunityId )
  67. {
  68. m_strCommunityId = strCommunityId;
  69. }
  70. void CommunityName( const CSimpleString &strCommunityName )
  71. {
  72. m_strCommunityName = strCommunityName;
  73. }
  74. };
  75. private:
  76. LONG m_cRef;
  77. IImageTransferPluginProgressCallback *m_pImageTransferPluginProgressCallback;
  78. LONG m_nCurrentPluginId;
  79. CHttpFilePoster m_HttpFilePoster;
  80. CSimpleDynamicArray<CCommunityInfo> m_CommunityInfoArray;
  81. static bool EnumCommunitiesProc( CSimpleReg::CValueEnumInfo &enumInfo );
  82. static UINT ProgressProc( CProgressInfo *pProgressInfo );
  83. public:
  84. ~CHttpPostPlugin(void);
  85. CHttpPostPlugin(void);
  86. //
  87. // IUnknown
  88. //
  89. STDMETHODIMP QueryInterface( REFIID riid, LPVOID *ppvObject );
  90. STDMETHODIMP_(ULONG) AddRef(void);
  91. STDMETHODIMP_(ULONG) Release(void);
  92. //
  93. // IImageTransferPlugin
  94. //
  95. STDMETHODIMP GetPluginCount( ULONG *pnCount );
  96. STDMETHODIMP GetPluginName( ULONG nPluginId, BSTR *pbstrName );
  97. STDMETHODIMP GetPluginDescription( ULONG nPluginId, BSTR *pbstrDescription );
  98. STDMETHODIMP GetPluginIcon( ULONG nPluginId, HICON *phIcon, int nWidth, int nHeight );
  99. STDMETHODIMP OpenConnection( HWND hwndParent, ULONG nPluginId, IImageTransferPluginProgressCallback *pImageTransferPluginProgressCallback );
  100. STDMETHODIMP AddFile( BSTR bstrFilename, BSTR bstrDescription, const GUID &guidImageFormat, BOOL bDelete );
  101. STDMETHODIMP TransferFiles( BSTR bstrGlobalDescription );
  102. STDMETHODIMP OpenDestination(void);
  103. STDMETHODIMP CloseConnection(void);
  104. };
  105. #endif //__POSTPLUG_H_INCLUDED