зеркало из https://github.com/mozilla/gecko-dev.git
Add the new pluggable dialog work, in build, not used
BUg 135441 r=dcone,pink sr=attinasi
This commit is contained in:
Родитель
5f8760cbcd
Коммит
288186b2f3
|
@ -42,6 +42,7 @@
|
|||
#include "nsIWebProgressListener.idl"
|
||||
|
||||
interface nsIDOMWindowInternal;
|
||||
interface nsIObserver;
|
||||
|
||||
[scriptable, uuid(7E46BC35-FB7D-4b45-AB35-82FD61015380)]
|
||||
interface nsIPrintProgress: nsIWebProgressListener {
|
||||
|
@ -49,7 +50,11 @@ interface nsIPrintProgress: nsIWebProgressListener {
|
|||
/* Open the progress dialog
|
||||
you can specify parameters through an xpcom object
|
||||
*/
|
||||
void openProgressDialog(in nsIDOMWindowInternal parent, in string dialogURL, in nsISupports parameters);
|
||||
void openProgressDialog(in nsIDOMWindowInternal parent,
|
||||
in string dialogURL,
|
||||
in nsISupports parameters,
|
||||
in nsIObserver openDialogObserver,
|
||||
out boolean notifyOnOpen);
|
||||
|
||||
/* Close the progress dialog */
|
||||
void closeProgressDialog(in boolean forceClose);
|
||||
|
|
|
@ -72,8 +72,11 @@ nsPrintProgress::~nsPrintProgress()
|
|||
/* void openProgressDialog (in nsIDOMWindowInternal parent, in string dialogURL, in nsISupports parameters); */
|
||||
NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(nsIDOMWindowInternal *parent,
|
||||
const char *dialogURL,
|
||||
nsISupports *parameters)
|
||||
nsISupports *parameters,
|
||||
nsIObserver *openDialogObserver,
|
||||
PRBool *notifyOnOpen)
|
||||
{
|
||||
*notifyOnOpen = PR_FALSE;
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
if (m_dialog)
|
||||
|
|
|
@ -40,6 +40,10 @@ XPIDLSRCS = \
|
|||
nsIPrintSettings.idl \
|
||||
$(NULL)
|
||||
|
||||
ifneq (,$(filter mac cocoa,$(MOZ_GFX_TOOLKIT)))
|
||||
XPIDLSRCS += nsIPrintSettingsX.idl
|
||||
endif
|
||||
|
||||
ifeq ($(MOZ_GFX_TOOLKIT),windows)
|
||||
XPIDLSRCS += nsIPrintSettingsWin.idl
|
||||
endif
|
||||
|
|
|
@ -88,6 +88,7 @@ interface nsIPrintSettings : nsISupports
|
|||
const unsigned long kInitSaveToFileName = 0x00400000;
|
||||
const unsigned long kInitSavePageDelay = 0x00800000;
|
||||
const unsigned long kInitSaveMargins = 0x01000000;
|
||||
const unsigned long kInitSaveNativeData = 0x02000000;
|
||||
const unsigned long kInitSaveAll = 0xFFFFFFFF;
|
||||
|
||||
/* Print Option Flags for Bit Field*/
|
||||
|
@ -165,6 +166,11 @@ interface nsIPrintSettings : nsISupports
|
|||
*/
|
||||
void GetPageSizeInTwips(out long aWidth, out long aHeight);
|
||||
|
||||
/**
|
||||
* Makes a new copy
|
||||
*/
|
||||
nsIPrintSettings clone();
|
||||
|
||||
/**
|
||||
* Data Members
|
||||
*/
|
||||
|
|
|
@ -776,6 +776,20 @@
|
|||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsMac.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsX.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
</FILELIST>
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
|
@ -818,6 +832,16 @@
|
|||
<PATH>nsIPrintSettings.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsMac.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsX.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
</LINKORDER>
|
||||
</TARGET>
|
||||
<TARGET>
|
||||
|
@ -1543,6 +1567,20 @@
|
|||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsMac.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsX.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Text</FILEKIND>
|
||||
<FILEFLAGS></FILEFLAGS>
|
||||
</FILE>
|
||||
</FILELIST>
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
|
@ -1585,6 +1623,16 @@
|
|||
<PATH>nsIPrintSettings.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsMac.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsX.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
</LINKORDER>
|
||||
</TARGET>
|
||||
</TARGETLIST>
|
||||
|
@ -1625,6 +1673,18 @@
|
|||
<PATH>nsIPrintSettings.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>headers</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsMac.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>headers</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
<PATH>nsIPrintSettingsX.idl</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>headers</TARGETNAME>
|
||||
<PATHTYPE>Name</PATHTYPE>
|
||||
|
|
|
@ -27,4 +27,6 @@ nsIDrawingSurface.h
|
|||
nsRepeater.h
|
||||
nsThemeConstants.h
|
||||
nsITheme.h
|
||||
nsPDECommon.h
|
||||
nsWatchTask.h
|
||||
|
||||
|
|
|
@ -91,6 +91,46 @@ nsPrintSettings::nsPrintSettings() :
|
|||
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsPrintSettingsImpl.h
|
||||
* @update 6/21/00 dwc
|
||||
*/
|
||||
nsPrintSettings::nsPrintSettings(const nsPrintSettings* aPS) :
|
||||
mPrintOptions(aPS->mPrintOptions),
|
||||
mPrintRange(aPS->mPrintRange),
|
||||
mStartPageNum(aPS->mStartPageNum),
|
||||
mEndPageNum(aPS->mEndPageNum),
|
||||
mScaling(aPS->mScaling),
|
||||
mPrintBGColors(aPS->mPrintBGColors),
|
||||
mPrintBGImages(aPS->mPrintBGImages),
|
||||
mPrintFrameTypeUsage(aPS->mPrintFrameTypeUsage),
|
||||
mPrintFrameType(aPS->mPrintFrameType),
|
||||
mHowToEnableFrameUI(aPS->mHowToEnableFrameUI),
|
||||
mIsCancelled(aPS->mIsCancelled),
|
||||
mPrintSilent(aPS->mPrintSilent),
|
||||
mPrintPreview(aPS->mPrintPreview),
|
||||
mShrinkToFit(aPS->mShrinkToFit),
|
||||
mPrintPageDelay(aPS->mPrintPageDelay),
|
||||
mPaperData(aPS->mPaperData),
|
||||
mPaperSizeType(aPS->mPaperSizeType),
|
||||
mPaperWidth(aPS->mPaperWidth),
|
||||
mPaperHeight(aPS->mPaperHeight),
|
||||
mPaperSizeUnit(aPS->mPaperSizeUnit),
|
||||
mPrintReversed(aPS->mPrintReversed),
|
||||
mPrintInColor(aPS->mPrintInColor),
|
||||
mOrientation(aPS->mOrientation),
|
||||
mNumCopies(aPS->mNumCopies),
|
||||
mPrintToFile(aPS->mPrintToFile),
|
||||
mMargin(aPS->mMargin)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
for (PRInt32 i=0;i<3;i++) {
|
||||
mHeaderStrs[i] = aPS->mHeaderStrs[i];
|
||||
mFooterStrs[i] = aPS->mFooterStrs[i];
|
||||
}
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsPrintSettingsImpl.h
|
||||
* @update 6/21/00 dwc
|
||||
|
@ -769,3 +809,16 @@ nsPrintSettings::GetPageSizeInTwips(PRInt32 *aWidth, PRInt32 *aHeight)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsPrintSettings::CloneObj(nsIPrintSettings **_retval)
|
||||
{
|
||||
nsPrintSettings* printSettings = new nsPrintSettings(this);
|
||||
return printSettings->QueryInterface(NS_GET_IID(nsIPrintSettings), (void**)_retval); // ref counts
|
||||
}
|
||||
|
||||
/* nsIPrintSettings clone (); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintSettings::Clone(nsIPrintSettings **_retval)
|
||||
{
|
||||
return CloneObj(_retval);
|
||||
}
|
||||
|
|
|
@ -37,9 +37,12 @@ public:
|
|||
NS_DECL_NSIPRINTSETTINGS
|
||||
|
||||
nsPrintSettings();
|
||||
nsPrintSettings(const nsPrintSettings* aPS);
|
||||
virtual ~nsPrintSettings();
|
||||
|
||||
protected:
|
||||
virtual nsresult CloneObj(nsIPrintSettings **_retval);
|
||||
|
||||
typedef enum {
|
||||
eHeader,
|
||||
eFooter
|
||||
|
|
|
@ -55,6 +55,26 @@ nsPrintSettingsWin::nsPrintSettingsWin() :
|
|||
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsPrintSettingsWin.h
|
||||
* @update
|
||||
*/
|
||||
nsPrintSettingsWin::nsPrintSettingsWin(const nsPrintSettingsWin* aPS) :
|
||||
nsPrintSettings(aPS),
|
||||
mDeviceName(nsnull),
|
||||
mDriverName(nsnull),
|
||||
mDevMode(nsnull)
|
||||
{
|
||||
if (aPS->mDeviceName) mDeviceName = nsCRT::strdup(aPS->mDeviceName);
|
||||
if (aPS->mDriverName) mDriverName = nsCRT::strdup(aPS->mDriverName);
|
||||
|
||||
if (aPS->mDevMode) {
|
||||
size_t size = sizeof(*aPS->mDevMode);
|
||||
mDevMode = (LPDEVMODE)malloc(size);
|
||||
memcpy(mDevMode, aPS->mDevMode, size);
|
||||
}
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsPrintSettingsWin.h
|
||||
* @update
|
||||
|
@ -126,3 +146,11 @@ NS_IMETHODIMP nsPrintSettingsWin::SetDevMode(DEVMODE * aDevMode)
|
|||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIPrintSettings clone (); */
|
||||
nsresult
|
||||
nsPrintSettingsWin::CloneObj(nsIPrintSettings **_retval)
|
||||
{
|
||||
nsPrintSettingsWin* printSettings = new nsPrintSettingsWin(this);
|
||||
return printSettings->QueryInterface(NS_GET_IID(nsIPrintSettings), (void**)_retval); // ref counts
|
||||
}
|
||||
|
|
|
@ -32,15 +32,21 @@
|
|||
//*** nsPrintSettingsWin
|
||||
//*****************************************************************************
|
||||
class nsPrintSettingsWin : public nsPrintSettings,
|
||||
public nsIPrintSettingsWin
|
||||
public nsIPrintSettingsWin
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIPRINTSETTINGSWIN
|
||||
|
||||
nsPrintSettingsWin();
|
||||
nsPrintSettingsWin(const nsPrintSettingsWin* aPS);
|
||||
virtual ~nsPrintSettingsWin();
|
||||
|
||||
/**
|
||||
* Makes a new copy
|
||||
*/
|
||||
virtual nsresult CloneObj(nsIPrintSettings **_retval);
|
||||
|
||||
protected:
|
||||
char* mDeviceName;
|
||||
char* mDriverName;
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "nsIWebProgressListener.idl"
|
||||
|
||||
interface nsIDOMWindowInternal;
|
||||
interface nsIObserver;
|
||||
|
||||
[scriptable, uuid(7E46BC35-FB7D-4b45-AB35-82FD61015380)]
|
||||
interface nsIPrintProgress: nsIWebProgressListener {
|
||||
|
@ -49,7 +50,11 @@ interface nsIPrintProgress: nsIWebProgressListener {
|
|||
/* Open the progress dialog
|
||||
you can specify parameters through an xpcom object
|
||||
*/
|
||||
void openProgressDialog(in nsIDOMWindowInternal parent, in string dialogURL, in nsISupports parameters);
|
||||
void openProgressDialog(in nsIDOMWindowInternal parent,
|
||||
in string dialogURL,
|
||||
in nsISupports parameters,
|
||||
in nsIObserver openDialogObserver,
|
||||
out boolean notifyOnOpen);
|
||||
|
||||
/* Close the progress dialog */
|
||||
void closeProgressDialog(in boolean forceClose);
|
||||
|
|
Загрузка…
Ссылка в новой задаче