embedding/browser/activex/src/control/MozillaBrowser.cpp,1.66 | . | Disk File |
Skipping to line 53 | . | |
#include "nsCWebBrowser.h" |
. |
#include "nsCWebBrowser.h" |
#include "nsILocalFile.h" |
. |
#include "nsILocalFile.h" |
#include "nsISelectionController.h" |
. |
#include "nsISelectionController.h" |
#include "nsIWebBrowserPersist.h" |
. |
#include "nsIWebBrowserPersist.h" |
#include "nsIClipboardCommands.h" |
. |
#include "nsIClipboardCommands.h" |
#include "nsIProfile.h" |
. |
#include "nsIProfile.h" |
#include "nsIPrintListener.h" |
. |
  |
#include "nsIPrintOptions.h" |
. |
#include "nsIPrintOptions.h" |
#include "nsIWebBrowserPrint.h" |
. |
#include "nsIWebBrowserPrint.h" |
#include "nsIWidget.h" |
. |
#include "nsIWidget.h" |
#include "nsIWebBrowserFocus.h" |
. |
#include "nsIWebBrowserFocus.h" |
#include "nsIWindowWatcher.h" |
. |
#include "nsIWindowWatcher.h" |
Skipping to line 93 | . | |
RETURN_ERROR(c_szInvalidArg, E_INVALIDARG); |
. |
RETURN_ERROR(c_szInvalidArg, E_INVALIDARG); |
|
. |
|
#define RETURN_E_UNEXPECTED() \ |
. |
#define RETURN_E_UNEXPECTED() \ |
RETURN_ERROR(c_szUninitialized, E_UNEXPECTED); |
. |
RETURN_ERROR(c_szUninitialized, E_UNEXPECTED); |
|
. |
|
class PrintListener : public nsIPrintListener |
. |
class PrintListener : public nsIWebProgressListener |
{ |
. |
{ |
PRBool mComplete; |
. |
PRBool mComplete; |
public: |
. |
public: |
NS_DECL_ISUPPORTS |
. |
NS_DECL_ISUPPORTS |
NS_DECL_NSIPRINTLISTENER |
. |
NS_DECL_NSIWEBPROGRESSLISTENER |
|
. |
|
PrintListener(); |
. |
PrintListener(); |
virtual ~PrintListener(); |
. |
virtual ~PrintListener(); |
|
. |
|
void WaitForComplete(); |
. |
void WaitForComplete(); |
Skipping to line 1448 | . | |
nsCOMPtr<nsIDOMWindow> window; |
. |
nsCOMPtr<nsIDOMWindow> window; |
mWebBrowser->GetContentDOMWindow(getter_AddRefs(window)); |
. |
mWebBrowser->GetContentDOMWindow(getter_AddRefs(window)); |
if (window) |
. |
if (window) |
{ |
. |
{ |
PrintListener *listener = new PrintListener; |
. |
PrintListener *listener = new PrintListener; |
nsCOMPtr<nsIPrintListener> printListener = do_QueryInterface(listener)
; |
. |
nsCOMPtr<nsIWebProgressListener> printListener = do_QueryInterface(lis
tener); |
browserAsPrint->Print(window, nsnull, printListener); |
. |
browserAsPrint->Print(window, nsnull, nsnull); |
listener->WaitForComplete(); |
. |
listener->WaitForComplete(); |
} |
. |
} |
|
. |
|
if (printService) |
. |
if (printService) |
{ |
. |
{ |
Skipping to line 3249 | . | |
|
. |
|
//////////////////////////////////////////////////////////////////////////////
/ |
. |
//////////////////////////////////////////////////////////////////////////////
/ |
// PrintListener implementation |
. |
// PrintListener implementation |
|
. |
|
|
. |
|
NS_IMPL_ISUPPORTS1(PrintListener, nsIPrintListener) |
. |
NS_IMPL_ISUPPORTS1(PrintListener, nsIWebProgressListener) |
|
. |
|
PrintListener::PrintListener() : mComplete(PR_FALSE) |
. |
PrintListener::PrintListener() : mComplete(PR_FALSE) |
{ |
. |
{ |
NS_INIT_ISUPPORTS(); |
. |
NS_INIT_ISUPPORTS(); |
/* member initializers and constructor code */ |
. |
/* member initializers and constructor code */ |
Skipping to line 3298 | . | |
} |
. |
} |
|
. |
|
::CloseHandle(hFakeEvent); |
. |
::CloseHandle(hFakeEvent); |
} |
. |
} |
|
. |
|
/* void OnStartPrinting (); */
|
. |
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest,
in long aStateFlags, in unsigned long aStatus); */ |
NS_IMETHODIMP PrintListener::OnStartPrinting()
|
. |
NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRe
quest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus) |
{ |
. |
{ |
return NS_OK; |
. |
if (aStatus == nsIWebProgressListener::STATE_STOP) { |
  |
. |
mComplete = PR_TRUE; |
  |
. |
} |
  |
. |
return NS_OK; |
} |
. |
} |
|
. |
|
/* void OnProgressPrinting (in PRUint32 aProgress, in PRUint32 aProgressMax);
*/
|
. |
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aReque
st, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgr
ess, in long aMaxTotalProgress); */ |
NS_IMETHODIMP PrintListener::OnProgressPrinting(PRUint32 aProgress, PRUint32 a
ProgressMax)
|
. |
NS_IMETHODIMP PrintListener::OnProgressChange(nsIWebProgress *aWebProgress, ns
IRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt3
2 aCurTotalProgress, PRInt32 aMaxTotalProgress) |
{ |
. |
{ |
return NS_OK; |
. |
return NS_ERROR_NOT_IMPLEMENTED; |
} |
. |
} |
|
. |
|
/* void OnEndPrinting (in PRUint32 aStatus); */
|
. |
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aReque
st, in nsIURI location); */ |
NS_IMETHODIMP PrintListener::OnEndPrinting(PRUint32 aStatus)
|
. |
NS_IMETHODIMP PrintListener::OnLocationChange(nsIWebProgress *aWebProgress, ns
IRequest *aRequest, nsIURI *location) |
{ |
. |
{ |
mComplete = PR_TRUE; |
. |
return NS_ERROR_NOT_IMPLEMENTED; |
return NS_OK; |
. |
} |
  |
. |
|
 
|
. |
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest
, in nsresult aStatus, in wstring aMessage); */ |
 
|
. |
NS_IMETHODIMP PrintListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIR
equest *aRequest, nsresult aStatus, const PRUnichar *aMessage) |
  |
. |
{ |
  |
. |
return NS_ERROR_NOT_IMPLEMENTED; |
  |
. |
} |
  |
. |
|
 
|
. |
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aReque
st, in long state); */ |
 
|
. |
NS_IMETHODIMP PrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, ns
IRequest *aRequest, PRInt32 state) |
  |
. |
{ |
  |
. |
return NS_ERROR_NOT_IMPLEMENTED; |
} |
. |
} |