View-free NJMappingsController.
[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 - (void)beginUpdates;
38 - (void)endUpdates;
39
40
41 @end
42
43 @protocol NJMappingsViewControllerDelegate
44
45 - (NSInteger)numberOfMappings:(NJMappingsViewController *)dvc;
46 - (NJMapping *)mappingsViewController:(NJMappingsViewController *)dvc
47 mappingForIndex:(NSUInteger)idx;
48
49
50 - (void)mappingsViewController:(NJMappingsViewController *)mvc
51 renameMappingAtIndex:(NSInteger)index
52 toName:(NSString *)name;
53
54 - (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
55 canMoveMappingFromIndex:(NSInteger)fromIdx
56 toIndex:(NSInteger)toIdx;
57 - (void)mappingsViewController:(NJMappingsViewController *)mvc
58 moveMappingFromIndex:(NSInteger)fromIdx
59 toIndex:(NSInteger)toIdx;
60
61 - (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
62 canRemoveMappingAtIndex:(NSInteger)idx;
63 - (void)mappingsViewController:(NJMappingsViewController *)mvc
64 removeMappingAtIndex:(NSInteger)idx;
65
66 - (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
67 importMappingFromURL:(NSURL *)url
68 atIndex:(NSInteger)index
69 error:(NSError **)error;
70 - (void)mappingsViewController:(NJMappingsViewController *)mvc
71 addMapping:(NJMapping *)mapping;
72
73 - (void)mappingsViewController:(NJMappingsViewController *)mvc
74 choseMappingAtIndex:(NSInteger)idx;
75
76 @end