widget/qt/nsDeviceContextSpecQt.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/qt/nsDeviceContextSpecQt.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     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 +
    1.10 +#ifndef nsDeviceContextSpecQt_h___
    1.11 +#define nsDeviceContextSpecQt_h___
    1.12 +
    1.13 +#include "nsIDeviceContextSpec.h"
    1.14 +#include "nsIPrintSettings.h"
    1.15 +#include "nsIPrintOptions.h"
    1.16 +#include "nsCOMPtr.h"
    1.17 +#include "nsString.h"
    1.18 +
    1.19 +#include "nsCRT.h" /* should be <limits.h>? */
    1.20 +
    1.21 +class nsDeviceContextSpecQt : public nsIDeviceContextSpec
    1.22 +{
    1.23 +public:
    1.24 +    nsDeviceContextSpecQt();
    1.25 +    virtual ~nsDeviceContextSpecQt();
    1.26 +
    1.27 +    NS_DECL_ISUPPORTS
    1.28 +
    1.29 +    NS_IMETHOD GetSurfaceForPrinter(gfxASurface** surface);
    1.30 +
    1.31 +    NS_IMETHOD Init(nsIWidget* aWidget,
    1.32 +                    nsIPrintSettings* aPS,
    1.33 +                    bool aIsPrintPreview);
    1.34 +    NS_IMETHOD BeginDocument(const nsAString& aTitle,
    1.35 +                             char16_t* aPrintToFileName,
    1.36 +                             int32_t aStartPage,
    1.37 +                             int32_t aEndPage);
    1.38 +    NS_IMETHOD EndDocument();
    1.39 +    NS_IMETHOD BeginPage() { return NS_OK; }
    1.40 +    NS_IMETHOD EndPage() { return NS_OK; }
    1.41 +
    1.42 +    NS_IMETHOD GetPath (const char** aPath);
    1.43 +
    1.44 +protected:
    1.45 +    nsCOMPtr<nsIPrintSettings> mPrintSettings;
    1.46 +    bool mToPrinter : 1;      /* If true, print to printer */
    1.47 +    bool mIsPPreview : 1;     /* If true, is print preview */
    1.48 +    char   mPath[PATH_MAX];     /* If toPrinter = false, dest file */
    1.49 +    char   mPrinter[256];       /* Printer name */
    1.50 +    nsCString         mSpoolName;
    1.51 +    nsCOMPtr<nsIFile> mSpoolFile;
    1.52 +};
    1.53 +
    1.54 +class nsPrinterEnumeratorQt : public nsIPrinterEnumerator
    1.55 +{
    1.56 +public:
    1.57 +    nsPrinterEnumeratorQt();
    1.58 +    NS_DECL_ISUPPORTS
    1.59 +    NS_DECL_NSIPRINTERENUMERATOR
    1.60 +};
    1.61 +
    1.62 +#endif /* !nsDeviceContextSpecQt_h___ */

mercurial