App delegate now controls communication between device / mapping controllers and...
[enjoyable.git] / Classes / NJDeviceController.h
index f49d647..3691d59 100644 (file)
@@ -7,27 +7,38 @@
 //
 
 #import "NJHIDManager.h"
+#import "NJDeviceViewController.h"
 
-@class NJDevice;
 @class NJInput;
 @class NJMappingsController;
-@class NJOutputController;
 
-@interface NJDeviceController : NSObject <NSOutlineViewDataSource,
-                                          NSOutlineViewDelegate,
-                                          NJHIDManagerDelegate> {
-    IBOutlet NSOutlineView *outlineView;
-    IBOutlet NJOutputController *outputController;
+@protocol NJDeviceControllerDelegate;
+
+@interface NJDeviceController : NSObject <NJHIDManagerDelegate> {
     IBOutlet NJMappingsController *mappingsController;
-    IBOutlet NSButton *translatingEventsButton;
-    IBOutlet NSView *connectDevicePrompt;
-    IBOutlet NSView *hidSleepingPrompt;
+    IBOutlet NSButton *simulatingEventsButton;
 }
 
-@property (nonatomic, readonly) NJInput *selectedInput;
+@property (nonatomic, weak) IBOutlet id <NJDeviceControllerDelegate> delegate;
+
 @property (nonatomic, assign) NSPoint mouseLoc;
-@property (nonatomic, assign) BOOL translatingEvents;
+@property (nonatomic, assign) BOOL simulatingEvents;
+
+- (IBAction)simulatingEventsChanged:(NSButton *)sender;
+
+- (NJDevice *)objectAtIndexedSubscript:(NSUInteger)idx;
+- (NJInputPathElement *)objectForKeyedSubscript:(NSString *)uid;
+- (NSUInteger)count;
+
+@end
+
+@protocol NJDeviceControllerDelegate
 
-- (IBAction)translatingEventsChanged:(NSButton *)sender;
+- (void)deviceController:(NJDeviceController *)dc didAddDevice:(NJDevice *)device;
+- (void)deviceController:(NJDeviceController *)dc didRemoveDeviceAtIndex:(NSInteger)idx;
+- (void)deviceController:(NJDeviceController *)dc didInput:(NJInput *)input;
+- (void)deviceControllerDidStartHID:(NJDeviceController *)dc;
+- (void)deviceControllerDidStopHID:(NJDeviceController *)dc;
+- (void)deviceController:(NJDeviceController *)dc didError:(NSError *)error;
 
 @end