123456789101112131415161718192021222324252627282930 |
- import Cocoa
- struct KMPrintPrinterModelOptions: OptionSet {
- let rawValue: Int
-
- static let none = KMPrintPrinterModelOptions(rawValue: 1 << 0)
- static let blackAndWhite = KMPrintPrinterModelOptions(rawValue: 1 << 1)
- static let printOnBothSides = KMPrintPrinterModelOptions(rawValue: 1 << 2)
- static let all: KMPrintPrinterModelOptions = [.blackAndWhite, .printOnBothSides]
- }
- enum KMPrintPrinterOnBothSidesType: String, CaseIterable {
- case long = "Flip on long edge"
- case short = "Flip on short edge"
- }
- class KMPrintPrinterModel: NSObject {
- var name: String = NSPrinter.printerNames.first ?? "无打印机"
- var copies: Int = 1
- var options: KMPrintPrinterModelOptions = .none
- var onBothSidesType: KMPrintPrinterOnBothSidesType = .long
- }
|