|
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/. */ |
|
6 |
|
7 #ifndef nsPSPrinters_h___ |
|
8 #define nsPSPrinters_h___ |
|
9 |
|
10 #include "nsString.h" |
|
11 #include "nsTArray.h" |
|
12 |
|
13 class nsCUPSShim; |
|
14 |
|
15 class nsPSPrinterList { |
|
16 public: |
|
17 nsPSPrinterList(); |
|
18 |
|
19 /** |
|
20 * Is the PostScript module enabled or disabled? |
|
21 * @return true if enabled, |
|
22 * false if not. |
|
23 */ |
|
24 bool Enabled(); |
|
25 |
|
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); |
|
39 |
|
40 enum PrinterType { |
|
41 kTypeUnknown, // Not actually handled by the PS module |
|
42 kTypePS, // Generic postscript module printer |
|
43 kTypeCUPS // CUPS printer |
|
44 }; |
|
45 |
|
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 }; |
|
54 |
|
55 #endif /* nsPSPrinters_h___ */ |