1
0

webinfo_obj.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef NULLSOFT_MLDISC_MINIINFO_HEADER
  2. #define NULLSOFT_MLDISC_MINIINFO_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "../nu/HTMLContainer2.h"
  7. #define HOMEPAGE_NOTLOADED 0x00
  8. #define HOMEPAGE_LOADING 0x01
  9. #define HOMEPAGE_FAILED 0x02
  10. #define HOMEPAGE_LOADED 0x03
  11. class WebFileInfo;
  12. WebFileInfo* CreateWebFileInfo(HWND hwndParent, IDispatch *pDispWA);
  13. class WebFileInfo : public HTMLContainer2, public IDropTarget
  14. {
  15. protected:
  16. WebFileInfo(HWND hwndParent, IDispatch *pDispWA);
  17. ~WebFileInfo(void);
  18. public:
  19. HRESULT InvokeFileInfo(LPCWSTR pszFileName);
  20. HRESULT NavigateToPage(void);
  21. HRESULT DisplayMessage(LPCWSTR pszMessage, BOOL bPostIt);
  22. HRESULT UpdateColors(void);
  23. // IUnknown
  24. STDMETHOD(QueryInterface)(REFIID riid, PVOID *ppvObject);
  25. STDMETHOD_(ULONG, AddRef)(void);
  26. STDMETHOD_(ULONG, Release)(void);
  27. // IDropTarget
  28. STDMETHOD (DragEnter)(IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect);
  29. STDMETHOD (DragOver)(DWORD grfKeyState, POINTL pt, DWORD * pdwEffect);
  30. STDMETHOD (DragLeave)(void);
  31. STDMETHOD (Drop)(IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect);
  32. STDMETHOD (GetDropTarget)(IDropTarget __RPC_FAR *pDropTarget, IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget);
  33. protected:
  34. STDMETHOD (GetExternal)(IDispatch __RPC_FAR *__RPC_FAR *ppDispatch);
  35. STDMETHOD (ShowContextMenu)(DWORD dwID, POINT __RPC_FAR *ppt, IUnknown __RPC_FAR *pcmdtReserved, IDispatch __RPC_FAR *pdispReserved);
  36. STDMETHOD (ShowMessage)(HWND hwnd, LPOLESTR lpstrText, LPOLESTR lpstrCaption, DWORD dwType, LPOLESTR lpstrHelpFile, DWORD dwHelpContext, LRESULT *plResult);
  37. STDMETHOD (TranslateAccelerator)(LPMSG lpMsg, const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID);
  38. virtual void OnBeforeNavigate(IDispatch *pDispatch, VARIANT *URL, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, VARIANT_BOOL *Cancel);
  39. virtual void OnNewWindow3(IDispatch **ppDisp, VARIANT_BOOL *Cancel, DWORD dwFlags, BSTR bstrUrlContext, BSTR bstrUrl);
  40. virtual void OnNavigateError(IDispatch *pDispatch, VARIANT *URL, VARIANT *TargetFrameName, VARIANT *StatusCode, VARIANT_BOOL *Cancel);
  41. virtual void OnDocumentReady(IDispatch *pDispatch, VARIANT *URL);
  42. virtual COLORREF OnGetHostBkColor(void);
  43. virtual DWORD OnGetHostInfoFlags(void);
  44. virtual OLECHAR* OnGetHostCSS(void);
  45. virtual DWORD OnGetDownlodFlags(void);
  46. virtual LPCWSTR OnGetUserAgent(void);
  47. virtual DWORD GetContainerStyle(void);
  48. protected:
  49. IDispatch *pDispWA;
  50. BSTR bstrMessage;
  51. BSTR bstrFileName;
  52. INT nHomePage;
  53. INT nDragMode;
  54. private:
  55. friend WebFileInfo *CreateWebFileInfo(HWND hwndParent, IDispatch *pDispWA);
  56. };
  57. #endif //NULLSOFT_MLDISC_MINIINFO_HEADER