Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cOleWebBase.h
Go to the documentation of this file.
1 //
4 //
5 #ifndef _INC_cOleWebBase_H
6 #define _INC_cOleWebBase_H
7 #ifndef NO_PRAGMA_ONCE
8 #pragma once
9 #endif
10 #include "cOleControl.h"
11 
12 #if defined(_WIN32) && defined(_MSC_VER)
13 struct IWebBrowser2;
14 struct IHTMLDocument2;
15 
16 namespace GrayLib
17 {
18  class cOleWebHelper;
19 
20  struct IOleWebListener
21  {
25 
26  enum WEBEVENT_TYPE
27  {
30 
31  WEBEVENT_UNK = 0,
32  WEBEVENT_DocumentComplete,
33  WEBEVENT_NewWindow3,
34  WEBEVENT_EnableCommand,
35  WEBEVENT_Progress,
36  WEBEVENT_Status,
37  };
38 
39  virtual HRESULT onWebEvent(INT_PTR nChildId, WEBEVENT_TYPE eEvent, BSTR theParam, int x, int y)
40  {
41  UNREFERENCED_PARAMETER(nChildId);
42  UNREFERENCED_PARAMETER(eEvent);
43  UNREFERENCED_PARAMETER(theParam);
46  return S_FALSE;
47  }
48 
49 #if 0
50  virtual void STDMETHODCALLTYPE OnReadyStateChange(long newState); // dispIdMember = 0xfffffd9f = DISPID_READYSTATECHANGE
51  virtual void STDMETHODCALLTYPE OnProgress(long percentDone); // dispIdMember = 0x7a6
52 #endif
53  };
54 
55  class GRAYLIB_LINK cOleWebBase
56  : public cOleControl
57  {
62 
63  friend class cOleWebHelper;
64  typedef cOleControl SUPER_t;
65 
66  protected:
67  IOleWebListener* m_pWebListener;
68  protected:
69  cRefPtr<cOleWebHelper> m_pWebHelper;
70  public:
71  cIUnkPtr<IWebBrowser2> m_pWebBrowser;
72 
73  protected:
74  cOleWebBase(INT_PTR nChildId, IOleWebListener* pAtlListener, cOleWebBrowserRedir* pBrowserRedir);
75  virtual ~cOleWebBase();
76 
77  public:
78  virtual bool isDisposed() const override
79  {
80  return m_pWebListener == nullptr;
81  }
82  virtual void DisposeThis() override;
83 
84  virtual tagREADYSTATE get_ReadyState() const override;
85 
86  // GoHome
87  // Refresh
88 
89  HRESULT GoNavigate(const char* pszFullPath);
90  HRESULT GoBack();
91  HRESULT GoForward();
92  HRESULT Stop();
93 
94  HRESULT GetScroll(long* sx, long* sy);
95  HRESULT SetScroll(long sx, long sy);
96 
97  virtual HRESULT WaitForLoadComplete(TIMESYSD_t tWait, bool bMsgLoop) = 0;
98 
99  virtual LRESULT OnWindowMessage1(MSG& msg) override;
100 
101 #ifdef USE_DX9
102  virtual HRESULT DrawControl(IDirect3DSurface9* pSurface) override;
103 #endif
104 
105  virtual void OnMouseMove(MBUTTON_TYPE button, const POINT& pt) override;
106 
107  HRESULT SetDocumentHTML(const GChar_t* pszHTML);
108  };
109 
110 }
111 
112 #endif
113 #endif
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define UNREFERENCED_PARAMETER(P)
< _WIN32 type thing. get rid of stupid warning.
Definition: SysTypes.h:299
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cMesh.h:22
MBUTTON_TYPE
Definition: cInputBase.h:40
INT32 TIMESYSD_t
Time delta. signed milli-Seconds Span. cTimeSys::k_DMAX, cTimeSys::k_INF = MAILSLOT_WAIT_FOREVER.
Definition: cTimeSys.h:28
char GChar_t
My version of TCHAR, _TCHAR.
Definition: StrConst.h:26