123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- //
- // KMSystemAnnotationMenu.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2023/12/26.
- //
- import Foundation
- protocol KMSystemAnnotationMenuProtocol: NSObjectProtocol {
- func menuItemAction_highlight(_ sender: Any)
- func menuItemAction_underline(_ sender: Any)
- func menuItemAction_deleteLine(_ sender: Any)
- func menuItemAction_freehand(_ sender: Any)
- func menuItemAction_text(_ sender: Any)
- func menuItemAction_note(_ sender: Any)
- func menuItemAction_squre(_ sender: Any)
- func menuItemAction_circle(_ sender: Any)
- func menuItemAction_arrow(_ sender: Any)
- func menuItemAction_line(_ sender: Any)
- // link
- func menuItemAction_link(_ sender: Any)
- func menuItemAction_linkPage(_ sender: Any)
- func menuItemAction_linkHttps(_ sender: Any)
- func menuItemAction_linkEmail(_ sender: Any)
- func notesLink(_ sender: Any)
-
- // stamp
- func menuItemAction_stamp(_ sender: Any)
- func menuItemAction_stampStandard(_ sender: Any)
- func menuItemAction_stampDynamic(_ sender: Any)
- func menuItemAction_stampCustom(_ sender: Any)
- func notesStamp(_ sender: Any)
-
- func menuItemAction_signure(_ sender: Any)
- func image(_ sender: Any)
- func table(_ sender: Any)
- func addForm(_ sender: Any)
-
- func editNote(_ sender: Any)
-
- func menuItemAction_hiddenAllAnnotation(_ sender: Any)
- func menuItemAction_clearAllAnnotation(_ sender: Any)
- }
- extension KMSystemAnnotationMenuProtocol {
- func menuItemAction_linkHttps(_ sender: Any) {}
- func menuItemAction_linkEmail(_ sender: Any) {}
-
- func notesLink(_ sender: Any) {}
-
- func menuItemAction_stampStandard(_ sender: Any) {}
- func menuItemAction_stampDynamic(_ sender: Any) {}
- func menuItemAction_stampCustom(_ sender: Any) {}
-
- func notesStamp(_ sender: Any) {}
-
- func image(_ sender: Any) {}
- func table(_ sender: Any) {}
- func addForm(_ sender: Any) {}
-
- func editNote(_ sender: Any) {}
- }
- extension KMSystemMenu.Annotation {
- public static let highlightSelector = NSSelectorFromString("menuItemAction_highlight:")
- public static let underlineSelector = NSSelectorFromString("menuItemAction_underline:")
- public static let strikeOutSelector = NSSelectorFromString("menuItemAction_deleteLine:")
- public static let freehandSelector = NSSelectorFromString("menuItemAction_freehand:")
- public static let textSelector = NSSelectorFromString("menuItemAction_text:")
- public static let noteSelector = NSSelectorFromString("menuItemAction_note:")
- public static let squreSelector = NSSelectorFromString("menuItemAction_squre:")
- public static let circleSelector = NSSelectorFromString("menuItemAction_circle:")
- public static let arrowSelector = NSSelectorFromString("menuItemAction_arrow:")
- public static let lineSelector = NSSelectorFromString("menuItemAction_line:")
-
- public static let linkSelector = NSSelectorFromString("menuItemAction_link:")
- public static let linkPageSelector = NSSelectorFromString("menuItemAction_linkPage:")
- public static let linkHttpsSelector = NSSelectorFromString("menuItemAction_linkHttps:")
- public static let linkEmailSelector = NSSelectorFromString("menuItemAction_linkEmail:")
- public static let notesLinkSelector = NSSelectorFromString("notesLink:")
-
- public static let stampSelector = NSSelectorFromString("menuItemAction_stamp:")
- public static let stampStandardSelector = NSSelectorFromString("menuItemAction_stampStandard:")
- public static let stampDynamicSelector = NSSelectorFromString("menuItemAction_stampDynamic:")
- public static let stampCustomSelector = NSSelectorFromString("menuItemAction_stampCustom:")
- public static let notesStampSelector = NSSelectorFromString("notesStamp:")
-
- public static let signureSelector = NSSelectorFromString("menuItemAction_signure:")
- public static let imageSelector = NSSelectorFromString("image:")
- public static let tableSelector = NSSelectorFromString("table:")
- public static let addFormSelector = NSSelectorFromString("addForm:")
-
- public static let editNoteSelector = NSSelectorFromString("editNote:")
-
- public static let hiddenAllSelector = NSSelectorFromString("menuItemAction_hiddenAllAnnotation:")
- public static let clearAllSelector = NSSelectorFromString("menuItemAction_clearAllAnnotation:")
-
- public static func actions() -> [Selector] {
- return [self.highlightSelector, self.underlineSelector, self.strikeOutSelector, self.freehandSelector,
- self.textSelector, self.noteSelector, self.squreSelector, self.circleSelector,
- self.arrowSelector, self.lineSelector,
- // link
- self.linkSelector, self.linkPageSelector, self.linkHttpsSelector, self.linkEmailSelector, self.notesLinkSelector,
- // stamp
- self.stampSelector, self.stampStandardSelector, self.stampDynamicSelector, self.stampCustomSelector, self.notesStampSelector,
- // other
- self.signureSelector, self.imageSelector, self.tableSelector, self.addFormSelector, self.editNoteSelector,
- self.hiddenAllSelector, self.clearAllSelector]
- }
- }
|