Blame widget/gtk/nsPSPrinters.h

Packit f0b94e
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
Packit f0b94e
/* ex: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
Packit f0b94e
/* This Source Code Form is subject to the terms of the Mozilla Public
Packit f0b94e
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit f0b94e
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Packit f0b94e
Packit f0b94e
#ifndef nsPSPrinters_h___
Packit f0b94e
#define nsPSPrinters_h___
Packit f0b94e
Packit f0b94e
#include "nsString.h"
Packit f0b94e
#include "nsTArray.h"
Packit f0b94e
Packit f0b94e
class nsPSPrinterList {
Packit f0b94e
 public:
Packit f0b94e
  nsPSPrinterList();
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * Is the PostScript module enabled or disabled?
Packit f0b94e
   * @return true if enabled,
Packit f0b94e
   *         false if not.
Packit f0b94e
   */
Packit f0b94e
  bool Enabled();
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * Obtain a list of printers (print destinations) supported by the
Packit f0b94e
   * PostScript module, Each entry will be in the form <type>/<name>,
Packit f0b94e
   * where <type> is a printer type string, and <name> is the actual
Packit f0b94e
   * printer name.
Packit f0b94e
   *
Packit f0b94e
   * @param aList Upon return, this is populated with the list of
Packit f0b94e
   *              printer names as described above, replacing any
Packit f0b94e
   *              previous contents. Each entry is a UTF8 string.
Packit f0b94e
   *              There should always be at least one entry. The
Packit f0b94e
   *              first entry is the default print destination.
Packit f0b94e
   */
Packit f0b94e
  void GetPrinterList(nsTArray<nsCString>& aList);
Packit f0b94e
Packit f0b94e
  enum PrinterType {
Packit f0b94e
    kTypeUnknown,  // Not actually handled by the PS module
Packit f0b94e
    kTypePS,       // Generic postscript module printer
Packit f0b94e
    kTypeCUPS      // CUPS printer
Packit f0b94e
  };
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * Identify a printer's type from its name.
Packit f0b94e
   * @param aName The printer's full name as a UTF8 string, including
Packit f0b94e
   *              the <type> portion as described for GetPrinterList().
Packit f0b94e
   * @return The PrinterType value for this name.
Packit f0b94e
   */
Packit f0b94e
  static PrinterType GetPrinterType(const nsACString& aName);
Packit f0b94e
};
Packit f0b94e
Packit f0b94e
#endif /* nsPSPrinters_h___ */