Repository navigation
Expand file tree
/
Copy pathSCBundleSidebarView.h
More file actions
58 lines (39 loc) · 1.69 KB
/
Copy pathSCBundleSidebarView.h
File metadata and controls
58 lines (39 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// SCBundleSidebarView.h
// SelfControl
//
// LHS sidebar showing bundle pills for selection.
// Supports Focus/All-Up state model for calendar editing.
//
#import <Cocoa/Cocoa.h>
@class SCBlockBundle;
@class SCBundleSidebarView;
@class SCWeeklySchedule;
NS_ASSUME_NONNULL_BEGIN
@protocol SCBundleSidebarViewDelegate <NSObject>
/// Called when user clicks a bundle pill to select/focus it
- (void)bundleSidebar:(SCBundleSidebarView *)sidebar didSelectBundle:(nullable SCBlockBundle *)bundle;
/// Called when user clicks the add bundle button
- (void)bundleSidebarDidRequestAddBundle:(SCBundleSidebarView *)sidebar;
/// Called when user double-clicks a bundle to edit it
- (void)bundleSidebar:(SCBundleSidebarView *)sidebar didRequestEditBundle:(SCBlockBundle *)bundle;
@end
@interface SCBundleSidebarView : NSView
/// Delegate for handling selection events
@property (nonatomic, weak, nullable) id<SCBundleSidebarViewDelegate> delegate;
/// Array of bundles to display
@property (nonatomic, copy) NSArray<SCBlockBundle *> *bundles;
/// Currently selected bundle ID (nil = All-Up state, showing all bundles)
@property (nonatomic, copy, nullable) NSString *selectedBundleID;
/// Whether editing is locked (committed state)
@property (nonatomic, assign) BOOL isCommitted;
/// Schedules dictionary for determining which bundles are active (bundleID -> schedule)
@property (nonatomic, copy, nullable) NSDictionary<NSString *, SCWeeklySchedule *> *schedules;
/// Reload the sidebar display
- (void)reloadData;
/// Clear selection (return to All-Up state)
- (void)clearSelection;
/// Get the bundle object for a given ID
- (nullable SCBlockBundle *)bundleForID:(NSString *)bundleID;
@end
NS_ASSUME_NONNULL_END