Fix several cases where the UI did not properly reflect model changes.
[enjoyable.git] / Classes / NJDeviceViewController.h
1 //
2 // NJDeviceViewController.h
3 // Enjoyable
4 //
5 // Created by Joe Wreschnig on 3/16/13.
6 //
7 //
8
9 @class NJDevice;
10 @class NJInputPathElement;
11
12 @protocol NJDeviceViewControllerDelegate;
13
14 @interface NJDeviceViewController : NSObject <NSOutlineViewDataSource,
15 NSOutlineViewDelegate>
16
17 @property (nonatomic, strong) IBOutlet NSOutlineView *inputsTree;
18 @property (nonatomic, strong) IBOutlet NSView *noDevicesNotice;
19 @property (nonatomic, strong) IBOutlet NSView *hidStoppedNotice;
20
21 @property (nonatomic, weak) IBOutlet id <NJDeviceViewControllerDelegate> delegate;
22
23 - (void)addedDevice:(NJDevice *)device atIndex:(NSUInteger)idx;
24 - (void)removedDevice:(NJDevice *)device atIndex:(NSUInteger)idx;
25 // But using these will animate nicely.
26
27 - (void)hidStarted;
28 - (void)hidStopped;
29
30 - (void)beginUpdates;
31 - (void)endUpdates;
32
33 - (void)expandAndSelectItem:(NJInputPathElement *)item;
34
35 - (NJInputPathElement *)selectedHandler;
36
37 @end
38
39 @protocol NJDeviceViewControllerDelegate <NSObject>
40
41 - (NSInteger)numberOfDevicesInDeviceList:(NJDeviceViewController *)dvc;
42 - (NJDevice *)deviceViewController:(NJDeviceViewController *)dvc
43 deviceForIndex:(NSUInteger)idx;
44 - (NJInputPathElement *)deviceViewController:(NJDeviceViewController *)dvc
45 elementForUID:(NSString *)uid;
46
47
48 - (void)deviceViewController:(NJDeviceViewController *)dvc
49 didSelectDevice:(NJInputPathElement *)device;
50 - (void)deviceViewController:(NJDeviceViewController *)dvc
51 didSelectBranch:(NJInputPathElement *)handler;
52 - (void)deviceViewController:(NJDeviceViewController *)dvc
53 didSelectHandler:(NJInputPathElement *)handler;
54 - (void)deviceViewControllerDidSelectNothing:(NJDeviceViewController *)dvc;
55
56 @end