// Purpose: wxMSW wxWebViewIE class implementation for web view component
// Author: Marianne Gagnon
// Id: $Id$
-// Copyright: (c) 2010 Marianne Gagnon, Steven Lamerton
+// Copyright: (c) 2010 Marianne Gagnon, 2011 Steven Lamerton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/msw/missing.h"
#include "wx/filesys.h"
+wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewIE, wxWebView);
+
//We link to urlmon as it is required for CoInternetGetSession
#pragma comment(lib, "urlmon")
document->Release();
}
-void wxWebViewIE::RegisterProtocol(wxWebProtocolHandler* handler)
+void wxWebViewIE::RegisterHandler(wxSharedPtr<wxWebHandler> handler)
{
ClassFactory* cf = new ClassFactory(handler);
IInternetSession* session;
wxFAIL_MSG("Could not retrive internet session");
}
- HRESULT hr = session->RegisterNameSpace(cf, CLSID_FileProtocol, handler->GetProtocol(), 0, NULL, 0);
+ HRESULT hr = session->RegisterNameSpace(cf, CLSID_FileProtocol, handler->GetName(), 0, NULL, 0);
if(FAILED(hr))
{
wxFAIL_MSG("Could not register protocol");
case DISPID_TITLECHANGE:
{
+ wxString title = evt[0].GetString();
+
+ wxWebNavigationEvent event(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED,
+ GetId(), GetCurrentURL(), wxEmptyString, true);
+ event.SetString(title);
+ event.SetEventObject(this);
+ HandleWindowEvent(event);
break;
}
evt.Skip();
}
-VirtualProtocol::VirtualProtocol(wxWebProtocolHandler *handler)
+VirtualProtocol::VirtualProtocol(wxSharedPtr<wxWebHandler> handler)
{
m_refCount = 0;
m_file = NULL;
AddRef();
return S_OK;
}
- else if(riid == IID_IInternetProtocolInfo)
- {
- *ppvObject = (IInternetProtocolInfo*)this;
- AddRef();
- return S_OK;
- }
else
{
*ppvObject = NULL;
}
}
-HRESULT VirtualProtocol::CombineUrl(LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl,
- DWORD dwCombineFlags, LPWSTR pwzResult,
- DWORD cchResult, DWORD *pcchResult,
- DWORD dwReserved)
-{
- return INET_E_DEFAULT_ACTION;
-}
-
-HRESULT VirtualProtocol::ParseUrl(LPCWSTR pwzUrl, PARSEACTION ParseAction,
- DWORD dwParseFlags, LPWSTR pwzResult,
- DWORD cchResult, DWORD *pcchResult,
- DWORD dwReserved)
-{
- //return INET_E_DEFAULT_ACTION;
- wcscpy(pwzResult, pwzUrl);
- *pcchResult = wcslen(pwzResult);
- return S_OK;
-}
-
-HRESULT VirtualProtocol::QueryInfo(LPCWSTR pwzUrl, QUERYOPTION OueryOption,
- DWORD dwQueryFlags, LPVOID pBuffer,
- DWORD cbBuffer, DWORD *pcbBuf,
- DWORD dwReserved)
-{
- return INET_E_DEFAULT_ACTION;
-}
-
HRESULT ClassFactory::CreateInstance(IUnknown* pUnkOuter, REFIID riid,
void ** ppvObject)
{