1) Removes the EnumeratePrinterExtended from nsIPrintOptions and all impls of it
2) Sets the Windows platform to once again use the native print dialog
3) The nsDeviceContextSpecWin will detect at runtime whether to use the standard PRINTDLG or the new PRINTDLGEX (supported by XP and WIN2k), this new code is only compiled in when the ifdef MOZ_REQUIRE_CURRENT_SDK is defined.
4) It adds an extra Property Sheet to the new dialog for Frameset Printing options
5) Now creates a DEVMODE before the diaog is created, this is used for setting different options in the print dialog before it comes up.
122530 r=dcone sr=hyatt
This commit is contained in:
rods%netscape.com 2006-02-07 01:13:21 +00:00
Родитель 09fdf7145c
Коммит ec64c3cb25
6 изменённых файлов: 652 добавлений и 315 удалений

Просмотреть файл

@ -243,14 +243,6 @@ interface nsIPrintOptions : nsISupports
*/
nsISimpleEnumerator availablePrinters ();
/**
* Indicates whether the list of printers contains the extended
* information. i.e. That there are "pairs" of values returned. Where the second
* value is either "FILE", "PRINTER", "BOTH"
*
*/
readonly attribute boolean isExtended;
/**
* display Printer Job Properties dialog
*/
@ -276,25 +268,6 @@ interface nsIPrinterEnumerator : nsISupports
*/
void enumeratePrinters(out PRUint32 aCount,[retval, array, size_is(aCount)] out wstring aResult);
/**
* Returns an array of "pairs" of strings
* The first string in the pair is the printer name
* the second string in the pair is can be "FILE", "PRINTER", or "BOTH"
* which indicates whether the printer driver associated with this printer
* ALWAYS "spools" to a file or to a printer.
*
* If this type of information is not available, it should return zero items
*
* Note: On some platforms any given driveris able to spool to either
*
* @param aCount returns number of printers AND info strings returned
* i.e If there are 5 printers define the
* "count" returned will be 10
* @param aResult returns array of names
* @return void
*/
void enumeratePrintersExtended(out PRUint32 aCount,[retval, array, size_is(aCount)] out wstring aResult);
/* takes printer selected and will display job properties dlg for that printer
* returns true if dialog displays
*/

Просмотреть файл

@ -480,15 +480,6 @@ nsPrinterEnumeratorGTK::nsPrinterEnumeratorGTK()
NS_IMPL_ISUPPORTS1(nsPrinterEnumeratorGTK, nsIPrinterEnumerator)
NS_IMETHODIMP nsPrinterEnumeratorGTK::EnumeratePrintersExtended(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);
NS_ENSURE_ARG_POINTER(aResult);
*aCount = 0;
*aResult = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsPrinterEnumeratorGTK::EnumeratePrinters(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -63,6 +63,10 @@ protected:
nsresult ShowXPPrintDialog(PRBool aQuiet);
nsresult ShowNativePrintDialog(nsIWidget* aWidget, PRBool aQuiet);
#ifdef MOZ_REQUIRE_CURRENT_SDK
nsresult ShowNativePrintDialogEx(nsIWidget* aWidget, PRBool aQuiet);
#endif
void SetDeviceName(char* aDeviceName);
void SetDriverName(char* aDriverName);
void SetGlobalDevMode(HGLOBAL aHGlobal);
@ -80,6 +84,9 @@ protected:
PRBool mIsDEVMODEGlobalHandle;
nsCOMPtr<nsIPrintSettings> mPrintSettings;
// For PrintDlgEx
FARPROC mUseExtendedPrintDlg;
};

Просмотреть файл

@ -128,8 +128,7 @@ nsPrintOptions::nsPrintOptions() :
mPrintReversed(PR_FALSE),
mPrintInColor(PR_TRUE),
mOrientation(kPortraitOrientation),
mPrintToFile(PR_FALSE),
mIsExtendedInfo(PR_FALSE)
mPrintToFile(PR_FALSE)
{
NS_INIT_ISUPPORTS();
@ -183,7 +182,7 @@ nsPrinterListEnumerator : public nsISimpleEnumerator
//nsISimpleEnumerator interface
NS_DECL_NSISIMPLEENUMERATOR
NS_IMETHOD Init(PRBool& aIsExtendedInfo);
NS_IMETHOD Init();
protected:
PRUnichar **mPrinters;
@ -210,7 +209,7 @@ nsPrinterListEnumerator::~nsPrinterListEnumerator()
NS_IMPL_ISUPPORTS1(nsPrinterListEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP nsPrinterListEnumerator::Init(PRBool& aIsExtended)
NS_IMETHODIMP nsPrinterListEnumerator::Init()
{
nsresult rv;
nsCOMPtr<nsIPrinterEnumerator> printerEnumerator;
@ -219,17 +218,7 @@ NS_IMETHODIMP nsPrinterListEnumerator::Init(PRBool& aIsExtended)
if (NS_FAILED(rv))
return rv;
// First check to see if we can get the extended printer informations
// if not then get the regular
rv = printerEnumerator->EnumeratePrintersExtended(&mCount, &mPrinters);
if (NS_SUCCEEDED(rv) && mCount > 0) {
aIsExtended = PR_TRUE;
} else {
aIsExtended = PR_FALSE;
rv = printerEnumerator->EnumeratePrinters(&mCount, &mPrinters);
}
return rv;
return printerEnumerator->EnumeratePrinters(&mCount, &mPrinters);
}
NS_IMETHODIMP nsPrinterListEnumerator::HasMoreElements(PRBool *result)
@ -708,7 +697,7 @@ NS_IMETHODIMP nsPrintOptions::AvailablePrinters(nsISimpleEnumerator **aPrinterEn
NS_ENSURE_TRUE(printerListEnum.get(), NS_ERROR_OUT_OF_MEMORY);
// if Init fails NS_OK is return (script needs NS_OK) but the enumerator will be null
nsresult rv = printerListEnum->Init(mIsExtendedInfo);
nsresult rv = printerListEnum->Init();
if (NS_SUCCEEDED(rv)) {
*aPrinterEnumerator = NS_STATIC_CAST(nsISimpleEnumerator*, printerListEnum);
NS_ADDREF(*aPrinterEnumerator);
@ -716,15 +705,6 @@ NS_IMETHODIMP nsPrintOptions::AvailablePrinters(nsISimpleEnumerator **aPrinterEn
return NS_OK;
}
/* readonly attribute boolean isExtended; */
NS_IMETHODIMP nsPrintOptions::GetIsExtended(PRBool *aIsExtended)
{
NS_ENSURE_ARG(aIsExtended);
*aIsExtended = mIsExtendedInfo;
return NS_OK;
}
NS_IMETHODIMP nsPrintOptions::DisplayJobProperties( const PRUnichar *aPrinter, nsIPrintSettings* aPrintSettings, PRBool *aDisplayed)
{
NS_ENSURE_ARG(aPrinter);

Просмотреть файл

@ -104,8 +104,6 @@ protected:
PRBool mPrintToFile;
nsString mToFileName;
PRBool mIsExtendedInfo;
static nsFont* sDefaultFont;
};