-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tasks.h
63 lines (46 loc) · 1.62 KB
/
Tasks.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
54
55
56
57
58
59
60
61
62
/* Tasks */
#import <Cocoa/Cocoa.h>
#define TaskObj NSMutableDictionary
BOOL isCompleted (TaskObj* taskObj);
NSString* stdErr (TaskObj* taskObj);
NSString* stdOut (TaskObj* taskObj);
NSData* stdOutData (TaskObj* taskObj);
id callbackInfo(TaskObj* taskObj);
//----------------------------------------------------------------------------------------
@interface Tasks : NSObject
{
IBOutlet NSArrayController* tasksAC;
IBOutlet NSPanel* activityWindow;
IBOutlet NSDrawer* logDrawer;
IBOutlet NSTextView* logTextView;
id currentTaskObj;
}
- (IBAction) stopTask: (id) sender;
- (IBAction) clearCompleted: (id) sender;
- (void) taskDataAvailable: (NSNotification*) aNotification isError: (BOOL) isError;
+ (void) addTask: (TaskObj*) taskObj;
+ (void) cancelCallbacksOnTarget: (id) target;
@end // Tasks
//----------------------------------------------------------------------------------------
@protocol TaskDelegate;
@interface Task : NSObject
{
NSTask* fTask;
id<TaskDelegate> fDelegate;
id fObject; // callback argument
}
+ (NSMutableDictionary*) createEnvironment: (BOOL) isUnbuffered;
+ (id) task;
+ (id) taskWithDelegate: (id<TaskDelegate>) target object: (id) object;
- (id) initWithDelegate: (id<TaskDelegate>) target object: (id) object;
- (NSTask*) task;
- (void) launch: (NSString*) path
arguments: (NSArray*) arguments;
- (void) launch: (NSString*) path
arguments: (NSArray*) arguments
stdOutput: (NSString*) stdOutput;
- (void) setStandardOutput: (id) file;
@end // Task
@protocol TaskDelegate<NSObject>
- (void) taskCompleted: (Task*) task object: (id) object;
@end // TaskDelegate