9c9432a66b00a3357f7d963241add3fda6a45110
[enjoyable.git] / Classes / NJMappingMenuController.h
1 //
2 // NJMappingMenuController.h
3 // Enjoyable
4 //
5 // Created by Joe Wreschnig on 3/11/13.
6 //
7 //
8
9 #import <Foundation/Foundation.h>
10
11 @class NJMapping;
12
13 @protocol NJMappingMenuDelegate
14
15 - (void)mappingWasChosen:(NJMapping *)mapping;
16 // Called when a menu item created by the controller is chosen.
17
18 - (void)mappingListShouldOpen;
19 // Called when the "overflow" menu item is chosen, this means the
20 // user should be presented with the list of available mappings.
21
22 @end
23
24 @interface NJMappingMenuController : NSObject
25 // Mapping menu controllers manage the contents of a menu that
26 // shows a list of all available mappings, as well as the current
27 // event translation state. The menu may have other items in it as
28 // well, but none at an adjacent index that also have NJMappings
29 // as represented objects.
30
31 @property (nonatomic, strong) IBOutlet NSMenu *menu;
32 // The menu to put mapping items in.
33
34 @property (nonatomic, weak) IBOutlet id <NJMappingMenuDelegate> delegate;
35 // The delegate to inform about requested mapping changes.
36
37 @property (nonatomic, assign) NSInteger firstMappingIndex;
38 // The index in the menu to insert mappings into. The menu can
39 // have other dynamic items as long as you update this index as
40 // you add or remove them.
41
42 @property (nonatomic, assign) BOOL hasKeyEquivalents;
43 // Whether or not to add key equivalents to the menu items.
44
45 @property (nonatomic, strong) IBOutlet NSMenuItem *eventTranslationToggle;
46 // A menu item representing the current event translation state.
47 // This outlet is optional.
48
49
50 @end