embedding/components/printingui/src/mac/nsPrintingPromptServiceX.mm

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsPrintingPromptService.h"
michael@0 7
michael@0 8 #include "nsCOMPtr.h"
michael@0 9 #include "nsServiceManagerUtils.h"
michael@0 10 #include "nsObjCExceptions.h"
michael@0 11
michael@0 12 #include "nsIPrintingPromptService.h"
michael@0 13 #include "nsIFactory.h"
michael@0 14 #include "nsIPrintDialogService.h"
michael@0 15
michael@0 16 //*****************************************************************************
michael@0 17 // nsPrintingPromptService
michael@0 18 //*****************************************************************************
michael@0 19
michael@0 20 NS_IMPL_ISUPPORTS(nsPrintingPromptService, nsIPrintingPromptService, nsIWebProgressListener)
michael@0 21
michael@0 22 nsPrintingPromptService::nsPrintingPromptService()
michael@0 23 {
michael@0 24 }
michael@0 25
michael@0 26 nsPrintingPromptService::~nsPrintingPromptService()
michael@0 27 {
michael@0 28 }
michael@0 29
michael@0 30 nsresult nsPrintingPromptService::Init()
michael@0 31 {
michael@0 32 return NS_OK;
michael@0 33 }
michael@0 34
michael@0 35 //*****************************************************************************
michael@0 36 // nsPrintingPromptService::nsIPrintingPromptService
michael@0 37 //*****************************************************************************
michael@0 38
michael@0 39 NS_IMETHODIMP
michael@0 40 nsPrintingPromptService::ShowPrintDialog(nsIDOMWindow *parent, nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings)
michael@0 41 {
michael@0 42 NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
michael@0 43
michael@0 44 nsCOMPtr<nsIPrintDialogService> dlgPrint(do_GetService(
michael@0 45 NS_PRINTDIALOGSERVICE_CONTRACTID));
michael@0 46 if (dlgPrint)
michael@0 47 return dlgPrint->Show(parent, printSettings, webBrowserPrint);
michael@0 48
michael@0 49 return NS_ERROR_FAILURE;
michael@0 50
michael@0 51 NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
michael@0 52 }
michael@0 53
michael@0 54 NS_IMETHODIMP
michael@0 55 nsPrintingPromptService::ShowProgress(nsIDOMWindow* parent,
michael@0 56 nsIWebBrowserPrint* webBrowserPrint, // ok to be null
michael@0 57 nsIPrintSettings* printSettings, // ok to be null
michael@0 58 nsIObserver* openDialogObserver, // ok to be null
michael@0 59 bool isForPrinting,
michael@0 60 nsIWebProgressListener** webProgressListener,
michael@0 61 nsIPrintProgressParams** printProgressParams,
michael@0 62 bool* notifyOnOpen)
michael@0 63 {
michael@0 64 return NS_ERROR_NOT_IMPLEMENTED;
michael@0 65 }
michael@0 66
michael@0 67 NS_IMETHODIMP
michael@0 68 nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs)
michael@0 69 {
michael@0 70 NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
michael@0 71 nsCOMPtr<nsIPrintDialogService> dlgPrint(do_GetService(
michael@0 72 NS_PRINTDIALOGSERVICE_CONTRACTID));
michael@0 73 if (dlgPrint)
michael@0 74 return dlgPrint->ShowPageSetup(parent, printSettings);
michael@0 75
michael@0 76 return NS_ERROR_FAILURE;
michael@0 77
michael@0 78 NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
michael@0 79 }
michael@0 80
michael@0 81 NS_IMETHODIMP
michael@0 82 nsPrintingPromptService::ShowPrinterProperties(nsIDOMWindow *parent, const char16_t *printerName, nsIPrintSettings *printSettings)
michael@0 83 {
michael@0 84 return NS_ERROR_NOT_IMPLEMENTED;
michael@0 85 }
michael@0 86
michael@0 87
michael@0 88 //*****************************************************************************
michael@0 89 // nsPrintingPromptService::nsIWebProgressListener
michael@0 90 //*****************************************************************************
michael@0 91
michael@0 92 NS_IMETHODIMP
michael@0 93 nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aStateFlags, nsresult aStatus)
michael@0 94 {
michael@0 95 return NS_OK;
michael@0 96 }
michael@0 97
michael@0 98 /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
michael@0 99 NS_IMETHODIMP
michael@0 100 nsPrintingPromptService::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, int32_t aCurSelfProgress, int32_t aMaxSelfProgress, int32_t aCurTotalProgress, int32_t aMaxTotalProgress)
michael@0 101 {
michael@0 102 return NS_OK;
michael@0 103 }
michael@0 104
michael@0 105 /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location, in unsigned long aFlags); */
michael@0 106 NS_IMETHODIMP
michael@0 107 nsPrintingPromptService::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location, uint32_t aFlags)
michael@0 108 {
michael@0 109 return NS_OK;
michael@0 110 }
michael@0 111
michael@0 112 /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
michael@0 113 NS_IMETHODIMP
michael@0 114 nsPrintingPromptService::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const char16_t *aMessage)
michael@0 115 {
michael@0 116 return NS_OK;
michael@0 117 }
michael@0 118
michael@0 119 /* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
michael@0 120 NS_IMETHODIMP
michael@0 121 nsPrintingPromptService::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t state)
michael@0 122 {
michael@0 123 return NS_OK;
michael@0 124 }

mercurial