1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/nsIDeviceContextSpec.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsIDeviceContextSpec_h___ 1.10 +#define nsIDeviceContextSpec_h___ 1.11 + 1.12 +#include "nsISupports.h" 1.13 + 1.14 +class nsIWidget; 1.15 +class nsIPrintSettings; 1.16 +class gfxASurface; 1.17 + 1.18 +#define NS_IDEVICE_CONTEXT_SPEC_IID \ 1.19 +{ 0xb5548fb1, 0xf43e, 0x4921, \ 1.20 + { 0x82, 0x19, 0xc3, 0x82, 0x06, 0xee, 0x74, 0x5c } } 1.21 + 1.22 +class nsIDeviceContextSpec : public nsISupports 1.23 +{ 1.24 +public: 1.25 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDEVICE_CONTEXT_SPEC_IID) 1.26 + 1.27 + /** 1.28 + * Initialize the device context spec. 1.29 + * @param aWidget A widget a dialog can be hosted in 1.30 + * @param aPrintSettings Print settings for the print operation 1.31 + * @param aIsPrintPreview True if creating Spec for PrintPreview 1.32 + * @return NS_OK or a suitable error code. 1.33 + */ 1.34 + NS_IMETHOD Init(nsIWidget *aWidget, 1.35 + nsIPrintSettings* aPrintSettings, 1.36 + bool aIsPrintPreview) = 0; 1.37 + 1.38 + NS_IMETHOD GetSurfaceForPrinter(gfxASurface **nativeSurface) = 0; 1.39 + 1.40 + NS_IMETHOD BeginDocument(const nsAString& aTitle, 1.41 + char16_t* aPrintToFileName, 1.42 + int32_t aStartPage, 1.43 + int32_t aEndPage) = 0; 1.44 + 1.45 + NS_IMETHOD EndDocument() = 0; 1.46 + NS_IMETHOD BeginPage() = 0; 1.47 + NS_IMETHOD EndPage() = 0; 1.48 +}; 1.49 + 1.50 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIDeviceContextSpec, 1.51 + NS_IDEVICE_CONTEXT_SPEC_IID) 1.52 +#endif