widget/gtk/nsPSPrinters.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 /* ex: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
     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 nsPSPrinters_h___
     8 #define nsPSPrinters_h___
    10 #include "nsString.h"
    11 #include "nsTArray.h"
    13 class nsCUPSShim;
    15 class nsPSPrinterList {
    16     public:
    17         nsPSPrinterList();
    19         /**
    20          * Is the PostScript module enabled or disabled?
    21          * @return true if enabled,
    22          *         false if not.
    23          */
    24         bool Enabled();
    26         /**
    27          * Obtain a list of printers (print destinations) supported by the
    28          * PostScript module, Each entry will be in the form <type>/<name>,
    29          * where <type> is a printer type string, and <name> is the actual
    30          * printer name.
    31          *
    32          * @param aList Upon return, this is populated with the list of
    33          *              printer names as described above, replacing any
    34          *              previous contents. Each entry is a UTF8 string.
    35          *              There should always be at least one entry. The
    36          *              first entry is the default print destination.
    37          */
    38         void GetPrinterList(nsTArray<nsCString>& aList);
    40         enum PrinterType {
    41             kTypeUnknown,         // Not actually handled by the PS module
    42             kTypePS,              // Generic postscript module printer
    43             kTypeCUPS             // CUPS printer
    44         };
    46         /**
    47          * Identify a printer's type from its name.
    48          * @param aName The printer's full name as a UTF8 string, including
    49          *              the <type> portion as described for GetPrinterList().
    50          * @return The PrinterType value for this name.
    51          */
    52         static PrinterType GetPrinterType(const nsACString& aName);
    53 };
    55 #endif /* nsPSPrinters_h___ */

mercurial