Class WindowsPrinter
java.lang.Object
oshi.hardware.common.AbstractPrinter
oshi.hardware.common.platform.windows.WindowsPrinter
- All Implemented Interfaces:
Printer
Common Windows printer logic shared between JNA and FFM implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Printer
Printer.PrinterStatus -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWindowsPrinter(String name, String driverName, String description, Printer.PrinterStatus status, String statusReason, boolean isDefault, boolean isLocal, String portName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringparseErrorState(int errorState) Converts a DetectedErrorState code to a human-readable string.protected static Printer.PrinterStatusparseStatus(int statusCode, int errorState) Parses Win32_Printer PrinterStatus and DetectedErrorState codes.Methods inherited from class AbstractPrinter
getDescription, getDriverName, getName, getPortName, getStatus, getStatusReason, isDefault, isLocal, toString
-
Constructor Details
-
WindowsPrinter
protected WindowsPrinter(String name, String driverName, String description, Printer.PrinterStatus status, String statusReason, boolean isDefault, boolean isLocal, String portName) Constructor.- Parameters:
name- the namedriverName- the driverNamedescription- the descriptionstatus- the statusstatusReason- the statusReasonisDefault- the isDefaultisLocal- the isLocalportName- the portName
-
-
Method Details
-
parseStatus
Parses Win32_Printer PrinterStatus and DetectedErrorState codes.- Parameters:
statusCode- The PrinterStatus code from WMI.errorState- The DetectedErrorState code from WMI.- Returns:
- The corresponding PrinterStatus enum value.
-
parseErrorState
Converts a DetectedErrorState code to a human-readable string.- Parameters:
errorState- The DetectedErrorState code from WMI.- Returns:
- A string describing the error state.
-