1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318 |
- //
- // AppDelegate+MenuAction.swift
- // PDF Reader Pro
- //
- // Created by Niehaoyu on 2025/1/2.
- //
- import Foundation
- //MARK: - NSMenuDelegate
- extension AppDelegate: NSMenuDelegate, NSMenuItemValidation {
-
- func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
- let action = menuItem.action
-
- if self.isPDFReaderProMenuActions(sel: action) {
- return self.validatePDFReaderProMenuItem(menuItem)
-
- } else if self.isFileMenuActions(sel: action) {
- return self.validateFileMenuItem(menuItem)
-
- } else if self.isEditMenuActions(sel: action) {
- return self.validateEditMenuItem(menuItem)
-
- } else if self.isViewMenuActions(sel: action) {
- return self.validateViewMenuItem(menuItem)
-
- } else if self.isGoMenuActions(sel: action) {
- return self.validateGoMenuItem(menuItem)
-
- } else if self.isWindowMenuActions(sel: action) {
- return self.validateWindowMenuItem(menuItem)
-
- } else if self.isHelpMenuActions(sel: action) {
- return self.validateHelpMenuItem(menuItem)
-
- }
- return false
- }
-
- func menu(_ menu: NSMenu, update item: NSMenuItem, at index: Int, shouldCancel: Bool) -> Bool {
- return true
- }
-
- // MARK: - update Menu
- func initMainMenu() {
- // 处理菜单栏多语
- let mainMenu = NSApp.mainMenu
- if (mainMenu == nil) {
- return
- }
- for menu in mainMenu!.items {
- let subMenu = menu.submenu
- for item in subMenu!.items {
- item.title = KMLocalizedString(item.title, comment: "")
- let itemSubMenu = item.submenu
- if (itemSubMenu == nil) {
- continue
- }
-
- for item in itemSubMenu!.items {
- item.title = KMLocalizedString(item.title, comment: "")
-
- let itemSubMenu = item.submenu
- if (itemSubMenu == nil) {
- continue
- }
-
- for item in itemSubMenu!.items {
- item.title = KMLocalizedString(item.title, comment: "")
- }
- }
- }
- }
-
- //appMenu
- let appMenu = mainMenu?.item(at: 0)?.submenu
- if let item = appMenu?.item(at: 0) {
- item.title = KMLocalizedString("About") + " " + KMNAppName
- }
-
- //Share Item
- let fileMenu = mainMenu?.item(at: 1)?.submenu
- for item in fileMenu?.items ?? [] {
- if item.action == NSSelectorFromString("menuItemAction_showInFinder:") {
- let shareItem: NSMenuItem? = NSMenuItem(title: KMLocalizedString("Share"), action: nil, target: nil)
- fileMenu?.insertItem(shareItem!, at: item.index)
- shareItem?.submenu = NSSharingServicePicker.menu(forSharingItems: [""], subjectContext: "", withTarget: self, selector: #selector(sharePageItemAction), serviceDelegate: nil)
- }
- }
-
- self.updateAppMenu()
-
- }
-
- @objc func sharePageItemAction(sender: NSMenuItem) {
- if ((NSApp.mainWindow?.windowController is KMBrowserWindowController) == false) {
- return
- }
-
- let windowControler = NSApp.mainWindow?.windowController as! KMBrowserWindowController
- let model = windowControler.browser?.tabStripModel
- if let cnt = model?.count(), cnt <= 0 {
- return
- }
-
- if let data = model?.activeTabContents()?.isHome, data {
- return
- }
-
- let document: KMMainDocument = model?.activeTabContents() as! KMMainDocument
- if let data = document.mainViewController?.saveWatermarkFlag, !data {
- let represent : NSSharingService = sender.representedObject as! NSSharingService
- represent.perform(withItems: [document.fileURL as Any])
- return
- }
-
- let represent : NSSharingService = sender.representedObject as! NSSharingService
- represent.perform(withItems: [document.fileURL as Any])
- }
-
-
- @objc func accountRefreshAction() {
-
-
- }
-
- }
- // MARK: - PDF Reader Pro Menu
- extension AppDelegate {
-
- func isPDFReaderProMenuActions(sel: Selector?) -> Bool {
- guard let selector = sel else {
- return false
- }
- let selectors = [NSSelectorFromString("menuItemAction_openPreferenceWindow:"),
- NSSelectorFromString("menuItemAction_loginMenuItemAction:"),
- NSSelectorFromString("menuItemAction_logoutMenuItemAction:"),
- NSSelectorFromString("menuItemAction_buyNowItemAction:"),
- NSSelectorFromString("menuItemAction_restoreMenuItemAction:"),
- NSSelectorFromString("menuItemAction_EducationDiscountAction:"),
- NSSelectorFromString("menuItemAction_volumeDiscount:")]
- if selectors.contains(selector) {
- return true
- }
- return false
- }
-
- func validatePDFReaderProMenuItem(_ menuItem: NSMenuItem) -> Bool {
- updateAppMenu()
-
- return true
- }
-
- //MARK: -IBAction
- @IBAction func menuItemAction_openPreferenceWindow(_ sender: Any) {
- SettingsWindowController.shared.showWindow(self)
- }
-
- @IBAction func menuItemAction_loginMenuItemAction(_ sender: Any) {
- if KMMemberInfo.shared.isLogin {
- KMUserInfoVCModel().skipAccountCenter()
- } else {
- KMLoginWindowsController.shared.showWindow(nil)
- }
- }
-
- @IBAction func menuItemAction_logoutMenuItemAction(_ sender: Any) {
- KMUserInfoVCModel().signOutAction()
- }
-
- @IBAction func menuItemAction_buyNowItemAction(_ sender: Any) {
-
- }
-
- @IBAction func menuItemAction_restoreMenuItemAction(_ sender: Any) {
-
- }
-
- @IBAction func menuItemAction_EducationDiscountAction(_ sender: NSMenuItem) {
- KMTools.openEducateWebSite()
- }
-
- @IBAction func menuItemAction_volumeDiscount(_ sender: NSMenuItem) {
- KMTools.openVPPWebSite()
- }
-
- func updateAppMenu() {
- guard let mainMenu = NSApp.mainMenu else {
- return
- }
-
- for item in mainMenu.items {
- for subItem in item.submenu?.items ?? [] {
- if subItem.action == NSSelectorFromString("menuItemAction_loginMenuItemAction:") {
- if KMMemberInfo.shared.isLogin {
- subItem.title = KMMemberInfo.shared.userEmail
- } else {
- subItem.title = KMLocalizedString("Login")
- }
- } else if subItem.action == NSSelectorFromString("menuItemAction_logoutMenuItemAction:") {
- subItem.isHidden = KMMemberInfo.shared.isLogin ? false : true
- }
- #if VERSION_BETA
- if subItem.action == NSSelectorFromString("menuItemAction_buyNowItemAction:") {
- subItem.isHidden = true
- } else if subItem.action == NSSelectorFromString("menuItemAction_restoreMenuItemAction:") {
- subItem.isHidden = true
- } else if subItem.action == NSSelectorFromString("menuItemAction_EducationDiscountAction:") {
- subItem.isHidden = true
- } else if subItem.action == NSSelectorFromString("menuItemAction_volumeDiscount:") {
- subItem.isHidden = true
- } else if subItem.action == NSSelectorFromString("menuItemAction_FiveStar:") {
- subItem.isHidden = true
- } else if subItem.action == NSSelectorFromString("menuItemAction_CheckForUpdate:") {
- subItem.isHidden = true
- } else if subItem.action == NSSelectorFromString("menuItemAction_VPP:") {
- subItem.isHidden = true
- }
- #endif
- }
- }
-
-
- }
- }
- //MARK: - File Menu
- extension AppDelegate {
- func isFileMenuActions(sel: Selector?) -> Bool {
- guard let selector = sel else {
- return false
- }
- let selectors = [NSSelectorFromString("menuItemAction_NewFromFile:"),
- NSSelectorFromString("menuItemAction_Open:"),
- NSSelectorFromString("menuItemAction_NewTab:"),
- NSSelectorFromString("menuItemAction_NewWindow:"),
- NSSelectorFromString("menuItemAction_NewFromWeb:"),
- NSSelectorFromString("menuItemAction_NewFromClipboard:"),
- NSSelectorFromString("menuItemAction_NewFromScanner:"),
- NSSelectorFromString("menuItemAction_NewFromBlankPage:"),
- NSSelectorFromString("menuItemAction_NewFromWindow:"),
- NSSelectorFromString("menuItemAction_MergePDFFiles:"),
- NSSelectorFromString("menuItemAction_closeDocument:"),
- NSSelectorFromString("menuItemAction_closeWindow:"),
- NSSelectorFromString("menuItemAction_closeAllWindows:"),
- NSSelectorFromString("menuItemClick_saveAsFlattenedPDF:"),
- NSSelectorFromString("menuItemClick_Compress:"),
- NSSelectorFromString("menuItemAction_ConvertTo:"),
- NSSelectorFromString("menuItemAction_addPassword:"),
- NSSelectorFromString("menuItemAction_removePassword:"),
- NSSelectorFromString("menuItemAction_unlockFunction:"),
- NSSelectorFromString("menuItemAction_searchPDF:"),
- NSSelectorFromString("menuItemAction_performFindPanelAction:"),
- NSSelectorFromString("menuItemAction_showInFinder:"),
- NSSelectorFromString("menuItemAction_property:"),
- NSSelectorFromString("menuItemAction_print:"),
- NSSelectorFromString("menuItemAction_customPrint:"),
- NSSelectorFromString("sharePageItemActionWithSender:")]
- if selectors.contains(selector) {
- return true
- }
- return false
- }
-
- func validateFileMenuItem(_ menuItem: NSMenuItem) -> Bool {
- let action = menuItem.action
-
- if action == NSSelectorFromString("menuItemAction_NewFromFile:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_NewFromWeb:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_NewFromClipboard:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_NewFromScanner:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_NewFromBlankPage:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_NewFromWindow:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_MergePDFFiles:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_closeDocument:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_closeWindow:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_closeAllWindows:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_Open:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_NewTab:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_NewWindow:") {
- return true
- }
-
- if let mainVC = self.mainViewController() {
- if action == NSSelectorFromString("menuItemClick_saveAsFlattenedPDF:") {
-
- } else if action == NSSelectorFromString("menuItemClick_Compress:") {
-
- } else if action == NSSelectorFromString("menuItemAction_ConvertTo:") {
-
- } else if action == NSSelectorFromString("menuItemAction_addPassword:") {
-
- } else if action == NSSelectorFromString("menuItemAction_removePassword:") {
- if mainVC.listView.document.isLocked == true {
- return true
- } else {
- if let pw = mainVC.listView.document.password {
- return true
- }
- return false
- }
- } else if action == NSSelectorFromString("menuItemAction_unlockFunction:") {
- return mainVC.listView.document.isEncrypted
- } else if action == NSSelectorFromString("menuItemAction_searchPDF:") {
-
- } else if action == NSSelectorFromString("menuItemAction_performFindPanelAction:") {
-
- } else if action == NSSelectorFromString("menuItemAction_showInFinder:") {
-
- } else if action == NSSelectorFromString("menuItemAction_property:") {
-
- } else if action == NSSelectorFromString("menuItemAction_print:") {
- return mainVC.validPrint()
- } else if action == NSSelectorFromString("menuItemAction_customPrint:") {
-
- } else if action == NSSelectorFromString("sharePageItemActionWithSender:") {
- return true
- }
- return true
- }
- return false
- }
-
- //MARK: -IBAction
- @IBAction func menuItemAction_Open(_ sender: NSMenuItem) -> Void {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.newFromPDFFile()
- }
- }
-
- @IBAction func menuItemAction_NewTab(_ sender: NSMenuItem) -> Void {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.openDocumentWindow()
- }
- }
-
- @IBAction func menuItemAction_NewWindow(_ sender: NSMenuItem) -> Void {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- let browser: KMBrowser = KMBrowser.init()
- browser.windowController = KMBrowserWindowController.init(browser: browser)
- browser.addHomeTabContents()
- browser.windowController.window?.center()
- browser.windowController.showWindow(self)
- }
- }
-
- @IBAction func menuItemAction_NewFromFile(_ sender: NSMenuItem) -> Void {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.newFromFile()
- }
- }
-
- @IBAction func menuItemAction_NewFromWeb(_ sender: NSMenuItem) -> Void {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.newFromWebPage()
- }
- }
-
- @IBAction func menuItemAction_NewFromClipboard(_ sender: NSMenuItem) -> Void {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.newFromClipboard()
- }
- }
-
- @IBAction func menuItemAction_NewFromScanner(_ sender: NSMenuItem) -> Void {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.importFromScanner()
- }
- }
-
- @IBAction func menuItemAction_NewFromBlankPage(_ sender: NSMenuItem) -> Void {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.newBlankPage()
- }
- }
-
- @IBAction func menuItemAction_NewFromWindow(_ sender: NSMenuItem) -> Void {
- if sender.tag == 0 {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.screenShot_SelectArea(nil)
- }
- } else if sender.tag == 1 {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.screenShot_Window(nil)
- }
- } else if sender.tag == 2 {
- if let _windowC = NSApp.mainWindow?.windowController as? KMBrowserWindowController {
- _windowC.screenShot_FullScreen(nil)
- }
- }
- }
-
- @IBAction func menuItemAction_MergePDFFiles(_ sender: NSMenuItem) -> Void {
- if let homeVC = self.homeViewController() {
- homeVC.fastTool_MergePDF()
- } else if let mainVC = self.mainViewController() {
- mainVC.showMergeWindow()
- }
- }
-
- @IBAction func menuItemAction_closeDocument(_ sender: Any) {
- if ((NSApp.mainWindow?.windowController is KMBrowserWindowController) == false) {
- guard let windowControler = NSApp.mainWindow?.windowController else {
- return
- }
- windowControler.window?.performClose(nil)
- return
- }
-
- let windowControler = NSApp.mainWindow?.windowController as? KMBrowserWindowController
- if let data = windowControler?.browser, data.tabCount() >= 2 { // 有两个以上的标签
- if data.activeTabIndex() == 0 { // 主页不允许关闭,暂时处理为无反应
- return
- }
- }
-
- if let browser = windowControler?.browser {
- if browser.tabCount() == 1 {
- windowControler?.window?.close()
- } else {
- if let _ = windowControler?.window?.attachedSheet {
- NSSound.beep()
- return
- }
- browser.closeTab()
- }
- } else {
- windowControler?.window?.close()
- }
- }
-
- @IBAction func menuItemAction_closeWindow(_ sender: Any) {
- if let windowVC = self.currentBrowserWindowController() {
- if windowVC.browser != nil {
- windowVC.browser.closeAllTabs()
- }
- }
- }
-
- @IBAction func menuItemAction_closeAllWindows(_ sender: Any) {
- for window in NSApp.windows {
- if let windowVC = window.windowController as? KMBrowserWindowController {
- if windowVC.browser != nil {
- windowVC.browser.closeAllTabs()
- }
- }
- }
- }
-
- @IBAction func menuItemClick_saveAsFlattenedPDF(_ sender: Any) {
- if let mainVC = self.mainViewController() {
- mainVC.saveAsFlattenedPDFAction()
- }
- }
-
- @IBAction func menuItemClick_Compress(_ sender: Any) {
- if let mainVC = self.mainViewController() {
-
- let model = KMBatchProcessingTableViewModel.initWithFilePath(url: mainVC.listView.document.documentURL)
- model.password = mainVC.listView.document.password ?? ""
-
- mainVC.showCompressController(model: model)
- }
- }
-
- @IBAction func menuItemAction_ConvertTo(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- var convertType: KMPDFConvertType = .word
- if sender.tag == 0 {
-
- } else if sender.tag == 1 {
- convertType = .excel
- } else if sender.tag == 2 {
- convertType = .ppt
- } else if sender.tag == 30 {
- convertType = .jpeg
- } else if sender.tag == 31 {
- convertType = .jpg
- } else if sender.tag == 32 {
- convertType = .png
- } else if sender.tag == 33 {
- convertType = .gif
- } else if sender.tag == 34 {
- convertType = .tiff
- } else if sender.tag == 35 {
- convertType = .tga
- } else if sender.tag == 36 {
- convertType = .bmp
- } else if sender.tag == 37 {
- convertType = .jp2
- } else if sender.tag == 4 {
- convertType = .rtf
- } else if sender.tag == 5 {
- convertType = .csv
- } else if sender.tag == 6 {
- convertType = .html
- } else if sender.tag == 7 {
- convertType = .text
- } else if sender.tag == 8 {
- convertType = .json
- }
- mainVC.showConvertWindow(convertType)
- }
- }
-
- @IBAction func menuItemAction_addPassword(_ sender: Any) {
- if let mainVC = self.mainViewController() {
- mainVC.showSecureWindow()
- }
- }
-
- @IBAction func menuItemAction_removePassword(_ sender: Any) {
- if let mainVC = self.mainViewController() {
- mainVC.showRemoveSecureWindow()
- }
- }
-
- @IBAction func menuItemAction_unlockFunction(_ sender: Any) {
- if let mainVC = self.mainViewController() {
- mainVC.unlockPDFDocument()
- }
- }
-
- @IBAction func menuItemAction_searchPDF(_ sender: Any?) {
- if let mainVC = self.mainViewController() {
- mainVC.searchPDF()
- }
- }
-
- @IBAction func menuItemAction_performFindPanelAction(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if sender.tag == 0 {
- mainVC.find_ReplacePDF()
- } else if sender.tag == 1 {
- mainVC.fineNext()
- } else if sender.tag == 2 {
- mainVC.findPrevious()
- } else if sender.tag == 3 {
- mainVC.useSelectionForFind()
- }
- }
- }
-
- @IBAction func menuItemAction_showInFinder(_ sender: Any) {
- if let mainVC = self.mainViewController() {
- mainVC.showInFinder()
- }
- }
-
- @IBAction func menuItemAction_property(_ sender: Any) {
- if let mainVC = self.mainViewController() {
- KMInfoWindowController.shared.showWindow(sender)
- }
- }
-
- @IBAction func menuItemAction_print(_ sender: Any) {
- if let mainVC = self.mainViewController() {
- mainVC.showPrintWindow()
- }
- }
-
- @IBAction func menuItemAction_customPrint(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if sender.tag == 0 {
- mainVC.showPosterPrintWindow()
- } else if sender.tag == 1 {
- mainVC.showMultiplePrintWindow()
- } else if sender.tag == 2 {
- mainVC.showBookletPrintWindow()
- }
- }
- }
-
- }
- // MARK: - Edit Menu
- extension AppDelegate {
- func isEditMenuActions(sel: Selector?) -> Bool {
- guard let selector = sel else {
- return false
- }
- let selectors = [ NSSelectorFromString("menuItemAction_PasteAndMatch:"),
- NSSelectorFromString("menuItemAction_ShowFont:"),
- NSSelectorFromString("menuItemAction_FontAction:"),
- NSSelectorFromString("menuItemAction_CustomFont:"),
- NSSelectorFromString("menuItemAction_FontAlign:")]
- if selectors.contains(selector) {
- return true
- }
- return false
- }
-
- func validateEditMenuItem(_ menuItem: NSMenuItem) -> Bool {
- let action = menuItem.action
- if let mainVC = self.mainViewController() {
- if action == NSSelectorFromString("menuItemAction_PasteAndMatch:") {
- if mainVC.listView.isEditing() {
- if mainVC.listView.isSupportPast() {
- return true
- }
- }
- return false
- } else if action == NSSelectorFromString("menuItemAction_ShowFont:") {
- if mainVC.viewManager.toolMode == .Edit {
- if mainVC.viewManager.subToolMode == .None || mainVC.viewManager.subToolMode == .Edit_text {
- if mainVC.listView.km_editingTextAreas().count > 0 {
- return true
- }
- }
- }
- return false
- } else if action == NSSelectorFromString("menuItemAction_FontAction:") {
- if mainVC.viewManager.toolMode == .Edit {
- if mainVC.viewManager.subToolMode == .None || mainVC.viewManager.subToolMode == .Edit_text {
- if mainVC.listView.km_editingTextAreas().count > 0 {
- return true
- }
- }
- }
- return false
- } else if action == NSSelectorFromString("menuItemAction_CustomFont:") {
- if mainVC.viewManager.toolMode == .Edit {
- if mainVC.viewManager.subToolMode == .None || mainVC.viewManager.subToolMode == .Edit_text {
- if mainVC.listView.km_editingTextAreas().count > 0 {
- return true
- }
- }
- }
- return false
- } else if action == NSSelectorFromString("menuItemAction_FontAlign:") {
- if mainVC.listView.isEditing() == true {
- if mainVC.listView.km_editingTextAreas().count > 0 {
- return true
- }
- } else {
- if let freeTextAnnotation = mainVC.listView.activeAnnotation as? CPDFFreeTextAnnotation {
- return true
- }
- }
- return false
- }
- return true
- }
- return false
- }
-
- //MARK: -IBAction
-
-
- @IBAction func menuItemAction_PasteAndMatch(_ menuItem: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if mainVC.listView.isEditing() == true {
- if mainVC.listView.isSupportPast() {
- mainVC.listView.pasteEditAreaAction()
- }
- }
- }
- }
-
- @IBAction func menuItemAction_ShowFont(_ menuItem: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.menuItemAction_FontPanel()
- }
- }
-
- @IBAction func menuItemAction_FontAction(_ menuItem: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.menuItemAction_FontAction(menuItem.tag)
- }
- }
-
- @IBAction func menuItemAction_CustomFont(_ menuItem: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.menuItemAction_CustomFont(menuItem.tag)
- }
- }
-
- @IBAction func menuItemAction_FontAlign(_ menuItem: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.menuItemAction_FontAlign(menuItem.tag)
- }
- }
-
-
- }
- // MARK: - View Menu
- extension AppDelegate {
- func isViewMenuActions(sel: Selector?) -> Bool {
- guard let selector = sel else {
- return false
- }
- let selectors = [NSSelectorFromString("menuItemAction_ChangeDisplayMode:"),
- NSSelectorFromString("menuItemAction_ReadMode:"),
- NSSelectorFromString("menuItemAction_FullScreen:"),
- NSSelectorFromString("menuItemAction_Presentation:"),
- NSSelectorFromString("menuItemAction_SplitView:"),
- NSSelectorFromString("menuItemAction_BOTAMode:"),
- NSSelectorFromString("menuItemAction_Outline:"),
- NSSelectorFromString("menuItemAction_Notes:"),
- NSSelectorFromString("menuItemAction_Annotate:"),
- NSSelectorFromString("menuItemAction_Themes:"),
- NSSelectorFromString("menuItemAction_Zoom:"),
- NSSelectorFromString("menuItemAction_Rotate:"),
- NSSelectorFromString("menuItemAction_HighlightFormsField:"),
- NSSelectorFromString("menuItemAction_HighlightLinks:"),
- NSSelectorFromString("menuItemAction_ResetForm:"),
- NSSelectorFromString("menuItemAction_AutoScroll:")]
- if selectors.contains(selector) {
- return true
- }
- return false
- }
-
- func validateViewMenuItem(_ menuItem: NSMenuItem) -> Bool {
- let action = menuItem.action
- if action == NSSelectorFromString("menuItemAction_FullScreen:") {
- return true
- }
-
- if let mainVC = self.mainViewController() {
- if action == NSSelectorFromString("menuItemAction_ChangeDisplayMode:") {
- menuItem.state = .off
- if menuItem.tag == 1 && mainVC.getPDFViewPageLayoutType() == .singlePage {
- menuItem.state = .on
- } else if menuItem.tag == 2 && mainVC.getPDFViewPageLayoutType() == .singlePageContinue {
- menuItem.state = .on
- } else if menuItem.tag == 3 && mainVC.getPDFViewPageLayoutType() == .twoPage {
- menuItem.state = .on
- } else if menuItem.tag == 4 && mainVC.getPDFViewPageLayoutType() == .twoPageContinue {
- menuItem.state = .on
- } else if menuItem.tag == 5 && mainVC.getPDFViewPageLayoutType() == .bookMode {
- menuItem.state = .on
- }
- } else if action == NSSelectorFromString("menuItemAction_ReadMode:") {
- menuItem.state = .off
- if mainVC.viewManager.isPDFReadMode == true {
- menuItem.state = .on
- }
- } else if action == NSSelectorFromString("menuItemAction_Presentation:") {
-
- } else if action == NSSelectorFromString("menuItemAction_SplitView:") {
- menuItem.state = .off
- if menuItem.tag == 0 && mainVC.listView.viewSplitMode == .vertical {
- menuItem.state = .on
- } else if menuItem.tag == 1 && mainVC.listView.viewSplitMode == .horizontal {
- menuItem.state = .on
- } else if menuItem.tag == 2 && mainVC.listView.viewSplitMode == .disable {
- menuItem.state = .on
- }
- } else if action == NSSelectorFromString("menuItemAction_BOTAMode:") {
- menuItem.state = .off
- if menuItem.tag == 0 && mainVC.viewManager.pdfSideBarType == .thumbnail {
- menuItem.state = .on
- } else if menuItem.tag == 1 && mainVC.viewManager.pdfSideBarType == .outline {
- menuItem.state = .on
- } else if menuItem.tag == 2 && mainVC.viewManager.pdfSideBarType == .bookmark {
- menuItem.state = .on
- } else if menuItem.tag == 3 && mainVC.viewManager.pdfSideBarType == .annotation {
- menuItem.state = .on
- } else if menuItem.tag == 4 && mainVC.viewManager.pdfSideBarType == .search {
- menuItem.state = .on
- }
- } else if action == NSSelectorFromString("menuItemAction_Themes:") {
- menuItem.state = .off
- if menuItem.tag == 0 && mainVC.listView.displayMode == .normal {
- menuItem.state = .on
- } else if menuItem.tag == 1 && mainVC.listView.displayMode == .soft {
- menuItem.state = .on
- } else if menuItem.tag == 2 && mainVC.listView.displayMode == .green {
- menuItem.state = .on
- } else if menuItem.tag == 3 && mainVC.listView.displayMode == .night {
- menuItem.state = .on
- }
- } else if action == NSSelectorFromString("menuItemAction_Zoom:") {
-
- } else if action == NSSelectorFromString("menuItemAction_Rotate:") {
-
- } else if action == NSSelectorFromString("menuItemAction_HighlightFormsField:") {
- let enabled = CPDFKitConfig.sharedInstance().enableFormFieldHighlight()
- menuItem.state = enabled ? .on : .off
- } else if action == NSSelectorFromString("menuItemAction_HighlightLinks:") {
- let enabled = CPDFKitConfig.sharedInstance().enableLinkFieldHighlight()
- menuItem.state = enabled ? .on : .off
- } else if action == NSSelectorFromString("menuItemAction_ResetForm:") {
-
- } else if action == NSSelectorFromString("menuItemAction_AutoScroll:") {
- menuItem.state = mainVC.isAutoFlowOn() ? .on : .off
- }
- return true
- }
- return false
- }
-
- //MARK: -IBAction
- @IBAction func menuItemAction_ChangeDisplayMode(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if sender.tag == 1 {
- mainVC.updatePDFViewDisplayMode(viewMode: .singlePage)
- } else if sender.tag == 2 {
- mainVC.updatePDFViewDisplayMode(viewMode: .singlePageContinuous)
- } else if sender.tag == 3 {
- mainVC.updatePDFViewDisplayMode(viewMode: .twoUp)
- } else if sender.tag == 4 {
- mainVC.updatePDFViewDisplayMode(viewMode: .twoUpContinuous)
- } else if sender.tag == 5 {
- mainVC.updatePDFViewDisplayMode(isbookMode: true)
- }
- }
- }
-
- @IBAction func menuItemAction_ReadMode(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.viewManager.isPDFReadMode = !mainVC.viewManager.isPDFReadMode
- if mainVC.viewManager.isPDFReadMode {
- mainVC.openPDFReadMode()
- } else {
- mainVC.exitPDFReadMode()
- }
- }
- }
-
- @IBAction func menuItemAction_FullScreen(_ sender: NSMenuItem) {
- NSApp.mainWindow?.toggleFullScreen(nil)
- }
-
- @IBAction func menuItemAction_Presentation(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.togglePresentation(nil)
- }
- }
-
- @IBAction func menuItemAction_SplitView(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if sender.tag == 0 {
- if KMMemberInfo.shared.isLogin == false {
- KMLoginWindowsController.shared.showWindow(nil)
- return
- }
- mainVC.listView.viewSplitMode = .vertical
- } else if sender.tag == 1 {
- if KMMemberInfo.shared.isLogin == false {
- KMLoginWindowsController.shared.showWindow(nil)
- return
- }
- mainVC.listView.viewSplitMode = .horizontal
- } else if sender.tag == 2 {
- mainVC.listView.viewSplitMode = .disable
- }
- mainVC.reloadPDFSplitInfo()
- }
- }
-
- @IBAction func menuItemAction_BOTAMode(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if sender.tag == 0 {
- if mainVC.viewManager.pdfSideBarType == .thumbnail {
- mainVC.viewManager.pdfSideBarType = .none
- } else {
- mainVC.viewManager.pdfSideBarType = .thumbnail
- }
- } else if sender.tag == 1 {
- if mainVC.viewManager.pdfSideBarType == .outline {
- mainVC.viewManager.pdfSideBarType = .none
- } else {
- mainVC.viewManager.pdfSideBarType = .outline
- }
- } else if sender.tag == 2 {
- if mainVC.viewManager.pdfSideBarType == .bookmark {
- mainVC.viewManager.pdfSideBarType = .none
- } else {
- mainVC.viewManager.pdfSideBarType = .bookmark
- }
- } else if sender.tag == 3 {
- if mainVC.viewManager.pdfSideBarType == .annotation {
- mainVC.viewManager.pdfSideBarType = .none
- } else {
- mainVC.viewManager.pdfSideBarType = .annotation
- }
- } else if sender.tag == 4 {
- if mainVC.viewManager.pdfSideBarType == .search {
- mainVC.viewManager.pdfSideBarType = .none
- } else {
- mainVC.viewManager.pdfSideBarType = .search
- }
- }
- if mainVC.viewManager.pdfSideBarType == .none {
- mainVC.toggleCloseLeftSide()
- } else {
- mainVC.toggleOpenLeftSide(pdfSideBarType: mainVC.viewManager.pdfSideBarType)
- }
- mainVC.reloadSideBar()
- }
- }
-
-
- @IBAction func menuItemAction_Themes(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- var model: KMPDFViewMode = .normal
- var color = NSColor.clear
-
- if sender.tag == 0 {
- model = .normal
- } else if sender.tag == 1 {
- model = .soft
- } else if sender.tag == 2 {
- model = .green
- } else if sender.tag == 3 {
- model = .night
- } else {
- model = .other
- }
- if KMMemberInfo.shared.isLogin == false, model != .normal {
- KMLoginWindowsController.shared.showWindow(nil)
- return
- }
- mainVC.listView.setPageBackgroundColorWith(color, viewMode: model)
- mainVC.updatePDFDisplaySettingView()
- }
- }
-
- @IBAction func menuItemAction_Zoom(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- var type: KMPDFZoomType = .width
- if sender.tag == 0 {
- type = .width
- } else if sender.tag == 1 {
- type = .fit
- } else if sender.tag == 2 {
- type = .actualSize
- } else if sender.tag == 3 {
- type = .zoom_In
- } else if sender.tag == 4 {
- type = .zoom_Out
- }
- mainVC.selectZoom(type)
- }
- }
-
- @IBAction func menuItemAction_Rotate(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if sender.tag == 0 {
- mainVC.rotateLeft(page: mainVC.listView.currentPage(), listView: mainVC.listView)
- } else if sender.tag == 1 {
- mainVC.rotateRight(page: mainVC.listView.currentPage(), listView: mainVC.listView)
- }
- }
- }
-
- @IBAction func menuItemAction_HighlightFormsField(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- let enabled = CPDFKitConfig.sharedInstance().enableFormFieldHighlight()
- CPDFKitConfig.sharedInstance().setEnableFormFieldHighlight(!enabled)
-
- mainVC.listView.setNeedsDisplayForVisiblePages()
- mainVC.alertTipViewController.reloadFormAlertUI()
- }
- }
-
- @IBAction func menuItemAction_HighlightLinks(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- let enabled = CPDFKitConfig.sharedInstance().enableLinkFieldHighlight()
-
- CPDFAnnotation.updateLinkFieldHighlight(mainVC.listView, linkFieldHighlight: !enabled)
- }
- }
-
- @IBAction func menuItemAction_ResetForm(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.listView.resetFormAnnotation()
- }
- }
-
- @IBAction func menuItemAction_AutoScroll(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.toggleAutoFlow(nil)
- }
- }
- }
- // MARK: - Go Menu
- extension AppDelegate {
- func isGoMenuActions(sel: Selector?) -> Bool {
- guard let selector = sel else {
- return false
- }
- let selectors = [NSSelectorFromString("menuItemAction_Next:"),
- NSSelectorFromString("menuItemAction_Previous:"),
- NSSelectorFromString("menuItemAction_First:"),
- NSSelectorFromString("menuItemAction_Last:"),
- NSSelectorFromString("menuItemAction_GotoPage:"),
- NSSelectorFromString("menuItemAction_Back:"),
- NSSelectorFromString("menuItemAction_Forward:")]
- if selectors.contains(selector) {
- return true
- }
- return false
- }
-
- func validateGoMenuItem(_ menuItem: NSMenuItem) -> Bool {
- let action = menuItem.action
- if let mainVC = self.mainViewController() {
- if action == NSSelectorFromString("menuItemAction_Next:") {
- if mainVC.listView.isEditing() {
- let editingAreas = mainVC.listView.km_EditingAreas()
- if(editingAreas.count > 0) {
- var isEditSelect = false
- if !mainVC.listView.isSelecteditAreaNotEdit() { //光标输入状态
- isEditSelect = true
- } else {
- let editState = mainVC.listView.editStatus()
- if (editState == .editSelectText) {// 选择文本
- isEditSelect = true
- }
- }
-
- if isEditSelect {
- return true
- }
- }
- }
- return (mainVC.pdfViewCanHorizontalScroll() == false && mainVC.listView.canGoToNextPage())
- } else if action == NSSelectorFromString("menuItemAction_Previous:") {
-
- if mainVC.listView.isEditing(){
- let editingAreas = mainVC.listView.km_EditingAreas()
- if(editingAreas.count > 0) {
- var isEditSelect = false
- if !mainVC.listView.isSelecteditAreaNotEdit() { //光标输入状态
- isEditSelect = true
- } else {
- let editState = mainVC.listView.editStatus()
- if (editState == .editSelectText) {// 选择文本
- isEditSelect = true
- }
- }
-
- if isEditSelect {
- return true
- }
- }
- }
- return (mainVC.pdfViewCanHorizontalScroll() == false && mainVC.listView.canGoToPreviousPage())
- } else if action == NSSelectorFromString("menuItemAction_First:") {
- if(mainVC.listView.isEditing()) {
- let editingAreas = mainVC.listView.km_EditingAreas()
- if(editingAreas.count > 0) {
- var isEditSelect = false
- if !mainVC.listView.isSelecteditAreaNotEdit() { //光标输入状态
- isEditSelect = true
- } else {
- let editState = mainVC.listView.editStatus()
- if (editState == .editSelectText) {// 选择文本
- isEditSelect = true
- }
- }
-
- if isEditSelect {
- return true
- }
- }
- }
- return mainVC.listView.canGoToFirstPage()
- } else if action == NSSelectorFromString("menuItemAction_Last:") {
- if(mainVC.listView.isEditing()) {
- let editingAreas = mainVC.listView.km_EditingAreas()
- if(editingAreas.count > 0) {
- var isEditSelect = false
- if !mainVC.listView.isSelecteditAreaNotEdit() { //光标输入状态
- isEditSelect = true
- } else {
- let editState = mainVC.listView.editStatus()
- if (editState == .editSelectText) {// 选择文本
- isEditSelect = true
- }
- }
-
- if isEditSelect {
- return true
- }
- }
- }
- return mainVC.listView.canGoToLastPage()
- } else if action == NSSelectorFromString("menuItemAction_GotoPage:") {
- return true
- } else if action == NSSelectorFromString("menuItemAction_Back:") {
- return mainVC.listView.km_canGoBack()
- } else if action == NSSelectorFromString("menuItemAction_Forward:") {
- return mainVC.listView.km_canGoForward()
- }
- }
- return false
- }
-
- //MARK: -IBAction
- @IBAction func menuItemAction_Next(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if(mainVC.listView.isEditing()) {
- mainVC.keyDownEditCmdRight()
- } else {
- if (mainVC.listView.canGoToNextPage()) {
- mainVC.listView.goToNextPage(nil)
- }
- }
- }
- }
- @IBAction func menuItemAction_Previous(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if(mainVC.listView.isEditing()) {
- mainVC.keyDownEditCmdLeft()
- } else {
- if (mainVC.listView.canGoToPreviousPage()) {
- mainVC.listView.goToPreviousPage(nil)
- }
- }
- }
- }
-
- @IBAction func menuItemAction_First(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if(mainVC.listView.isEditing()) {
- mainVC.keyDownEditCmdUp()
- } else {
- mainVC.listView.goToFirstPage(nil)
- }
- }
- }
-
- @IBAction func menuItemAction_Last(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if(mainVC.listView.isEditing()) {
- mainVC.keyDownEditCmdDown()
- } else {
- mainVC.listView.goToLastPage(nil)
- }
- }
- }
-
- @IBAction func menuItemAction_GotoPage(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- mainVC.gotoPage(nil)
- }
- }
-
- @IBAction func menuItemAction_Back(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if (mainVC.listView.km_canGoBack()) {
- mainVC.listView.km_goBack(nil)
- }
- }
- }
-
- @IBAction func menuItemAction_Forward(_ sender: NSMenuItem) {
- if let mainVC = self.mainViewController() {
- if (mainVC.listView.km_canGoForward()) {
- mainVC.listView.km_goForward(nil)
- }
- }
- }
- }
- // MARK: - Window Menu
- extension AppDelegate {
- func isWindowMenuActions(sel: Selector?) -> Bool {
- guard let selector = sel else {
- return false
- }
- var selectors = [NSSelectorFromString("menuItemAction_showForwardTagPage:"),
- NSSelectorFromString("menuItemAction_showNextTagPage:"),
- NSSelectorFromString("menuItemAction_mergeAllWindow:")]
- if selectors.contains(selector) {
- return true
- }
- return false
- }
-
- func validateWindowMenuItem(_ menuItem: NSMenuItem) -> Bool {
- let action = menuItem.action
- if let browser = self.currentKMBrowser() {
- if action == NSSelectorFromString("menuItemAction_showForwardTagPage:") {
- menuItem.keyEquivalent = "\t"
- menuItem.keyEquivalentModifierMask = [.shift, .control]
- return browser.canSelectPreviousTab()
- } else if action == NSSelectorFromString("menuItemAction_showNextTagPage:") {
- return browser.canSelectNextTab()
- }
- }
- if let browserWC = self.currentBrowserWindowController() {
- if action == NSSelectorFromString("menuItemAction_mergeAllWindow:") {
- return browserWC.canMergeAllWindow()
- }
- }
- return true
- }
-
- //MARK: -IBAction
- @IBAction func menuItemAction_showForwardTagPage(_ sender: NSMenuItem) -> Void {
- if let browser = self.currentKMBrowser() {
- browser.selectPreviousTab()
- }
- }
-
- @IBAction func menuItemAction_showNextTagPage(_ sender: NSMenuItem) -> Void {
- if let browser = self.currentKMBrowser() {
- browser.selectNextTab()
- }
- }
-
- @IBAction func menuItemAction_mergeAllWindow(_ sender: NSMenuItem) -> Void {
- if let browserWC = self.currentBrowserWindowController() {
- browserWC.mergeAllWindow(sender)
- }
- }
- }
- // MARK: - help Menu
- extension AppDelegate {
- func isHelpMenuActions(sel: Selector?) -> Bool {
- guard let selector = sel else {
- return false
- }
- var selectors = [NSSelectorFromString("menuItemAction_APPWebSite:"),
- NSSelectorFromString("menuItemAction_quickStudy:"),
- NSSelectorFromString("menuItemAction_OnlineHelp:"),
- NSSelectorFromString("menuItemAction_Feedback:"),
- NSSelectorFromString("menuItemAction_FiveStar:"),
- NSSelectorFromString("menuItemAction_SubscribeUs:"),
- NSSelectorFromString("menuItemAction_CheckForUpdate:"),
- NSSelectorFromString("menuItemAction_VPP:"),
- NSSelectorFromString("menuItemAction_FreeTemplate:"),
- NSSelectorFromString("menuItemAction_MoreProducts:"),
- NSSelectorFromString("menuItemAction_PowerBy:"),
- NSSelectorFromString("menuItemAction_privacyPolicy:"),
- NSSelectorFromString("menuItemAction_TermsofService:")]
- if selectors.contains(selector) {
- return true
- }
- return false
- }
-
- func validateHelpMenuItem(_ menuItem: NSMenuItem) -> Bool {
-
- return true
- }
-
- //MARK: -IBAction
- @IBAction func menuItemAction_APPWebSite(_ sender: NSMenuItem) -> Void {
- KMTools.openURL(urlString: APPMain_Link)
- }
-
- @IBAction func menuItemAction_quickStudy(_ sender: NSMenuItem) -> Void {
- KMTools.openQuickStartStudy()
- }
-
- @IBAction func menuItemAction_OnlineHelp(_ sender: NSMenuItem) -> Void {
- KMTools.openFAQWebsite()
- }
-
- @IBAction func menuItemAction_Feedback(_ sender: NSMenuItem) -> Void {
- let help = KMUserFeekbackHanddler()
- help.showFeekbackWindow(with: KMLocalizedString("Feedback", comment: ""))
- }
-
- @IBAction func menuItemAction_FiveStar(_ sender: NSMenuItem) -> Void {
- KMTools.rateUs()
- }
-
- @IBAction func menuItemAction_SubscribeUs(_ sender: NSMenuItem) -> Void {
- KMEmailSubWindowController().showWindow(nil)
- }
-
- @IBAction func menuItemAction_CheckForUpdate(_ sender: NSMenuItem) -> Void {
- #if VERSION_DMG
- SUUpdater.shared().checkForUpdates(sender)
- #endif
- }
-
- @IBAction func menuItemAction_VPP(_ sender: NSMenuItem) -> Void {
- KMTools.openVPPWebSite()
- }
-
- @IBAction func menuItemAction_FreeTemplate(_ sender: NSMenuItem) -> Void {
- KMTools.openFreePDFTemplatesWebsite()
- }
-
- @IBAction func menuItemAction_MoreProducts(_ sender: NSMenuItem) -> Void {
- KMTools.openMoreProductWebsite()
- }
-
- @IBAction func menuItemAction_PowerBy(_ sender: NSMenuItem) -> Void {
- KMTools.openComPDFKitPowerWebsite()
- }
-
- @IBAction func menuItemAction_privacyPolicy(_ sender: NSMenuItem) -> Void {
- KMTools.openPrivacyPolicyWebSite()
- }
-
- @IBAction func menuItemAction_TermsofService(_ sender: NSMenuItem) -> Void {
- KMTools.openTermOfServiceWebSite()
- }
-
-
- }
|