Removed nsIRequest methods from BrowserImplWebPrgrsLstnr.cpp, fille out history listener methods, and added in PromptService.cpp from mfcEmbed.

This commit is contained in:
depstein%netscape.com 2001-07-31 01:49:12 +00:00
parent ce553ea222
commit cbd9bf789a
4 changed files with 98 additions and 15 deletions

View File

@ -87,12 +87,27 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryGoForward(nsIURI *theUri, PRBool *notify)
NS_IMETHODIMP CBrowserImpl::OnHistoryReload(nsIURI *theUri, PRUint32 reloadFlags, PRBool *notify)
{
char flagString[100];
CQaUtils::QAOutput("nsIHistoryListener::OnHistoryReload()", 2);
CQaUtils::GetTheUri(theUri, 1);
*notify = PR_TRUE;
CQaUtils::FormatAndPrintOutput("OnHistoryReload() notification = ", *notify, 1);
if (reloadFlags == 0x0000)
strcpy(flagString, "LOAD_FLAGS_NONE");
else if (reloadFlags == 0x0100)
strcpy(flagString, "LOAD_FLAGS_BYPASS_CACHE");
else if (reloadFlags == 0x0200)
strcpy(flagString, "LOAD_FLAGS_BYPASS_PROXY");
else if (reloadFlags == 0x0400)
strcpy(flagString, "LOAD_FLAGS_CHARSET_CHANGE");
else if (reloadFlags == (0x0200 | 0x0400))
strcpy(flagString, "LOAD_RELOAD_BYPASS_PROXY_AND_CACHE");
CQaUtils::FormatAndPrintOutput("OnHistoryReload() flag = ", flagString, 2);
return NS_OK;
}
@ -104,6 +119,8 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryGotoIndex(PRInt32 theIndex, nsIURI *theUri,
*notify = PR_TRUE;
CQaUtils::FormatAndPrintOutput("OnHistoryGotoIndex() notification = ", *notify, 1);
CQaUtils::FormatAndPrintOutput("OnHistoryGotoIndex() index = ", theIndex, 2);
return NS_OK;
}
@ -114,6 +131,8 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryPurge(PRInt32 theNumEntries, PRBool *notify
*notify = PR_TRUE;
CQaUtils::FormatAndPrintOutput("OnHistoryPurge() notification = ", *notify, 1);
CQaUtils::FormatAndPrintOutput("OnHistoryGotoIndex() theNumEntries = ", theNumEntries, 2);
return NS_OK;
}

View File

@ -150,18 +150,7 @@ NS_IMETHODIMP CBrowserImpl::OnStateChange(nsIWebProgress *progress, nsIRequest *
displayMode = 1;
strcpy(theDocType, "REQUEST");
if (progressStateFlags & STATE_START)
{
strcpy(theStateType, "STATE_START");
// a few nsIRequest tests
CQaUtils::QAOutput("Some nsIRequest tests thru web prog lstnr: ");
CTests::IsPendingReqTest(request);
CTests::GetStatusReqTest(request);
CTests::SuspendReqTest(request);
CQaUtils::QAOutput("Between Suspend and Resume.");
CTests::ResumeReqTest(request);
}
else if (progressStateFlags & STATE_REDIRECTING)
strcpy(theStateType, "STATE_REDIRECTING");

View File

@ -102,7 +102,6 @@
#include "nsIHelperAppLauncherDialog.h"
//#include "nsIStreamObserver.h"
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

View File

@ -136,7 +136,18 @@ NS_IMETHODIMP CPromptService::AlertCheck(nsIDOMWindow *parent,
const PRUnichar *checkboxMsg,
PRBool *checkValue)
{
return NS_ERROR_NOT_IMPLEMENTED;
ResourceState setState;
USES_CONVERSION;
CWnd *wnd = CWndForDOMWindow(parent);
CAlertCheckDialog dlg(wnd, W2T(dialogTitle), W2T(text),
W2T(checkboxMsg), checkValue ? *checkValue : 0);
dlg.DoModal();
*checkValue = dlg.m_bCheckBoxValue;
return NS_OK;
}
NS_IMETHODIMP CPromptService::Confirm(nsIDOMWindow *parent,
@ -167,7 +178,21 @@ NS_IMETHODIMP CPromptService::ConfirmCheck(nsIDOMWindow *parent,
PRBool *checkValue,
PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
ResourceState setState;
USES_CONVERSION;
CWnd *wnd = CWndForDOMWindow(parent);
CConfirmCheckDialog dlg(wnd, W2T(dialogTitle), W2T(text),
W2T(checkboxMsg), checkValue ? *checkValue : 0,
"Yes", "No", NULL);
int iBtnClicked = dlg.DoModal();
*checkValue = dlg.m_bCheckBoxValue;
*_retval = iBtnClicked == 0 ? PR_TRUE : PR_FALSE;
return NS_OK;
}
NS_IMETHODIMP CPromptService::Prompt(nsIDOMWindow *parent,
@ -309,7 +334,58 @@ NS_IMETHODIMP CPromptService::ConfirmEx(nsIDOMWindow *parent,
PRBool *checkValue,
PRInt32 *buttonPressed)
{
return NS_ERROR_NOT_IMPLEMENTED;
ResourceState setState;
USES_CONVERSION;
// First, determine the button titles based on buttonFlags
const PRUnichar* buttonStrings[] = { button0Title, button1Title, button2Title };
CString csBtnTitles[3];
for(int i=0; i<3; i++)
{
switch(buttonFlags & 0xff) {
case BUTTON_TITLE_OK:
csBtnTitles[i] = "Ok";
break;
case BUTTON_TITLE_CANCEL:
csBtnTitles[i] = "Cancel";
break;
case BUTTON_TITLE_YES:
csBtnTitles[i] = "Yes";
break;
case BUTTON_TITLE_NO:
csBtnTitles[i] = "No";
break;
case BUTTON_TITLE_SAVE:
csBtnTitles[i] = "Save";
break;
case BUTTON_TITLE_DONT_SAVE:
csBtnTitles[i] = "DontSave";
break;
case BUTTON_TITLE_REVERT:
csBtnTitles[i] = "Revert";
break;
case BUTTON_TITLE_IS_STRING:
csBtnTitles[i] = W2T(buttonStrings[i]);
break;
}
buttonFlags >>= 8;
}
CWnd *wnd = CWndForDOMWindow(parent);
CConfirmCheckDialog dlg(wnd, W2T(dialogTitle), W2T(text),
checkMsg ? W2T(checkMsg) : NULL, checkValue ? *checkValue : 0,
csBtnTitles[0].IsEmpty() ? NULL : (LPCTSTR)csBtnTitles[0],
csBtnTitles[1].IsEmpty() ? NULL : (LPCTSTR)csBtnTitles[1],
csBtnTitles[2].IsEmpty() ? NULL : (LPCTSTR)csBtnTitles[2]);
*buttonPressed = dlg.DoModal();
if(checkValue)
*checkValue = dlg.m_bCheckBoxValue;
return NS_OK;
}
//*****************************************************************************