2 // NJMappingMenuController.h
5 // Created by Joe Wreschnig on 3/11/13.
9 #import <Foundation/Foundation.h>
13 @protocol NJMappingMenuDelegate
15 - (void)mappingWasChosen
:(NJMapping
*)mapping
;
16 // Called when a menu item created by the controller is chosen.
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.
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 simulation 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.
31 @
property (nonatomic
, strong
) IBOutlet NSMenu
*menu
;
32 // The menu to put mapping items in.
34 @
property (nonatomic
, weak
) IBOutlet id
<NJMappingMenuDelegate
> delegate
;
35 // The delegate to inform about requested mapping changes.
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.
42 @
property (nonatomic
, assign
) BOOL hasKeyEquivalents
;
43 // Whether or not to add key equivalents to the menu items.
45 @
property (nonatomic
, strong
) IBOutlet NSMenuItem
*eventSimulationToggle
;
46 // A menu item representing the current event simulation state.
47 // This outlet is optional.