]> git.saurik.com Git - wxWidgets.git/blame - wxPython/contrib/iewin/IEHtmlWin.h
Using Carbon Calls for getting highlight color
[wxWidgets.git] / wxPython / contrib / iewin / IEHtmlWin.h
CommitLineData
c731eb47
RD
1#ifndef _IEHTMLWIN_H_
2#define _IEHTMLWIN_H_
3#pragma warning( disable : 4101 4786)
4#pragma warning( disable : 4786)
5
6
7#include <wx/setup.h>
8#include <wx/wx.h>
9#include <exdisp.h>
10#include <iostream>
11using namespace std;
12
13#include "wxactivex.h"
14
15class wxMSHTMLEvent : public wxNotifyEvent
16{
17public:
83a73288
RD
18 wxMSHTMLEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
19 : wxNotifyEvent(commandType, id)
20 {}
21
22 wxString GetText1() { return m_text1; }
23 long GetLong1() { return m_long1; }
24 long GetLong2() { return m_long2; }
c731eb47 25
c731eb47
RD
26
27 wxString m_text1;
28 long m_long1, m_long2;
29
30 virtual wxEvent *Clone() const { return new wxMSHTMLEvent(*this); }
31
32private:
83a73288
RD
33 DECLARE_DYNAMIC_CLASS(wxMSHTMLEvent)
34
c731eb47
RD
35};
36
37BEGIN_DECLARE_EVENT_TYPES()
38 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, 0)
39 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_NEWWINDOW2, 0)
40 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, 0)
41 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, 0)
42 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, 0)
43 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_TITLECHANGE, 0)
44END_DECLARE_EVENT_TYPES()
45
46typedef void (wxEvtHandler::*wxMSHTMLEventFunction)(wxMSHTMLEvent&);
47
3a818b15
VZ
48#define EVT_MSHTML_BEFORENAVIGATE2(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
49#define EVT_MSHTML_NEWWINDOW2(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_NEWWINDOW2, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
50#define EVT_MSHTML_DOCUMENTCOMPLETE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
51#define EVT_MSHTML_PROGRESSCHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
52#define EVT_MSHTML_STATUSTEXTCHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
53#define EVT_MSHTML_TITLECHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_TITLECHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxMSHTMLEventFunction, & fn ), NULL ),
c731eb47
RD
54
55
83a73288
RD
56enum wxIEHtmlRefreshLevel
57{
58 wxIEHTML_REFRESH_NORMAL = 0,
59 wxIEHTML_REFRESH_IFEXPIRED = 1,
60 wxIEHTML_REFRESH_CONTINUE = 2,
61 wxIEHTML_REFRESH_COMPLETELY = 3
c731eb47
RD
62};
63
d3b55102
RD
64class IStreamAdaptorBase;
65
c731eb47
RD
66class wxIEHtmlWin : public wxActiveX
67{
d3b55102 68
c731eb47 69public:
d7abf017 70 wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1,
83a73288
RD
71 const wxPoint& pos = wxDefaultPosition,
72 const wxSize& size = wxDefaultSize,
73 long style = 0,
74 const wxString& name = wxPanelNameStr);
75 virtual ~wxIEHtmlWin();
c731eb47 76
83a73288 77 void LoadUrl(const wxString&);
c731eb47
RD
78 bool LoadString(wxString html);
79 bool LoadStream(istream *strm);
d3b55102 80 bool LoadStream(wxInputStream *is);
c731eb47 81
83a73288 82 void SetCharset(wxString charset);
c731eb47
RD
83 void SetEditMode(bool seton);
84 bool GetEditMode();
85 wxString GetStringSelection(bool asHTML = false);
83a73288 86 wxString GetText(bool asHTML = false);
c731eb47 87
83a73288
RD
88 bool GoBack();
89 bool GoForward();
90 bool GoHome();
91 bool GoSearch();
92 bool Refresh(wxIEHtmlRefreshLevel level);
93 bool Stop();
c731eb47 94
83a73288 95 DECLARE_EVENT_TABLE();
c731eb47
RD
96
97protected:
98 void SetupBrowser();
d3b55102 99 bool LoadStream(IStreamAdaptorBase *pstrm);
c731eb47
RD
100
101 wxAutoOleInterface<IWebBrowser2> m_webBrowser;
102};
103
104#endif /* _IEHTMLWIN_H_ */