|
@@ -186,7 +186,7 @@ extension KMMainViewController {
|
|
|
}
|
|
|
|
|
|
func enterAnnotationStype() -> NSMenuItem {
|
|
|
- let stypItem = NSMenuItem(title: NSLocalizedString("Add Annotation", comment: ""), action: nil, target: self)
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Annotation", comment: ""), action: nil, target: self)
|
|
|
let stypeMenu = NSMenu()
|
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Freehand", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 0)
|
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Text", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 1)
|
|
@@ -257,6 +257,94 @@ extension KMMainViewController {
|
|
|
}
|
|
|
return stypItem
|
|
|
}
|
|
|
+ func addOutlineStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Add Outline Item", comment: ""), action: #selector(addOutLineItemAction), target: self)
|
|
|
+
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+
|
|
|
+ func setTTSStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("TTS", comment: ""), action: #selector(showTTSView), target: self)
|
|
|
+
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+
|
|
|
+ func setLookUpStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Look Up", comment: ""), action: #selector(lookUpAction), target: self)
|
|
|
+
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+ func setSearchBaiduStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Search with Baidu", comment: ""), action: #selector(searchBaiduAction), target: self)
|
|
|
+
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+
|
|
|
+ func setNextPageStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Next Page", comment: ""), action: #selector(NextPageAction), target: self)
|
|
|
+
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+
|
|
|
+ func setPreviousPageStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Previous Page", comment: ""), action: #selector(PreviousPageAction), target: self)
|
|
|
+
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+
|
|
|
+ func setTranslateStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Translate", comment: ""), action: #selector(TranslateItemAction), target: self)
|
|
|
+
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+
|
|
|
+ func setAutoScrollStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Auto Scroll", comment: ""), action: #selector(AutoScrollItemAction), target: self)
|
|
|
+
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+
|
|
|
+ func setSnapshotStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Snapshot", comment: ""), action: nil, target: self)
|
|
|
+ let stypeMenu = NSMenu()
|
|
|
+ stypeMenu.addItem(withTitle: NSLocalizedString("Auto", comment: ""), action: #selector(takeSnapshot), target: self, tag: 0)
|
|
|
+ stypeMenu.addItem(withTitle: NSLocalizedString("Select Area", comment: ""), action: #selector(takeSnapshotSelectContent), target: self, tag: 1)
|
|
|
+ stypItem.submenu = stypeMenu
|
|
|
+// if self.toolbarController.toolbarType == .Annatiton {
|
|
|
+// stypeMenu.item(at: 0)?.state = .on
|
|
|
+// } else if self.toolbarController.toolbarType == .Move {
|
|
|
+// stypeMenu.item(at: 1)?.state = .on
|
|
|
+// }
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
+
|
|
|
+ func setCropStype() -> NSMenuItem {
|
|
|
+ let stypItem = NSMenuItem(title: NSLocalizedString("Crop", comment: ""), action: nil, target: self)
|
|
|
+ let stypeMenu = NSMenu()
|
|
|
+ stypeMenu.addItem(withTitle: NSLocalizedString("Crop All Pages", comment: ""), action: #selector(cropAllPageItem), target: self, tag: 0)
|
|
|
+ stypeMenu.addItem(withTitle: NSLocalizedString("Crop Current Page", comment: ""), action: #selector(cropCurrentPageItem), target: self, tag: 1)
|
|
|
+ stypeMenu.addItem(withTitle: NSLocalizedString("Auto Crop – Separate", comment: ""), action: #selector(autoCropAllItem), target: self, tag: 2)
|
|
|
+ stypeMenu.addItem(withTitle: NSLocalizedString("Auto Crop – Combined", comment: ""), action: #selector(smartAutoCropAllItem), target: self, tag: 3)
|
|
|
+// if(NSIsEmptyRect(selectionRect)) {
|
|
|
+ stypeMenu.addItem(withTitle: NSLocalizedString("Select Area", comment: ""), action: #selector(selectToolModel), target: self, tag: 4)
|
|
|
+ stypeMenu.addItem(withTitle: NSLocalizedString("Crop Options...", comment: ""), action: #selector(customCropModel), target: self, tag: 5)
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
+ stypItem.submenu = stypeMenu
|
|
|
+// if self.toolbarController.toolbarType == .Annatiton {
|
|
|
+// stypeMenu.item(at: 0)?.state = .on
|
|
|
+// } else if self.toolbarController.toolbarType == .Move {
|
|
|
+// stypeMenu.item(at: 1)?.state = .on
|
|
|
+// } else if self.toolbarController.toolbarType == .Magnify {
|
|
|
+// stypeMenu.item(at: 2)?.state = .on
|
|
|
+// } else if self.toolbarController.toolbarType == .Select {
|
|
|
+// stypeMenu.item(at: 3)?.state = .on
|
|
|
+// } else if self.toolbarController.toolbarType == .SelectZoom {
|
|
|
+// stypeMenu.item(at: 4)?.state = .on
|
|
|
+// }
|
|
|
+ return stypItem
|
|
|
+ }
|
|
|
|
|
|
func addHighlightLinksStype() -> NSMenuItem {
|
|
|
let highlightLink = KMPreferenceManager.shared.highlightLinks
|
|
@@ -502,6 +590,31 @@ extension KMMainViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @objc func takeSnapshot(sender: NSMenuItem) {
|
|
|
+
|
|
|
+ }
|
|
|
+ @objc func takeSnapshotSelectContent(sender: NSMenuItem) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @objc func cropAllPageItem(sender: NSMenuItem) {
|
|
|
+
|
|
|
+ }
|
|
|
+ @objc func cropCurrentPageItem(sender: NSMenuItem) {
|
|
|
+
|
|
|
+ }
|
|
|
+ @objc func autoCropAllItem(sender: NSMenuItem) {
|
|
|
+
|
|
|
+ }
|
|
|
+ @objc func smartAutoCropAllItem(sender: NSMenuItem) {
|
|
|
+
|
|
|
+ }
|
|
|
+ @objc func selectToolModel(sender: NSMenuItem) {
|
|
|
+
|
|
|
+ }
|
|
|
+ @objc func customCropModel(sender: NSMenuItem) {
|
|
|
+
|
|
|
+ }
|
|
|
@objc func menuItemAnnotationClick_toolModel(sender: NSMenuItem) {
|
|
|
self.listView.toolMode = .noteToolMode
|
|
|
var identifier = KMDocumentAnnotationToolbarItemIdentifier
|