123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- //
- // KMBatchOperateBaseWindowController.swift
- // PDF Reader Pro
- //
- // Created by kdanmobile on 2023/10/26.
- //
- import Cocoa
- @objcMembers class KMBatchOperateBaseWindowController: KMNBaseWindowController{
- var files: [KMBatchOperateFile]?
- var operateType: KMBatchOperationType?{
- willSet{
-
- }
- didSet {
- switch operateType {
- case .Convert:
- self.window!.title = NSLocalizedString("Convert", comment: "")
- case .Merge:
- self.window!.title = NSLocalizedString("Merge", comment: "")
- case .Compress:
- self.window!.title = NSLocalizedString("Compress", comment: "")
- case .AddPassword:
- self.window!.title = NSLocalizedString("Set Passwords", comment: "")
- case .RemovePassword:
- self.window!.title = NSLocalizedString("Remove Security", comment: "")
- case .AddWatermark:
- self.window!.title = NSLocalizedString("Add Watermark", comment: "")
- case .RemoveWatermark:
- self.window!.title = NSLocalizedString("Remove Watermark", comment: "")
- case .AddBackground:
- self.window!.title = NSLocalizedString("Add Background", comment: "")
- case .RemoveBackground:
- self.window!.title = NSLocalizedString("Remove Background", comment: "")
- case .AddHeaderFooter:
- self.window!.title = NSLocalizedString("Add Header & Footer", comment: "")
- case .RemoveHeaderFooter:
- self.window!.title = NSLocalizedString("Remove Header & Footer", comment: "")
- case .AddBates:
- self.window!.title = NSLocalizedString("Add Bates Numbers", comment: "")
- case .RemoveBates:
- self.window!.title = NSLocalizedString("Remove Bates Numbers", comment: "")
- case .CreatePDF:
- self.window!.title = NSLocalizedString("", comment: "")
- default :
- self.window!.title = NSLocalizedString("Convert", comment: "")
- }
- }
- }
-
- override func windowDidLoad() {
- super.windowDidLoad()
- self.configuUI()
- files = NSMutableArray() as? [KMBatchOperateFile]
-
- window?.titlebarAppearsTransparent = true
- }
-
- override func updateUIThemeColor() {
- super.updateUIThemeColor()
-
- KMMainThreadExecute {
- self.window?.backgroundColor = KMNColorTools.colorBg_layoutMiddle()
- }
- }
-
- func configuUI() {
- let splitViewController = KMBatchOperateSplitViewController(nibName: "KMBatchOperateSplitViewController", bundle: nil)
- contentViewController = splitViewController
- }
- func switchToOperateType(_ operateType: KMBatchOperationType, files: [KMBatchOperateFile]) {
- self.files = files
- (self.contentViewController as? KMBatchOperateSplitViewController)?.switchToOperateType(operateType: operateType, files: files)
- self.operateType = operateType
- }
- func checkNeedPasswordSwitchToOperateType(operateType: KMBatchOperationType, files: [KMBatchOperateFile]) {
- self.files = files
- (self.contentViewController as! KMBatchOperateSplitViewController).checkNeedPasswordSwitchToOperateType(operateType, files: files)
- self.operateType = operateType
- }
- func switchToConvertType(convertType: KMConvertWithPDFType) {
- (self.contentViewController as! KMBatchOperateSplitViewController).switchToConvertType(convertType)
- }
-
- func backgroundInterfaceSelectBackGround(background: KMBackgroundModel) {
- (self.contentViewController as! KMBatchOperateSplitViewController).backgroundInterfaceSelectBackground(background)
- }
- func headerFooterInterfaceSelectHeaderFooter(headerFooter: KMHeaderFooterModel) {
- (self.contentViewController as! KMBatchOperateSplitViewController).headerFooterInterfaceSelectHeaderFooter(headerFooter)
- }
- func batesInterfaceSelectBates(headerFooter: KMHeaderFooterModel) {
- (self.contentViewController as! KMBatchOperateSplitViewController).headerFooterInterfaceSelectHeaderFooter(headerFooter)
- }
-
-
-
- }
|