forked from gnachman/iTerm2
/
TmuxSessionsTable.h
53 lines (42 loc) · 1.51 KB
/
TmuxSessionsTable.h
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
//
// TmuxSessionsTable.h
// iTerm
//
// Created by George Nachman on 12/23/11.
// Copyright (c) 2011 Georgetech. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@protocol TmuxSessionsTableProtocol
- (NSArray *)sessions;
- (void)renameSessionWithName:(NSString *)oldName toName:(NSString *)newName;
- (void)removeSessionWithName:(NSString *)sessionName;
- (void)addSessionWithName:(NSString *)sessionName;
- (void)attachToSessionWithName:(NSString *)sessionName;
- (NSString *)nameOfAttachedSession;
- (void)selectedSessionChangedTo:(NSString *)newName;
- (void)linkWindowId:(int)windowId
inSession:(NSString *)sessionName
toSession:(NSString *)targetSession;
- (void)detach;
@end
@interface TmuxSessionsTable : NSObject <NSTableViewDelegate, NSTableViewDataSource> {
NSMutableArray *model_;
BOOL canAttachToSelectedSession_;
NSObject<TmuxSessionsTableProtocol> *delegate_; // weak
IBOutlet NSTableColumn *checkColumn_;
IBOutlet NSTableColumn *nameColumn_;
IBOutlet NSTableView *tableView_;
IBOutlet NSButton *attachButton_;
IBOutlet NSButton *detachButton_;
IBOutlet NSButton *removeButton_;
}
@property (nonatomic, assign) NSObject<TmuxSessionsTableProtocol> *delegate;
- (void)setSessions:(NSArray *)names;
- (NSString *)selectedSessionName;
- (void)selectSessionWithName:(NSString *)name;
#pragma mark Interface Builder actions
- (IBAction)addSession:(id)sender;
- (IBAction)removeSession:(id)sender;
- (IBAction)attach:(id)sender;
- (IBAction)detach:(id)sender;
@end