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.

98 lines
2.8 KiB

  1. #ifndef __CONTROL_REFRESH_CALLBACK__
  2. #define __CONTROL_REFRESH_CALLBACK__
  3. #include <webcheck.h>
  4. #include <objidl.h>
  5. #include <wininet.h>
  6. #define CALLBACK_OBJ_CLSID "{5DFE9E81-46E4-11d0-94E8-00AA0059CE02}"
  7. extern const CLSID CLSID_ControlRefreshCallback;
  8. /******************************************************************************
  9. Class factory for callback object
  10. ******************************************************************************/
  11. STDMETHODIMP CreateCallbackClassFactory(IClassFactory** ppCF);
  12. class CCallbackObjFactory : public IClassFactory
  13. {
  14. public:
  15. // constructor
  16. CCallbackObjFactory();
  17. // IUnknown Methods
  18. STDMETHODIMP QueryInterface(REFIID iid, void** ppvObject);
  19. STDMETHODIMP_(ULONG) AddRef(void);
  20. STDMETHODIMP_(ULONG) Release(void);
  21. // IClassFactory Methods
  22. STDMETHODIMP CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID* ppv);
  23. STDMETHODIMP LockServer(BOOL fLock);
  24. private:
  25. // destructor
  26. ~CCallbackObjFactory();
  27. // data members
  28. UINT m_cRef; // object refcount
  29. UINT m_cLocks; // dll lock refcount
  30. };
  31. /******************************************************************************
  32. Callback object class
  33. ******************************************************************************/
  34. class CControlRefreshCallback : public IPersistStream,
  35. public IWebCheckAdviseSink
  36. {
  37. public:
  38. // constructor
  39. CControlRefreshCallback();
  40. // passing information to this callback object
  41. STDMETHODIMP SetInfo(REFCLSID rclsidControl, LPCWSTR lpwszURL);
  42. // IUnknown Methods
  43. STDMETHODIMP QueryInterface(REFIID iid, void** ppvObject);
  44. STDMETHODIMP_(ULONG) AddRef(void);
  45. STDMETHODIMP_(ULONG) Release(void);
  46. // IPersistStream Methods
  47. STDMETHODIMP GetClassID(CLSID* pClassID);
  48. STDMETHODIMP IsDirty(void);
  49. STDMETHODIMP Load(IStream* pStm);
  50. STDMETHODIMP Save(IStream* pStm, BOOL fClearDirty);
  51. STDMETHODIMP GetSizeMax(ULARGE_INTEGER* pcbSize);
  52. // IWebCheckAdviseSink Methods
  53. STDMETHODIMP UpdateBegin(long lCookie, SCODE scReason, BSTR lpURL);
  54. STDMETHODIMP UpdateEnd(long lCookie, SCODE scReason);
  55. STDMETHODIMP UpdateProgress(long lCookie, long lCurrent, long lMax);
  56. protected:
  57. // Update flag in registry to indicate a new version of control
  58. // has arrived
  59. // HRESULT UpdateControlInCacheFlag(SCODE scReason) const;
  60. HRESULT DownloadControl() const;
  61. protected:
  62. // destructor
  63. ~CControlRefreshCallback();
  64. // ref. count
  65. UINT m_cRef;
  66. // clsid of control this callback obj deals with
  67. CLSID m_clsidCtrl;
  68. // URL of control this callback obj deals with
  69. WCHAR m_wszURL[INTERNET_MAX_URL_LENGTH];
  70. };
  71. #endif