From bb8cdfecb1b8c890f6fb7d25175386e113f92c6f Mon Sep 17 00:00:00 2001 From: "rhp%netscape.com" Date: Wed, 15 Mar 2000 01:47:36 +0000 Subject: [PATCH] Changes to fix many bugs including quoting style size - vcard I18N fixes - compose fixes - etc - Bug #: 12505 25610 29806 30048 30744 31207 31589 git-svn-id: svn://10.0.0.236/trunk@62973 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDocumentViewer.cpp | 20 ++- mozilla/layout/base/nsDocumentViewer.cpp | 20 ++- mozilla/layout/base/public/Makefile.in | 1 + mozilla/layout/base/public/makefile.win | 1 + mozilla/layout/base/src/nsDocumentViewer.cpp | 20 ++- mozilla/layout/base/src/nsPluginViewer.cpp | 2 +- .../base/resources/content/messenger.xul | 6 +- .../base/resources/content/msgPrintEngine.js | 1 - .../base/resources/content/msgPrintEngine.xul | 6 +- .../locale/en-US/messenger.properties | 6 +- mozilla/mailnews/base/src/nsMessenger.cpp | 6 +- .../mailnews/base/src/nsMsgPrintEngine.cpp | 146 +++++++++++++++--- mozilla/mailnews/base/src/nsMsgPrintEngine.h | 15 +- .../plugin/base/src/nsPluginViewer.cpp | 2 +- .../modules/plugin/nglsrc/nsPluginViewer.cpp | 2 +- .../webshell/public/nsIContentViewerFile.h | 7 +- 16 files changed, 209 insertions(+), 52 deletions(-) diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index 1e5b3ba45c6..a514c04d9c7 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -241,6 +241,8 @@ protected: nsIView *mPrintView; FILE *mFilePointer; // a file where information can go to when printing + nsCOMPtr mPrintListener; // An observer for printing... + // document management data // these items are specific to markup documents (html and xml) // may consider splitting these out into a subclass @@ -280,7 +282,7 @@ DocumentViewerImpl::DocumentViewerImpl() NS_INIT_REFCNT(); mEnableRendering = PR_TRUE; mFilePointer = nsnull; - + mPrintListener = nsnull; } DocumentViewerImpl::DocumentViewerImpl(nsIPresContext* aPresContext) @@ -373,6 +375,7 @@ DocumentViewerImpl::~DocumentViewerImpl() // Break circular reference (or something) mPresShell->EndObservingDocument(); } + } /* @@ -1010,6 +1013,9 @@ void DocumentViewerImpl::DocumentReadyForPrinting() mIsPrinting = PR_FALSE; mPrintPS->EndObservingDocument(); + + if (mPrintListener) + mPrintListener->OnEndPrinting(NS_OK); NS_RELEASE(mPrintPS); NS_RELEASE(mPrintVM); @@ -1162,7 +1168,7 @@ static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTOR * @update 01/24/00 dwc */ NS_IMETHODIMP -DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile) +DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener) { nsCOMPtr webContainer; nsCOMPtr factory; @@ -1292,6 +1298,14 @@ PRInt32 width,height; printf(" DeviceDimension w = %d h = %d\n",i1,i2); #endif + // Print listener setup... + if (aPrintListener) + { + mPrintListener = aPrintListener; + mPrintListener->OnStartPrinting(); + /* RICHIE mPrintListener->OnProgressPrinting(PRUint32 aProgress, PRUint32 aProgressMax); */ + } + // // The mIsPrinting flag is set when the ImageGroup observer is // notified that images must be loaded as a result of the @@ -1309,7 +1323,7 @@ PRInt32 width,height; #endif } } - } + } } } return NS_OK; diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 1e5b3ba45c6..a514c04d9c7 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -241,6 +241,8 @@ protected: nsIView *mPrintView; FILE *mFilePointer; // a file where information can go to when printing + nsCOMPtr mPrintListener; // An observer for printing... + // document management data // these items are specific to markup documents (html and xml) // may consider splitting these out into a subclass @@ -280,7 +282,7 @@ DocumentViewerImpl::DocumentViewerImpl() NS_INIT_REFCNT(); mEnableRendering = PR_TRUE; mFilePointer = nsnull; - + mPrintListener = nsnull; } DocumentViewerImpl::DocumentViewerImpl(nsIPresContext* aPresContext) @@ -373,6 +375,7 @@ DocumentViewerImpl::~DocumentViewerImpl() // Break circular reference (or something) mPresShell->EndObservingDocument(); } + } /* @@ -1010,6 +1013,9 @@ void DocumentViewerImpl::DocumentReadyForPrinting() mIsPrinting = PR_FALSE; mPrintPS->EndObservingDocument(); + + if (mPrintListener) + mPrintListener->OnEndPrinting(NS_OK); NS_RELEASE(mPrintPS); NS_RELEASE(mPrintVM); @@ -1162,7 +1168,7 @@ static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTOR * @update 01/24/00 dwc */ NS_IMETHODIMP -DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile) +DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener) { nsCOMPtr webContainer; nsCOMPtr factory; @@ -1292,6 +1298,14 @@ PRInt32 width,height; printf(" DeviceDimension w = %d h = %d\n",i1,i2); #endif + // Print listener setup... + if (aPrintListener) + { + mPrintListener = aPrintListener; + mPrintListener->OnStartPrinting(); + /* RICHIE mPrintListener->OnProgressPrinting(PRUint32 aProgress, PRUint32 aProgressMax); */ + } + // // The mIsPrinting flag is set when the ImageGroup observer is // notified that images must be loaded as a result of the @@ -1309,7 +1323,7 @@ PRInt32 width,height; #endif } } - } + } } } return NS_OK; diff --git a/mozilla/layout/base/public/Makefile.in b/mozilla/layout/base/public/Makefile.in index 03914bfb771..1ced164efd7 100644 --- a/mozilla/layout/base/public/Makefile.in +++ b/mozilla/layout/base/public/Makefile.in @@ -86,6 +86,7 @@ $(NULL) XPIDLSRCS = \ nsIChromeEventHandler.idl \ nsISelectionController.idl \ + nsIPrintListener.idl \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/layout/base/public/makefile.win b/mozilla/layout/base/public/makefile.win index 98e644146b4..11317db23aa 100644 --- a/mozilla/layout/base/public/makefile.win +++ b/mozilla/layout/base/public/makefile.win @@ -81,6 +81,7 @@ MODULE=raptor XPIDLSRCS= \ .\nsIChromeEventHandler.idl \ .\nsISelectionController.idl \ + .\nsIPrintListener.idl \ $(NULL) diff --git a/mozilla/layout/base/src/nsDocumentViewer.cpp b/mozilla/layout/base/src/nsDocumentViewer.cpp index 1e5b3ba45c6..a514c04d9c7 100644 --- a/mozilla/layout/base/src/nsDocumentViewer.cpp +++ b/mozilla/layout/base/src/nsDocumentViewer.cpp @@ -241,6 +241,8 @@ protected: nsIView *mPrintView; FILE *mFilePointer; // a file where information can go to when printing + nsCOMPtr mPrintListener; // An observer for printing... + // document management data // these items are specific to markup documents (html and xml) // may consider splitting these out into a subclass @@ -280,7 +282,7 @@ DocumentViewerImpl::DocumentViewerImpl() NS_INIT_REFCNT(); mEnableRendering = PR_TRUE; mFilePointer = nsnull; - + mPrintListener = nsnull; } DocumentViewerImpl::DocumentViewerImpl(nsIPresContext* aPresContext) @@ -373,6 +375,7 @@ DocumentViewerImpl::~DocumentViewerImpl() // Break circular reference (or something) mPresShell->EndObservingDocument(); } + } /* @@ -1010,6 +1013,9 @@ void DocumentViewerImpl::DocumentReadyForPrinting() mIsPrinting = PR_FALSE; mPrintPS->EndObservingDocument(); + + if (mPrintListener) + mPrintListener->OnEndPrinting(NS_OK); NS_RELEASE(mPrintPS); NS_RELEASE(mPrintVM); @@ -1162,7 +1168,7 @@ static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTOR * @update 01/24/00 dwc */ NS_IMETHODIMP -DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile) +DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener) { nsCOMPtr webContainer; nsCOMPtr factory; @@ -1292,6 +1298,14 @@ PRInt32 width,height; printf(" DeviceDimension w = %d h = %d\n",i1,i2); #endif + // Print listener setup... + if (aPrintListener) + { + mPrintListener = aPrintListener; + mPrintListener->OnStartPrinting(); + /* RICHIE mPrintListener->OnProgressPrinting(PRUint32 aProgress, PRUint32 aProgressMax); */ + } + // // The mIsPrinting flag is set when the ImageGroup observer is // notified that images must be loaded as a result of the @@ -1309,7 +1323,7 @@ PRInt32 width,height; #endif } } - } + } } } return NS_OK; diff --git a/mozilla/layout/base/src/nsPluginViewer.cpp b/mozilla/layout/base/src/nsPluginViewer.cpp index a7129a0a9ac..30b9257ec7b 100644 --- a/mozilla/layout/base/src/nsPluginViewer.cpp +++ b/mozilla/layout/base/src/nsPluginViewer.cpp @@ -613,7 +613,7 @@ PluginViewerImpl::GetSaveable(PRBool *aSaveable) } NS_IMETHODIMP -PluginViewerImpl::Print(PRBool aSilent,FILE *aFile) +PluginViewerImpl::Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener) { return NS_OK; // XXX: hey, plug in guys! implement me! } diff --git a/mozilla/mailnews/base/resources/content/messenger.xul b/mozilla/mailnews/base/resources/content/messenger.xul index 2d466542c92..0efc0259f79 100644 --- a/mozilla/mailnews/base/resources/content/messenger.xul +++ b/mozilla/mailnews/base/resources/content/messenger.xul @@ -253,7 +253,7 @@ Rights Reserved. + oncommand="PrintEnginePrint();"/> - + @@ -818,7 +818,7 @@ Rights Reserved. - + diff --git a/mozilla/mailnews/base/resources/content/msgPrintEngine.js b/mozilla/mailnews/base/resources/content/msgPrintEngine.js index d0c5c63675c..8f6e8b61c11 100644 --- a/mozilla/mailnews/base/resources/content/msgPrintEngine.js +++ b/mozilla/mailnews/base/resources/content/msgPrintEngine.js @@ -30,7 +30,6 @@ function OnLoadPrintEngine() { PrintEngineCreateGlobals(); InitPrintEngineWindow(); - printEngine.StartPrintOperation(); } function OnUnloadPrintEngine() diff --git a/mozilla/mailnews/base/resources/content/msgPrintEngine.xul b/mozilla/mailnews/base/resources/content/msgPrintEngine.xul index 93cffefa28e..e64f7f5fe8e 100644 --- a/mozilla/mailnews/base/resources/content/msgPrintEngine.xul +++ b/mozilla/mailnews/base/resources/content/msgPrintEngine.xul @@ -18,8 +18,6 @@ Communications Corporation. Portions created by Netscape are Copyright (C) 1998-1999 Netscape Communications Corporation. All Rights Reserved. - screenX="10000" - screenY="10000" --> @@ -39,8 +37,8 @@ Rights Reserved. align="vertical" width="150" height="250" - screenX="0" - screenY="500" + screenX="10000" + screenY="10000" windowtype="mail:printEngine"> diff --git a/mozilla/mailnews/base/resources/locale/en-US/messenger.properties b/mozilla/mailnews/base/resources/locale/en-US/messenger.properties index acd937bb28c..f4d4e4f2c4d 100644 --- a/mozilla/mailnews/base/resources/locale/en-US/messenger.properties +++ b/mozilla/mailnews/base/resources/locale/en-US/messenger.properties @@ -45,5 +45,9 @@ HTMLFiles=HTML Files (*.htm, *.html, *.shtml) TextFiles=Text Files (*.txt) EMLFiles=Mail Files (*.eml) SaveMailAs=Save Message As +LoadingMessageToPrint=Loading message to print... +MessageLoaded=Message loaded... +PrintingMessage=Printing message... +PrintingComplete=Printing complete. saveAttachmentFailed=Unable to save the attachment. Please check your file name and try again later. -saveMessageFailed=Unable to save the message. Please check your file name and try again later. \ No newline at end of file +saveMessageFailed=Unable to save the message. Please check your file name and try again later.>>>>>>> 1.6 diff --git a/mozilla/mailnews/base/src/nsMessenger.cpp b/mozilla/mailnews/base/src/nsMessenger.cpp index ecc6a17afbc..00251b0847e 100644 --- a/mozilla/mailnews/base/src/nsMessenger.cpp +++ b/mozilla/mailnews/base/src/nsMessenger.cpp @@ -343,7 +343,7 @@ nsMessenger::InitializeDisplayCharset() { if (mCharsetInitialized) return; - + // libmime always converts to UTF-8 (both HTML and XML) nsCOMPtr docShell(do_QueryInterface(mWebShell)); if (docShell) @@ -357,9 +357,9 @@ nsMessenger::InitializeDisplayCharset() if (muDV) { muDV->SetForceCharacterSet(aForceCharacterSet.GetUnicode()); } + + mCharsetInitialized = PR_TRUE; } - - mCharsetInitialized = PR_TRUE; } } diff --git a/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp b/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp index c185c94a638..7cda2de8996 100644 --- a/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp +++ b/mozilla/mailnews/base/src/nsMsgPrintEngine.cpp @@ -23,6 +23,7 @@ #include "nsIURI.h" #include "nsEscape.h" +#include "nsXPIDLString.h" #include "nsIWebShell.h" #include "nsIDOMDocument.h" #include "nsIDocumentViewer.h" @@ -36,8 +37,9 @@ #include "nsIDocumentLoader.h" #include "nsIDocumentLoaderObserver.h" #include "nsIMarkupDocumentViewer.h" - +#include "nsIMsgMailSession.h" #include "nsMsgPrintEngine.h" +#include "nsMsgBaseCID.h" // Interfaces Needed #include "nsIBaseWindow.h" @@ -49,24 +51,41 @@ // nsMsgPrintEngine implementation ///////////////////////////////////////////////////////////////////////// +static NS_DEFINE_CID(kMsgMailSessionCID, NS_MSGMAILSESSION_CID); +static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); + nsMsgPrintEngine::nsMsgPrintEngine() : - mWebShell(nsnull) + mWebShell(nsnull), + mWindow(nsnull) { mCurrentlyPrintingURI = -1; - mWindow = nsnull; + + // note: it is okay to return a null status feedback and not return an error + // it's possible the url really doesn't have status feedback + nsresult rv; + NS_WITH_SERVICE(nsIMsgMailSession, mailSession, kMsgMailSessionCID, &rv); + if (NS_SUCCEEDED(rv)) + { + nsCOMPtr msgWindow; + + mailSession->GetTemporaryMsgWindow(getter_AddRefs(msgWindow)); + if (msgWindow) + msgWindow->GetStatusFeedback(getter_AddRefs(mFeedback)); + } + NS_INIT_REFCNT(); } nsMsgPrintEngine::~nsMsgPrintEngine() { - NS_IF_RELEASE(mWindow); } // Implement AddRef and Release NS_IMPL_ADDREF(nsMsgPrintEngine) NS_IMPL_RELEASE(nsMsgPrintEngine) -NS_IMPL_QUERY_INTERFACE2(nsMsgPrintEngine,nsIMsgPrintEngine, nsIDocumentLoaderObserver); + +NS_IMPL_QUERY_INTERFACE3(nsMsgPrintEngine, nsIMsgPrintEngine, nsIDocumentLoaderObserver, nsIPrintListener); nsresult nsMsgPrintEngine::Init() { @@ -76,6 +95,11 @@ nsresult nsMsgPrintEngine::Init() NS_IMETHODIMP nsMsgPrintEngine::OnStartDocumentLoad(nsIDocumentLoader *aLoader, nsIURI *aURL, const char *aCommand) { + // Tell the user we are loading... + PRUnichar *msg = GetString(nsString("LoadingMessageToPrint").GetUnicode()); + SetStatusMessage( msg ); + PR_FREEIF(msg); + return NS_OK; } @@ -86,6 +110,11 @@ nsMsgPrintEngine::OnEndDocumentLoad(nsIDocumentLoader *loader, nsIChannel *aChan nsresult rv = NS_ERROR_FAILURE; nsCOMPtr viewer; + // Tell the user the message is loaded... + PRUnichar *msg = GetString(nsString("MessageLoaded").GetUnicode()); + SetStatusMessage( msg ); + PR_FREEIF(msg); + nsCOMPtr docShell(do_QueryInterface(mWebShell)); NS_ASSERTION(docShell,"can't print, there is no webshell"); if ( (!docShell) || (!aChannel) ) @@ -94,12 +123,12 @@ nsMsgPrintEngine::OnEndDocumentLoad(nsIDocumentLoader *loader, nsIChannel *aChan } // Make sure this isn't just "about:blank" finishing.... - nsIURI *aOriginalURI = nsnull; - if (NS_SUCCEEDED(aChannel->GetOriginalURI(&aOriginalURI))) + nsCOMPtr originalURI = nsnull; + if (NS_SUCCEEDED(aChannel->GetOriginalURI(getter_AddRefs(originalURI)))) { - char *spec = nsnull; + nsXPIDLCString spec; - if (NS_SUCCEEDED(aOriginalURI->GetSpec(&spec)) && spec) + if (NS_SUCCEEDED(originalURI->GetSpec(getter_Copies(spec))) && spec) { if (!nsCRT::strcasecmp(spec, "about:blank")) { @@ -114,11 +143,19 @@ nsMsgPrintEngine::OnEndDocumentLoad(nsIDocumentLoader *loader, nsIChannel *aChan nsCOMPtr viewerFile = do_QueryInterface(viewer); if (viewerFile) { - rv = viewerFile->Print(PR_FALSE, nsnull); + if (mCurrentlyPrintingURI == 0) + rv = viewerFile->Print(PR_FALSE, nsnull, (nsIPrintListener *)this); + else + rv = viewerFile->Print(PR_TRUE, nsnull, (nsIPrintListener *)this); + + // Tell the user we started printing... + PRUnichar *msg = GetString(nsString("PrintingMessage").GetUnicode()); + SetStatusMessage( msg ); + PR_FREEIF(msg); } } - return StartNextPrintOperation(); + return rv; } NS_IMETHODIMP @@ -155,9 +192,8 @@ nsMsgPrintEngine::SetWindow(nsIDOMWindow *aWin) return NS_OK; } - NS_IF_RELEASE(mWindow); mWindow = aWin; - NS_ADDREF(aWin); + nsAutoString webShellName("printengine"); nsCOMPtr globalObj( do_QueryInterface(aWin) ); NS_ENSURE_TRUE(globalObj, NS_ERROR_FAILURE); @@ -216,20 +252,25 @@ nsMsgPrintEngine::StartNextPrintOperation() if (mCurrentlyPrintingURI == -1) InitializeDisplayCharset(); - // SetupObserver(); + mCurrentlyPrintingURI++; // First, check if we are at the end of this stuff! - if ( (mCurrentlyPrintingURI+1) >= mURIArray.Count() ) + if ( mCurrentlyPrintingURI >= mURIArray.Count() ) { - // Release(); + // This is the end...dum, dum, dum....my only friend...the end + mWindow->Close(); + + // Tell the user we are done... + PRUnichar *msg = GetString(nsString("PrintingComplete").GetUnicode()); + SetStatusMessage( msg ); + PR_FREEIF(msg); + return NS_OK; } - mCurrentlyPrintingURI++; if (!mWebShell) return StartNextPrintOperation(); - // SetWindow(mWindow); nsString *uri = mURIArray.StringAt(mCurrentlyPrintingURI); rv = FireThatLoadOperation(uri); if (NS_FAILED(rv)) @@ -293,11 +334,70 @@ nsMsgPrintEngine::SetupObserver() if (!mWebShell) return; - nsCOMPtr observer = do_QueryInterface(this); - if (observer) + nsCOMPtr docShell(do_QueryInterface(mWebShell)); + if (docShell) { - nsCOMPtr docShell(do_QueryInterface(mWebShell)); - docShell->SetDocLoaderObserver(observer); - } + docShell->SetDocLoaderObserver((nsIDocumentLoaderObserver *)this); + } } +NS_IMETHODIMP +nsMsgPrintEngine::OnStartPrinting(void) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsMsgPrintEngine::OnProgressPrinting(PRUint32 aProgress, PRUint32 aProgressMax) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsMsgPrintEngine::OnEndPrinting(PRUint32 aStatus) +{ + StartNextPrintOperation(); + return NS_OK; +} + +nsresult +nsMsgPrintEngine::SetStatusMessage(PRUnichar *aMsgString) +{ + PRUnichar *progressMsg; + + if ( (!mFeedback) || (!aMsgString) ) + return NS_OK; + + progressMsg = nsCRT::strdup(aMsgString); + mFeedback->ShowStatusString(progressMsg); + return NS_OK; +} + +#define MESSENGER_STRING_URL "chrome://messenger/locale/messenger.properties" + +PRUnichar * +nsMsgPrintEngine::GetString(const PRUnichar *aStringName) +{ + nsresult res = NS_OK; + PRUnichar *ptrv = nsnull; + + if (!mStringBundle) + { + char *propertyURL = MESSENGER_STRING_URL; + + NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &res); + if (NS_SUCCEEDED(res) && (nsnull != sBundleService)) + { + nsILocale *locale = nsnull; + res = sBundleService->CreateBundle(propertyURL, locale, getter_AddRefs(mStringBundle)); + } + } + + if (mStringBundle) + res = mStringBundle->GetStringFromName(aStringName, &ptrv); + + if ( NS_SUCCEEDED(res) && (ptrv) ) + return ptrv; + else + return nsCRT::strdup(aStringName); +} diff --git a/mozilla/mailnews/base/src/nsMsgPrintEngine.h b/mozilla/mailnews/base/src/nsMsgPrintEngine.h index b3660d4fb6b..2bd77e79aa8 100644 --- a/mozilla/mailnews/base/src/nsMsgPrintEngine.h +++ b/mozilla/mailnews/base/src/nsMsgPrintEngine.h @@ -32,8 +32,11 @@ #include "nsIMsgPrintEngine.h" #include "nsIScriptGlobalObject.h" #include "nsIStreamListener.h" +#include "nsIPrintListener.h" +#include "nsIMsgStatusFeedback.h" +#include "nsIStringBundle.h" -class nsMsgPrintEngine : public nsIMsgPrintEngine { +class nsMsgPrintEngine : public nsIMsgPrintEngine, public nsIPrintListener { public: nsMsgPrintEngine(); @@ -50,16 +53,24 @@ public: // For nsIDocumentLoaderObserver... NS_DECL_NSIDOCUMENTLOADEROBSERVER + // For nIPrintListener + NS_DECL_NSIPRINTLISTENER + protected: NS_IMETHOD FireThatLoadOperation(nsString *uri); NS_IMETHOD StartNextPrintOperation(); void InitializeDisplayCharset(); void SetupObserver(); + nsresult SetStatusMessage(PRUnichar *aMsgString); + PRUnichar *GetString(const PRUnichar *aStringName); - nsIDOMWindow *mWindow; nsCOMPtr mWebShell; + nsCOMPtr mWindow; PRInt32 mURICount; nsStringArray mURIArray; PRInt32 mCurrentlyPrintingURI; + + nsCOMPtr mStringBundle; // String bundles... + nsCOMPtr mFeedback; // Tell the user something why don't ya' }; diff --git a/mozilla/modules/plugin/base/src/nsPluginViewer.cpp b/mozilla/modules/plugin/base/src/nsPluginViewer.cpp index a7129a0a9ac..30b9257ec7b 100644 --- a/mozilla/modules/plugin/base/src/nsPluginViewer.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginViewer.cpp @@ -613,7 +613,7 @@ PluginViewerImpl::GetSaveable(PRBool *aSaveable) } NS_IMETHODIMP -PluginViewerImpl::Print(PRBool aSilent,FILE *aFile) +PluginViewerImpl::Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener) { return NS_OK; // XXX: hey, plug in guys! implement me! } diff --git a/mozilla/modules/plugin/nglsrc/nsPluginViewer.cpp b/mozilla/modules/plugin/nglsrc/nsPluginViewer.cpp index a7129a0a9ac..30b9257ec7b 100644 --- a/mozilla/modules/plugin/nglsrc/nsPluginViewer.cpp +++ b/mozilla/modules/plugin/nglsrc/nsPluginViewer.cpp @@ -613,7 +613,7 @@ PluginViewerImpl::GetSaveable(PRBool *aSaveable) } NS_IMETHODIMP -PluginViewerImpl::Print(PRBool aSilent,FILE *aFile) +PluginViewerImpl::Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener) { return NS_OK; // XXX: hey, plug in guys! implement me! } diff --git a/mozilla/webshell/public/nsIContentViewerFile.h b/mozilla/webshell/public/nsIContentViewerFile.h index 021c044f4ec..b34d7383307 100644 --- a/mozilla/webshell/public/nsIContentViewerFile.h +++ b/mozilla/webshell/public/nsIContentViewerFile.h @@ -9,6 +9,7 @@ #include "nsrootidl.h" #include "nsIWebShell.h" #include "nsIDeviceContext.h" +#include "nsIPrintListener.h" /* starting interface: nsIContentViewerFile */ @@ -37,7 +38,7 @@ class nsIContentViewerFile : public nsISupports { * @param aFileName -- a file pointer to output regression tests or print to a file * @return error status */ - NS_IMETHOD Print(PRBool aSilent,FILE *aFile) = 0; + NS_IMETHOD Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener = nsnull) = 0; /* [noscript] void PrintContent (in nsIWebShell parent, in nsIDeviceContext DContext); */ NS_IMETHOD PrintContent(nsIWebShell * parent, nsIDeviceContext * DContext) = 0; @@ -50,7 +51,7 @@ class nsIContentViewerFile : public nsISupports { #define NS_DECL_NSICONTENTVIEWERFILE \ NS_IMETHOD Save(void); \ NS_IMETHOD GetSaveable(PRBool *aSaveable); \ - NS_IMETHOD Print(PRBool aSilent,FILE *aFile); \ + NS_IMETHOD Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener); \ NS_IMETHOD PrintContent(nsIWebShell * parent, nsIDeviceContext * DContext); \ NS_IMETHOD GetPrintable(PRBool *aPrintable); @@ -58,7 +59,7 @@ class nsIContentViewerFile : public nsISupports { #define NS_FORWARD_NSICONTENTVIEWERFILE(_to) \ NS_IMETHOD Save(void) { return _to ## Save(); } \ NS_IMETHOD GetSaveable(PRBool *aSaveable) { return _to ## GetSaveable(aSaveable); } \ - NS_IMETHOD Print(PRBool aSilent,FILE *aFile) { return _to ## Print(); } \ + NS_IMETHOD Print(PRBool aSilent,FILE *aFile, nsIPrintListener *aPrintListener) { return _to ## Print(); } \ NS_IMETHOD PrintContent(nsIWebShell * parent, nsIDeviceContext * DContext) { return _to ## PrintContent(parent, DContext); } \ NS_IMETHOD GetPrintable(PRBool *aPrintable) { return _to ## GetPrintable(aPrintable); }