2002-07-03 18:05:30 -04:00
|
|
|
#ifndef _IEHTMLWIN_H_
|
|
|
|
#define _IEHTMLWIN_H_
|
|
|
|
#pragma warning( disable : 4101 4786)
|
|
|
|
#pragma warning( disable : 4786)
|
|
|
|
|
|
|
|
|
|
|
|
#include <wx/setup.h>
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#include <exdisp.h>
|
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#include "wxactivex.h"
|
|
|
|
|
|
|
|
class wxMSHTMLEvent : public wxNotifyEvent
|
|
|
|
{
|
|
|
|
public:
|
2002-07-11 13:43:34 -04:00
|
|
|
wxMSHTMLEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
|
|
|
|
: wxNotifyEvent(commandType, id)
|
|
|
|
{}
|
|
|
|
|
|
|
|
wxString GetText1() { return m_text1; }
|
|
|
|
long GetLong1() { return m_long1; }
|
|
|
|
long GetLong2() { return m_long2; }
|
2002-07-03 18:05:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
wxString m_text1;
|
|
|
|
long m_long1, m_long2;
|
|
|
|
|
|
|
|
virtual wxEvent *Clone() const { return new wxMSHTMLEvent(*this); }
|
|
|
|
|
|
|
|
private:
|
2002-07-11 13:43:34 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMSHTMLEvent)
|
|
|
|
|
2002-07-03 18:05:30 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
BEGIN_DECLARE_EVENT_TYPES()
|
|
|
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, 0)
|
|
|
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_NEWWINDOW2, 0)
|
|
|
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, 0)
|
|
|
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, 0)
|
|
|
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, 0)
|
|
|
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_TITLECHANGE, 0)
|
|
|
|
END_DECLARE_EVENT_TYPES()
|
|
|
|
|
|
|
|
typedef void (wxEvtHandler::*wxMSHTMLEventFunction)(wxMSHTMLEvent&);
|
|
|
|
|
2004-02-10 17:15:19 -05:00
|
|
|
#define EVT_MSHTML_BEFORENAVIGATE2(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
|
|
|
|
#define EVT_MSHTML_NEWWINDOW2(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_NEWWINDOW2, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
|
|
|
|
#define EVT_MSHTML_DOCUMENTCOMPLETE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
|
|
|
|
#define EVT_MSHTML_PROGRESSCHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
|
|
|
|
#define EVT_MSHTML_STATUSTEXTCHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
|
|
|
|
#define EVT_MSHTML_TITLECHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_TITLECHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
|
2002-07-03 18:05:30 -04:00
|
|
|
|
|
|
|
|
2002-07-11 13:43:34 -04:00
|
|
|
enum wxIEHtmlRefreshLevel
|
|
|
|
{
|
|
|
|
wxIEHTML_REFRESH_NORMAL = 0,
|
|
|
|
wxIEHTML_REFRESH_IFEXPIRED = 1,
|
|
|
|
wxIEHTML_REFRESH_CONTINUE = 2,
|
|
|
|
wxIEHTML_REFRESH_COMPLETELY = 3
|
2002-07-03 18:05:30 -04:00
|
|
|
};
|
|
|
|
|
2002-07-19 20:06:59 -04:00
|
|
|
class IStreamAdaptorBase;
|
|
|
|
|
2002-07-03 18:05:30 -04:00
|
|
|
class wxIEHtmlWin : public wxActiveX
|
|
|
|
{
|
2002-07-19 20:06:59 -04:00
|
|
|
|
2002-07-03 18:05:30 -04:00
|
|
|
public:
|
2002-07-05 20:42:51 -04:00
|
|
|
wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1,
|
2002-07-11 13:43:34 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxPanelNameStr);
|
|
|
|
virtual ~wxIEHtmlWin();
|
2002-07-03 18:05:30 -04:00
|
|
|
|
2002-07-11 13:43:34 -04:00
|
|
|
void LoadUrl(const wxString&);
|
2002-07-03 18:05:30 -04:00
|
|
|
bool LoadString(wxString html);
|
|
|
|
bool LoadStream(istream *strm);
|
2002-07-19 20:06:59 -04:00
|
|
|
bool LoadStream(wxInputStream *is);
|
2002-07-03 18:05:30 -04:00
|
|
|
|
2002-07-11 13:43:34 -04:00
|
|
|
void SetCharset(wxString charset);
|
2002-07-03 18:05:30 -04:00
|
|
|
void SetEditMode(bool seton);
|
|
|
|
bool GetEditMode();
|
|
|
|
wxString GetStringSelection(bool asHTML = false);
|
2002-07-11 13:43:34 -04:00
|
|
|
wxString GetText(bool asHTML = false);
|
2002-07-03 18:05:30 -04:00
|
|
|
|
2002-07-11 13:43:34 -04:00
|
|
|
bool GoBack();
|
|
|
|
bool GoForward();
|
|
|
|
bool GoHome();
|
|
|
|
bool GoSearch();
|
|
|
|
bool Refresh(wxIEHtmlRefreshLevel level);
|
|
|
|
bool Stop();
|
2002-07-03 18:05:30 -04:00
|
|
|
|
2002-07-11 13:43:34 -04:00
|
|
|
DECLARE_EVENT_TABLE();
|
2002-07-03 18:05:30 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void SetupBrowser();
|
2002-07-19 20:06:59 -04:00
|
|
|
bool LoadStream(IStreamAdaptorBase *pstrm);
|
2002-07-03 18:05:30 -04:00
|
|
|
|
|
|
|
wxAutoOleInterface<IWebBrowser2> m_webBrowser;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _IEHTMLWIN_H_ */
|