widget/qt/nsPrintSettingsQt.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef nsPrintSettingsQt_h_
     8 #define nsPrintSettingsQt_h_
    10 #include <QSharedPointer>
    11 #include "nsPrintSettingsImpl.h"
    12 #define NS_PRINTSETTINGSQT_IID \
    13 {0x5bc4c746, 0x8970, 0x43a3, {0xbf, 0xb1, 0x5d, 0xe1, 0x74, 0xaf, 0x7c, 0xea}}
    15 class QPrinter;
    16 class nsPrintSettingsQt : public nsPrintSettings
    17 {
    18 public:
    19     NS_DECL_ISUPPORTS_INHERITED
    20         NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSQT_IID)
    22     nsPrintSettingsQt();
    23     virtual ~nsPrintSettingsQt();
    25     NS_IMETHOD GetPrintRange(int16_t* aPrintRange);
    26     NS_IMETHOD SetPrintRange(int16_t aPrintRange);
    28     NS_IMETHOD GetStartPageRange(int32_t* aStartPageRange);
    29     NS_IMETHOD SetStartPageRange(int32_t aStartPageRange);
    30     NS_IMETHOD GetEndPageRange(int32_t* aEndPageRange);
    31     NS_IMETHOD SetEndPageRange(int32_t aEndPageRange);
    33     NS_IMETHOD GetPrintReversed(bool* aPrintReversed);
    34     NS_IMETHOD SetPrintReversed(bool aPrintReversed);
    36     NS_IMETHOD GetPrintInColor(bool* aPrintInColor);
    37     NS_IMETHOD SetPrintInColor(bool aPrintInColor);
    39     NS_IMETHOD GetOrientation(int32_t* aOrientation);
    40     NS_IMETHOD SetOrientation(int32_t aOrientation);
    42     NS_IMETHOD GetToFileName(char16_t** aToFileName);
    43     NS_IMETHOD SetToFileName(const char16_t* aToFileName);
    45     NS_IMETHOD GetPrinterName(char16_t** aPrinter);
    46     NS_IMETHOD SetPrinterName(const char16_t* aPrinter);
    48     NS_IMETHOD GetNumCopies(int32_t* aNumCopies);
    49     NS_IMETHOD SetNumCopies(int32_t aNumCopies);
    51     NS_IMETHOD GetScaling(double* aScaling);
    52     NS_IMETHOD SetScaling(double aScaling);
    54     NS_IMETHOD GetPaperName(char16_t** aPaperName);
    55     NS_IMETHOD SetPaperName(const char16_t* aPaperName);
    57     NS_IMETHOD SetUnwriteableMarginInTwips(nsIntMargin& aUnwriteableMargin);
    58     NS_IMETHOD SetUnwriteableMarginTop(double aUnwriteableMarginTop);
    59     NS_IMETHOD SetUnwriteableMarginLeft(double aUnwriteableMarginLeft);
    60     NS_IMETHOD SetUnwriteableMarginBottom(double aUnwriteableMarginBottom);
    61     NS_IMETHOD SetUnwriteableMarginRight(double aUnwriteableMarginRight);
    63     NS_IMETHOD GetPaperWidth(double* aPaperWidth);
    64     NS_IMETHOD SetPaperWidth(double aPaperWidth);
    66     NS_IMETHOD GetPaperHeight(double* aPaperHeight);
    67     NS_IMETHOD SetPaperHeight(double aPaperHeight);
    69     NS_IMETHOD SetPaperSizeUnit(int16_t aPaperSizeUnit);
    71     NS_IMETHOD GetEffectivePageSize(double* aWidth, double* aHeight);
    73 protected:
    74     nsPrintSettingsQt(const nsPrintSettingsQt& src);
    75     nsPrintSettingsQt& operator=(const nsPrintSettingsQt& rhs);
    77     virtual nsresult _Clone(nsIPrintSettings** _retval);
    78     virtual nsresult _Assign(nsIPrintSettings* aPS);
    80     QSharedPointer<QPrinter> mQPrinter;
    81 };
    83 NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintSettingsQt, NS_PRINTSETTINGSQT_IID)
    84 #endif // nsPrintSettingsQt_h_

mercurial