Hi all,
I try to capture the event when the webpage has changed by
implementing "nsIWebProgressListener". However, I could not get it to
work.
The following is my code. Anyone knows what more do I need to do in
order to start receiving events?
In my header file, I do the following:
--------------------------------------
class nsSampleImpl : public nsISample,
public nsIWebProgressListener
{
............
NS_DECL_NSIWEBPROGRESSLISTENER
}
In my cpp file, I do the following:
-----------------------------------
NS_IMPL_ISUPPORTS2_CI(nsSampleImpl, nsISample,
nsIWebProgressListener);
NS_IMETHODIMP
nsSampleImpl::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest *aRequest,
PRUint32 progressStateFlags,
nsresult aStatus)
{
NS_NOTREACHED("notification excluded in
AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsSampleImpl::OnProgressChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 aCurSelfProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in
AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsSampleImpl::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location)
{
NS_NOTREACHED("notification excluded in
AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsSampleImpl::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in
AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsSampleImpl::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRUint32 state)
{
NS_NOTREACHED("notification excluded in
AddProgressListener(...)");
return NS_OK;
}
YueWeng
_______________________________________________
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding