1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/gtk/nsPSPrinters.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* ex: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef nsPSPrinters_h___ 1.11 +#define nsPSPrinters_h___ 1.12 + 1.13 +#include "nsString.h" 1.14 +#include "nsTArray.h" 1.15 + 1.16 +class nsCUPSShim; 1.17 + 1.18 +class nsPSPrinterList { 1.19 + public: 1.20 + nsPSPrinterList(); 1.21 + 1.22 + /** 1.23 + * Is the PostScript module enabled or disabled? 1.24 + * @return true if enabled, 1.25 + * false if not. 1.26 + */ 1.27 + bool Enabled(); 1.28 + 1.29 + /** 1.30 + * Obtain a list of printers (print destinations) supported by the 1.31 + * PostScript module, Each entry will be in the form <type>/<name>, 1.32 + * where <type> is a printer type string, and <name> is the actual 1.33 + * printer name. 1.34 + * 1.35 + * @param aList Upon return, this is populated with the list of 1.36 + * printer names as described above, replacing any 1.37 + * previous contents. Each entry is a UTF8 string. 1.38 + * There should always be at least one entry. The 1.39 + * first entry is the default print destination. 1.40 + */ 1.41 + void GetPrinterList(nsTArray<nsCString>& aList); 1.42 + 1.43 + enum PrinterType { 1.44 + kTypeUnknown, // Not actually handled by the PS module 1.45 + kTypePS, // Generic postscript module printer 1.46 + kTypeCUPS // CUPS printer 1.47 + }; 1.48 + 1.49 + /** 1.50 + * Identify a printer's type from its name. 1.51 + * @param aName The printer's full name as a UTF8 string, including 1.52 + * the <type> portion as described for GetPrinterList(). 1.53 + * @return The PrinterType value for this name. 1.54 + */ 1.55 + static PrinterType GetPrinterType(const nsACString& aName); 1.56 +}; 1.57 + 1.58 +#endif /* nsPSPrinters_h___ */