aboutsummaryrefslogtreecommitdiffstats
path: root/Framework/MASShortcutBinder.h
blob: 98e01c764d14666c144a9ed42c9308dc74c2e451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#import "MASShortcutMonitor.h"

@interface MASShortcutBinder : NSObject

+ (instancetype) sharedBinder;

@property(strong) MASShortcutMonitor *shortcutMonitor;
@property(copy) NSDictionary *bindingOptions;

- (void) bindShortcutWithDefaultsKey: (NSString*) defaultsKeyName toAction: (dispatch_block_t) action;
- (void) breakBindingWithDefaultsKey: (NSString*) defaultsKeyName;

/**
    @brief Register default shortcuts in user defaults.

    This is a convenience frontent to [NSUserDefaults registerDefaults].
    The dictionary should contain a map of user defaults’ keys to appropriate
    keyboard shortcuts. The shortcuts will be transformed according to
    @p bindingOptions and registered using @p registerDefaults.
*/
- (void) registerDefaultShortcuts: (NSDictionary*) defaultShortcuts;

@end