2d0bd256ed3d77393beb9b173c2d0d13092aacc0
[enjoyable.git] / Classes / NJMappingsViewController.h
1 //
2 // NJMappingsViewController.h
3 // Enjoyable
4 //
5 // Created by Joe Wreschnig on 3/17/13.
6 //
7 //
8
9 @class NJMapping;
10 @protocol NJMappingsViewControllerDelegate;
11
12 @interface NJMappingsViewController : NSViewController <NSTableViewDataSource,
13 NSTableViewDelegate,
14 NSOpenSavePanelDelegate,
15 NSPopoverDelegate>
16
17 @property (nonatomic, weak) IBOutlet id <NJMappingsViewControllerDelegate> delegate;
18
19 @property (nonatomic, strong) IBOutlet NSButton *removeMapping;
20 @property (nonatomic, strong) IBOutlet NSTableView *mappingList;
21 @property (nonatomic, strong) IBOutlet NSButton *mappingListTrigger;
22 @property (nonatomic, strong) IBOutlet NSPopover *mappingListPopover;
23 @property (nonatomic, strong) IBOutlet NSButton *moveUp;
24 @property (nonatomic, strong) IBOutlet NSButton *moveDown;
25
26 - (IBAction)addClicked:(id)sender;
27 - (IBAction)removeClicked:(id)sender;
28 - (IBAction)moveUpClicked:(id)sender;
29 - (IBAction)moveDownClicked:(id)sender;
30 - (IBAction)mappingTriggerClicked:(id)sender;
31
32 - (void)addedMappingAtIndex:(NSInteger)index startEditing:(BOOL)startEditing;
33 - (void)removedMappingAtIndex:(NSInteger)index;
34 - (void)changedActiveMappingToIndex:(NSInteger)index;
35
36 - (void)reloadData;
37
38 @end
39
40 @protocol NJMappingsViewControllerDelegate
41
42 - (NSInteger)numberOfMappings:(NJMappingsViewController *)dvc;
43 - (NJMapping *)mappingsViewController:(NJMappingsViewController *)dvc
44 mappingForIndex:(NSUInteger)idx;
45
46
47 - (void)mappingsViewController:(NJMappingsViewController *)mvc
48 editedMappingAtIndex:(NSInteger)index;
49
50 - (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
51 canMoveMappingFromIndex:(NSInteger)fromIdx
52 toIndex:(NSInteger)toIdx;
53 - (void)mappingsViewController:(NJMappingsViewController *)mvc
54 moveMappingFromIndex:(NSInteger)fromIdx
55 toIndex:(NSInteger)toIdx;
56
57 - (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
58 canRemoveMappingAtIndex:(NSInteger)idx;
59 - (void)mappingsViewController:(NJMappingsViewController *)mvc
60 removeMappingAtIndex:(NSInteger)idx;
61
62 - (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
63 importMappingFromURL:(NSURL *)url
64 atIndex:(NSInteger)index
65 error:(NSError **)error;
66 - (void)mappingsViewController:(NJMappingsViewController *)mvc
67 addMapping:(NJMapping *)mapping;
68
69 - (void)mappingsViewController:(NJMappingsViewController *)mvc
70 choseMappingAtIndex:(NSInteger)idx;
71
72 @end