new wxHtmlWindow::OnOpeningURL API

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13854 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2002-01-27 19:03:10 +00:00
parent d2b0092bed
commit 6cc4e6b81a
10 changed files with 244 additions and 85 deletions

View File

@@ -180,14 +180,31 @@ wxObject* wxHtmlWinParser::GetProduct()
return top;
}
bool wxHtmlWinParser::CanOpenURL(const wxString& url) const
wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type,
const wxString& url) const
{
// FIXME - normalize the URL to full path before passing to
// OnOpeningURL!!
if ( m_Window )
return m_Window->OnOpeningURL(url);
{
wxString redirect;
wxString myurl(url);
wxHtmlOpeningStatus status;
for (;;)
{
if ( m_Window->OnOpeningURL(type, myurl, &redirect) == wxHTML_REDIRECT )
myurl = redirect;
else
break;
}
if ( status == wxHTML_BLOCK )
return NULL;
else
return GetFS()->OpenFile(myurl);
}
else
return TRUE;
return wxHtmlParser::OpenURL(type, url);
}
void wxHtmlWinParser::AddText(const wxChar* txt)