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.PrinterStatusModifier and TypeInterfaceDescriptionstatic enumPrinter status enumeration. -
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, toStringModifier and TypeMethodDescriptionRetrieves the user-friendly description of the printer.Retrieves the driver name or make/model of the printer.getName()Retrieves the name of the printer.Retrieves the port name or device URI of the printer.Retrieves the current status of the printer.Retrieves the reason for the current printer status, if available.booleanIndicates whether this is the default printer.booleanisLocal()Indicates whether this is a local printer (as opposed to a network printer).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.
-