Commit 7aa9ea4e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added beginning of IDM_PRINT implementation.

parent 139d2b81
...@@ -109,6 +109,7 @@ typedef nsISupports nsIEditor; ...@@ -109,6 +109,7 @@ typedef nsISupports nsIEditor;
typedef nsISupports nsIWebProgressListener; typedef nsISupports nsIWebProgressListener;
typedef nsISupports nsIDOMCSSValue; typedef nsISupports nsIDOMCSSValue;
typedef nsISupports nsIDOMCSSRule; typedef nsISupports nsIDOMCSSRule;
typedef nsISupports nsIPrintSession;
[ [
object, object,
...@@ -942,6 +943,145 @@ interface nsIWebNavigation : nsISupports ...@@ -942,6 +943,145 @@ interface nsIWebNavigation : nsISupports
[ [
object, object,
uuid(f1094df6-ce0e-42c9-9847-2f663172c38d)
]
interface nsIPrintSettings : nsISupports
{
typedef struct {} nsMargin;
nsresult SetPrintOptions(PRInt32 aType, PRBool aTurnOnOff);
nsresult GetPrintOptions(PRInt32 aType, PRBool *_retval);
nsresult GetPrintOptionsBits(PRInt32 *_retval);
nsresult GetPageSizeInTwips(PRInt32 *aWidth, PRInt32 *aHeight);
nsresult Clone(nsIPrintSettings **_retval);
nsresult Assign(nsIPrintSettings *aPS);
nsresult GetPrintSession(nsIPrintSession **aPrintSession);
nsresult SetPrintSession(nsIPrintSession *aPrintSession);
nsresult GetStartPageRange(PRInt32 *aStartPageRange);
nsresult SetStartPageRange(PRInt32 aStartPageRange);
nsresult GetEndPageRange(PRInt32 *aEndPageRange);
nsresult SetEndPageRange(PRInt32 aEndPageRange);
nsresult GetMarginTop(double *aMarginTop);
nsresult SetMarginTop(double aMarginTop);
nsresult GetMarginLeft(double *aMarginLeft);
nsresult SetMarginLeft(double aMarginLeft);
nsresult GetMarginBottom(double *aMarginBottom);
nsresult SetMarginBottom(double aMarginBottom);
nsresult GetMarginRight(double *aMarginRight);
nsresult SetMarginRight(double aMarginRight);
nsresult GetScaling(double *aScaling);
nsresult SetScaling(double aScaling);
nsresult GetPrintBGColors(PRBool *aPrintBGColors);
nsresult SetPrintBGColors(PRBool aPrintBGColors);
nsresult GetPrintBGImages(PRBool *aPrintBGImages);
nsresult SetPrintBGImages(PRBool aPrintBGImages);
nsresult GetPrintRange(PRInt16 *aPrintRange);
nsresult SetPrintRange(PRInt16 aPrintRange);
nsresult GetTitle(PRUnichar **aTitle);
nsresult SetTitle(const PRUnichar *aTitle);
nsresult GetDocURL(PRUnichar **aDocURL);
nsresult SetDocURL(const PRUnichar *aDocURL);
nsresult GetHeaderStrLeft(PRUnichar **aHeaderStrLeft);
nsresult SetHeaderStrLeft(const PRUnichar *aHeaderStrLeft);
nsresult GetHeaderStrCenter(PRUnichar **aHeaderStrCenter);
nsresult SetHeaderStrCenter(const PRUnichar *aHeaderStrCenter);
nsresult GetHeaderStrRight(PRUnichar **aHeaderStrRight);
nsresult SetHeaderStrRight(const PRUnichar *aHeaderStrRight);
nsresult GetFooterStrLeft(PRUnichar **aFooterStrLeft);
nsresult SetFooterStrLeft(const PRUnichar *aFooterStrLeft);
nsresult GetFooterStrCenter(PRUnichar **aFooterStrCenter);
nsresult SetFooterStrCenter(const PRUnichar *aFooterStrCenter);
nsresult GetFooterStrRight(PRUnichar **aFooterStrRight);
nsresult SetFooterStrRight(const PRUnichar *aFooterStrRight);
nsresult GetHowToEnableFrameUI(PRInt16 *aHowToEnableFrameUI);
nsresult SetHowToEnableFrameUI(PRInt16 aHowToEnableFrameUI);
nsresult GetIsCancelled(PRBool *aIsCancelled);
nsresult SetIsCancelled(PRBool aIsCancelled);
nsresult GetPrintFrameTypeUsage(PRInt16 *aPrintFrameTypeUsage);
nsresult SetPrintFrameTypeUsage(PRInt16 aPrintFrameTypeUsage);
nsresult GetPrintFrameType(PRInt16 *aPrintFrameType);
nsresult SetPrintFrameType(PRInt16 aPrintFrameType);
nsresult GetPrintSilent(PRBool *aPrintSilent);
nsresult SetPrintSilent(PRBool aPrintSilent);
nsresult GetShrinkToFit(PRBool *aShrinkToFit);
nsresult SetShrinkToFit(PRBool aShrinkToFit);
nsresult GetShowPrintProgress(PRBool *aShowPrintProgress);
nsresult SetShowPrintProgress(PRBool aShowPrintProgress);
nsresult GetPaperName(PRUnichar **aPaperName);
nsresult SetPaperName(const PRUnichar *aPaperName);
nsresult GetPaperSizeType(PRInt16 *aPaperSizeType);
nsresult SetPaperSizeType(PRInt16 aPaperSizeType);
nsresult GetPaperData(PRInt16 *aPaperData);
nsresult SetPaperData(PRInt16 aPaperData);
nsresult GetPaperWidth(double *aPaperWidth);
nsresult SetPaperWidth(double aPaperWidth);
nsresult GetPaperHeight(double *aPaperHeight);
nsresult SetPaperHeight(double aPaperHeight);
nsresult GetPaperSizeUnit(PRInt16 *aPaperSizeUnit);
nsresult SetPaperSizeUnit(PRInt16 aPaperSizeUnit);
nsresult GetPlexName(PRUnichar **aPlexName);
nsresult SetPlexName(const PRUnichar *aPlexName);
nsresult GetColorspace(PRUnichar **aColorspace);
nsresult SetColorspace(const PRUnichar *aColorspace);
nsresult GetResolutionName(PRUnichar **aResolutionName);
nsresult SetResolutionName(const PRUnichar aResolutionName);
nsresult GetDownloadFonts(PRBool *aDownloadFonts);
nsresult SetDownloadFonts(PRBool aDownloadFonts);
nsresult GetPrintReversed(PRBool *aPrintReversed);
nsresult SetPrintReversed(PRBool aPrintReversed);
nsresult GetPrintInColor(PRBool *aPrintInColor);
nsresult SetPrintInColor(PRBool aPrintInColor);
nsresult GetPaperSize(PRInt32 *aPaperSize);
nsresult SetPaperSize(PRInt32 aPaperSize);
nsresult GetOrientation(PRInt32 *aOrientation);
nsresult SetOrientation(PRInt32 aOrientation);
nsresult GetPrintCommand(PRUnichar **aPrintCommand);
nsresult SetPrintCommand(const PRUnichar *aPrintCommand);
nsresult GetNumCopies(PRInt32 *aNumCopies);
nsresult SetNumCopies(PRInt32 aNumCopies);
nsresult GetPrinterName(PRUnichar **aPrinterName);
nsresult SetPrinterName(const PRUnichar *aPrinterName);
nsresult GetPrintToFile(PRBool *aPrintToFile);
nsresult SetPrintToFile(PRBool aPrintToFile);
nsresult GetToFileName(PRUnichar **aToFileName);
nsresult SetToFileName(const PRUnichar *aToFileName);
nsresult GetPrintPageDelay(PRInt32 *aPrintPageDelay);
nsresult SetPrintPageDelay(PRInt32 aPrintPageDelay);
nsresult GetIsInitializedFromPrinter(PRBool *aIsInitializedFromPrinter);
nsresult SetIsInitializedFromPrinter(PRBool aIsInitializedFromPrinter);
nsresult GetIsInitializedFromPrefs(PRBool *aIsInitializedFromPrefs);
nsresult SetIsInitializedFromPrefs(PRBool aIsInitializedFromPrefs);
nsresult SetMarginInTwips(nsMargin *aMargin);
nsresult GetMarginInTwips(nsMargin *aMargin);
}
[
object,
uuid(9a7ca4b0-fbba-11d4-a869-00105a183419)
]
interface nsIWebBrowserPrint : nsISupports
{
nsresult GetGlobalPrintSettings(nsIPrintSettings **aGlobalPrintSettings);
nsresult GetCurrentPrintSettings(nsIPrintSettings **aCurrentPrintSettings);
nsresult GetCurrentChildDOMWindow(nsIDOMWindow **aCurrentChildDOMWindow);
nsresult GetDoingPrint(PRBool *aDoingPrint);
nsresult GetDoingPrintPreview(PRBool *aDoingPrintPreview);
nsresult GetIsFramesetDocument(PRBool *aIsFramesetDocument);
nsresult GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected);
nsresult GetIsIFrameSelected(PRBool *aIsIFrameSelected);
nsresult GetIsRangeSelection(PRBool *aIsRangeSelection);
nsresult GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages);
nsresult Print(nsIPrintSettings *aThePrintSettings, nsIWebProgressListener *aWPListener);
nsresult PrintPreview(nsIPrintSettings *aThePrintSettings, nsIDOMWindow *aChildDOMWin,
nsIWebProgressListener *aWPListener);
nsresult PrintPreviewNavigate(PRInt16 aNavType, PRInt32 aPageNum);
nsresult Cancel();
nsresult EnumerateDocumentNames(PRUint32 *aCount, PRUnichar ***aResult);
nsresult ExitPrintPreview();
}
[
object,
uuid(c8c0a080-0868-11d3-915f-d9d889d48e3c) uuid(c8c0a080-0868-11d3-915f-d9d889d48e3c)
] ]
interface nsIFile : nsISupports interface nsIFile : nsISupports
......
...@@ -97,8 +97,42 @@ static HRESULT exec_save_copy_as(HTMLDocument *This, DWORD nCmdexecopt, VARIANT ...@@ -97,8 +97,42 @@ static HRESULT exec_save_copy_as(HTMLDocument *This, DWORD nCmdexecopt, VARIANT
static HRESULT exec_print(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) static HRESULT exec_print(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
{ {
FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut); nsIInterfaceRequestor *iface_req;
return E_NOTIMPL; nsIWebBrowserPrint *nsprint;
nsresult nsres;
TRACE("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
if(pvaOut)
FIXME("unsupported pvaOut\n");
if(pvaIn)
FIXME("unsupported pvaIn\n");
if(!This->nscontainer)
return S_OK;
nsres = nsIWebBrowser_QueryInterface(This->nscontainer->webbrowser,
&IID_nsIInterfaceRequestor, (void**)&iface_req);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIInterfaceRequestor: %08x\n", nsres);
return S_OK;
}
nsres = nsIInterfaceRequestor_GetInterface(iface_req, &IID_nsIWebBrowserPrint,
(void**)&nsprint);
nsIInterfaceRequestor_Release(iface_req);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIWebBrowserPrint: %08x\n", nsres);
return S_OK;
}
nsres = nsIWebBrowserPrint_Print(nsprint, NULL, NULL);
if(NS_FAILED(nsres))
ERR("Print failed: %08x\n", nsres);
nsIWebBrowserPrint_Release(nsprint);
return S_OK;
} }
static HRESULT exec_print_preview(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) static HRESULT exec_print_preview(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
...@@ -837,6 +871,10 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con ...@@ -837,6 +871,10 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con
TRACE("CGID_MSHTML: IDM_FONTSIZE\n"); TRACE("CGID_MSHTML: IDM_FONTSIZE\n");
prgCmds[i].cmdf = query_edit_status(This, NULL); prgCmds[i].cmdf = query_edit_status(This, NULL);
break; break;
case IDM_PRINT:
FIXME("CGID_MSHTML: IDM_PRINT\n");
prgCmds[i].cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
break;
case IDM_PASTE: case IDM_PASTE:
FIXME("CGID_MSHTML: IDM_PASTE\n"); FIXME("CGID_MSHTML: IDM_PASTE\n");
prgCmds[i].cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED; prgCmds[i].cmdf = OLECMDF_SUPPORTED|OLECMDF_ENABLED;
...@@ -940,6 +978,8 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID ...@@ -940,6 +978,8 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID
return exec_fontname(This, pvaIn, pvaOut); return exec_fontname(This, pvaIn, pvaOut);
case IDM_FONTSIZE: case IDM_FONTSIZE:
return exec_fontsize(This, pvaIn, pvaOut); return exec_fontsize(This, pvaIn, pvaOut);
case IDM_PRINT:
return exec_print(This, nCmdexecopt, pvaIn, pvaOut);
case IDM_BOLD: case IDM_BOLD:
if(pvaIn || pvaOut) if(pvaIn || pvaOut)
FIXME("unsupported arguments\n"); FIXME("unsupported arguments\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment