Split NJMappingController view handling off into NJMappingViewController. This is...
[enjoyable.git] / Classes / NJMappingsViewController.h
diff --git a/Classes/NJMappingsViewController.h b/Classes/NJMappingsViewController.h
new file mode 100644 (file)
index 0000000..2d0bd25
--- /dev/null
@@ -0,0 +1,72 @@
+//
+//  NJMappingsViewController.h
+//  Enjoyable
+//
+//  Created by Joe Wreschnig on 3/17/13.
+//
+//
+
+@class NJMapping;
+@protocol NJMappingsViewControllerDelegate;
+
+@interface NJMappingsViewController : NSViewController <NSTableViewDataSource,
+                                                        NSTableViewDelegate,
+                                                        NSOpenSavePanelDelegate,
+                                                        NSPopoverDelegate>
+
+@property (nonatomic, weak) IBOutlet id <NJMappingsViewControllerDelegate> delegate;
+
+@property (nonatomic, strong) IBOutlet NSButton *removeMapping;
+@property (nonatomic, strong) IBOutlet NSTableView *mappingList;
+@property (nonatomic, strong) IBOutlet NSButton *mappingListTrigger;
+@property (nonatomic, strong) IBOutlet NSPopover *mappingListPopover;
+@property (nonatomic, strong) IBOutlet NSButton *moveUp;
+@property (nonatomic, strong) IBOutlet NSButton *moveDown;
+
+- (IBAction)addClicked:(id)sender;
+- (IBAction)removeClicked:(id)sender;
+- (IBAction)moveUpClicked:(id)sender;
+- (IBAction)moveDownClicked:(id)sender;
+- (IBAction)mappingTriggerClicked:(id)sender;
+
+- (void)addedMappingAtIndex:(NSInteger)index startEditing:(BOOL)startEditing;
+- (void)removedMappingAtIndex:(NSInteger)index;
+- (void)changedActiveMappingToIndex:(NSInteger)index;
+
+- (void)reloadData;
+
+@end
+
+@protocol NJMappingsViewControllerDelegate
+
+- (NSInteger)numberOfMappings:(NJMappingsViewController *)dvc;
+- (NJMapping *)mappingsViewController:(NJMappingsViewController *)dvc
+                      mappingForIndex:(NSUInteger)idx;
+
+
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+          editedMappingAtIndex:(NSInteger)index;
+
+- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
+       canMoveMappingFromIndex:(NSInteger)fromIdx
+                       toIndex:(NSInteger)toIdx;
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+          moveMappingFromIndex:(NSInteger)fromIdx
+                       toIndex:(NSInteger)toIdx;
+
+- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
+       canRemoveMappingAtIndex:(NSInteger)idx;
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+          removeMappingAtIndex:(NSInteger)idx;
+
+- (BOOL)mappingsViewController:(NJMappingsViewController *)mvc
+          importMappingFromURL:(NSURL *)url
+                       atIndex:(NSInteger)index
+                         error:(NSError **)error;
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+                    addMapping:(NJMapping *)mapping;
+
+- (void)mappingsViewController:(NJMappingsViewController *)mvc
+           choseMappingAtIndex:(NSInteger)idx;
+
+@end