Add PrintBGColors, PRINBGImages and Scaling

Bug 108345 r=dcone sr=attinasi
This commit is contained in:
rods%netscape.com 2001-11-26 12:48:41 +00:00
Родитель 93c8cee063
Коммит b52e7ea39b
9 изменённых файлов: 84 добавлений и 0 удалений

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

@ -148,6 +148,10 @@ interface nsIPrintOptions : nsISupports
attribute double marginBottom;
attribute double marginRight;
attribute double scaling; /* values 0.0 - 1.0 */
attribute boolean printBGColors; /* Print Background Colors */
attribute boolean printBGImages; /* Print Background Images */
attribute short printRange;
attribute wstring title;

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

@ -115,6 +115,10 @@ interface nsIPrintSettings : nsISupports
attribute double marginBottom;
attribute double marginRight;
attribute double scaling; /* values 0.0 - 1.0 */
attribute boolean printBGColors; /* Print Background Colors */
attribute boolean printBGImages; /* Print Background Images */
attribute short printRange;
attribute wstring title;

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

@ -104,6 +104,7 @@ public:
NS_IMETHOD GetDevUnitsToAppUnits(float &aDevUnits) const;
NS_IMETHOD GetCanonicalPixelScale(float &aScale) const;
NS_IMETHOD SetCanonicalPixelScale(float aScale);
NS_IMETHOD GetMetricsFor(const nsFont& aFont, nsIAtom* aLangGroup,
nsIFontMetrics*& aMetrics);

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

@ -264,6 +264,18 @@ public:
*/
NS_IMETHOD GetCanonicalPixelScale(float &aScale) const = 0;
/**
* Get the value used to scale a "standard" pixel to a pixel
* of the same physical size for this device. a standard pixel
* is defined as a pixel on display 0. this is used to make
* sure that entities defined in pixel dimensions maintain a
* constant relative size when displayed from one output
* device to another.
* @param aScale in parameter for scale value
* @return error status
*/
NS_IMETHOD SetCanonicalPixelScale(float aScale) = 0;
/**
* Get the width of a vertical scroll bar and the height
* of a horizontal scrollbar in application units.

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

@ -168,6 +168,12 @@ NS_IMETHODIMP DeviceContextImpl :: GetCanonicalPixelScale(float &aScale) const
return NS_OK;
}
NS_IMETHODIMP DeviceContextImpl :: SetCanonicalPixelScale(float aScale)
{
mCPixelScale = aScale;
return NS_OK;
}
static NS_DEFINE_CID(kRCCID, NS_RENDERING_CONTEXT_CID);
NS_IMETHODIMP DeviceContextImpl :: CreateRenderingContext(nsIView *aView, nsIRenderingContext *&aContext)

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

@ -103,6 +103,7 @@ nsPrintOptions::nsPrintOptions() :
mPrintRange(kRangeAllPages),
mStartPageNum(1),
mEndPageNum(1),
mScaling(1.0),
mNumCopies(1),
mPrintFrameType(kFramesAsIs),
mHowToEnableFrameUI(kFrameEnableNone),
@ -667,6 +668,46 @@ NS_IMETHODIMP nsPrintOptions::SetMarginRight(double aMarginRight)
return NS_OK;
}
/* attribute double scaling; */
NS_IMETHODIMP nsPrintOptions::GetScaling(double *aScaling)
{
NS_ENSURE_ARG_POINTER(aScaling);
*aScaling = mScaling;
return NS_OK;
}
NS_IMETHODIMP nsPrintOptions::SetScaling(double aScaling)
{
mScaling = aScaling;
return NS_OK;
}
/* attribute boolean printBGColors; */
NS_IMETHODIMP nsPrintOptions::GetPrintBGColors(PRBool *aPrintBGColors)
{
NS_ENSURE_ARG_POINTER(aPrintBGColors);
*aPrintBGColors = mPrintBGColors;
return NS_OK;
}
NS_IMETHODIMP nsPrintOptions::SetPrintBGColors(PRBool aPrintBGColors)
{
mPrintBGColors = aPrintBGColors;
return NS_OK;
}
/* attribute boolean printBGImages; */
NS_IMETHODIMP nsPrintOptions::GetPrintBGImages(PRBool *aPrintBGImages)
{
NS_ENSURE_ARG_POINTER(aPrintBGImages);
*aPrintBGImages = mPrintBGImages;
return NS_OK;
}
NS_IMETHODIMP nsPrintOptions::SetPrintBGImages(PRBool aPrintBGImages)
{
mPrintBGImages = aPrintBGImages;
return NS_OK;
}
/* attribute long printRange; */
NS_IMETHODIMP nsPrintOptions::GetPrintRange(PRInt16 *aPrintRange)
{
@ -909,6 +950,10 @@ NS_IMETHODIMP nsPrintOptions::SetPrintSettings(nsIPrintSettings * aPrintSettings
aPrintSettings->GetMarginRight(&dblVal);
SetMarginRight(dblVal);
aPrintSettings->GetScaling(&mScaling);
aPrintSettings->GetPrintBGColors(&mPrintBGColors);
aPrintSettings->GetPrintBGImages(&mPrintBGImages);
aPrintSettings->GetPrintRange(&mPrintRange);
PRUnichar* uniChar;

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

@ -67,6 +67,9 @@ protected:
PRInt16 mPrintRange;
PRInt32 mStartPageNum; // only used for ePrintRange_SpecifiedRange
PRInt32 mEndPageNum;
double mScaling;
PRBool mPrintBGColors; // print background colors
PRBool mPrintBGImages; // print background images
PRInt16 mPrintFrameType;
PRBool mHowToEnableFrameUI;

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

@ -340,6 +340,14 @@ NS_IMETHODIMP nsDeviceContextWin :: GetCanonicalPixelScale(float &aScale) const
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextWin :: SetCanonicalPixelScale(float aScale)
{
DeviceContextImpl::SetCanonicalPixelScale(aScale);
mPixelScale = aScale;
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextWin :: GetScrollBarDimensions(float &aWidth, float &aHeight) const
{
aWidth = ::GetSystemMetrics(SM_CXVSCROLL) * mDevUnitsToAppUnits;

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

@ -58,6 +58,7 @@ public:
NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets);
NS_IMETHOD GetCanonicalPixelScale(float &aScale) const;
NS_IMETHOD SetCanonicalPixelScale(float aScale);
NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const;
NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const;