aboutsummaryrefslogtreecommitdiffstats
path: root/Framework/MASShortcutValidator.h
diff options
context:
space:
mode:
authorTomáš Znamenáček2014-08-05 16:24:15 +0200
committerTomáš Znamenáček2015-01-07 15:27:50 +0100
commit6383b054190d8bc4b7e059718cded0119d25d98c (patch)
treea54f4139029f5fff74abd6ae60b022e2325177c7 /Framework/MASShortcutValidator.h
parent1c801726d35e56d3bbf4a33279213bc60935c244 (diff)
downloadMASShortcut-6383b054190d8bc4b7e059718cded0119d25d98c.tar.bz2
Introduced a standalone MASShortcutValidator class to validate shortcuts.
It’s a natural simplification of the MASShortcut class. All MASShortcutView objects use a shared validator by default, but can be reconfigured to use a different validator if needed through the shortcutValidator property.
Diffstat (limited to 'Framework/MASShortcutValidator.h')
-rw-r--r--Framework/MASShortcutValidator.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/Framework/MASShortcutValidator.h b/Framework/MASShortcutValidator.h
new file mode 100644
index 0000000..cc5f816
--- /dev/null
+++ b/Framework/MASShortcutValidator.h
@@ -0,0 +1,15 @@
+#import "MASShortcut.h"
+
+@interface MASShortcutValidator : NSObject
+
+// The following API enable hotkeys with the Option key as the only modifier
+// For example, Option-G will not generate © and Option-R will not paste ®
+@property(assign) BOOL allowAnyShortcutWithOptionModifier;
+
++ (instancetype) sharedValidator;
+
+- (BOOL) isShortcutValid: (MASShortcut*) shortcut;
+- (BOOL) isShortcut: (MASShortcut*) shortcut alreadyTakenInMenu: (NSMenu*) menu explanation: (NSString**) explanation;
+- (BOOL) isShortcutAlreadyTakenBySystem: (MASShortcut*) shortcut explanation: (NSString**) explanation;
+
+@end