ProjectManager 0.2
GNUstepAppLauncher.h
1/*
2 GNUstepAppLauncher.h
3
4 Interface declaration of the GNUstepAppLauncher project module for the
5 ProjectManager application.
6
7 Copyright (C) 2005, 2006 Saso Kiselkov
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22*/
23
24#import <Foundation/NSObject.h>
25#import "../../ProjectModule.h"
26
27@class NSMutableArray,
28 NSMutableDictionary,
29 NSTask,
30 NSFileHandle,
31 NSNotification,
32 NSTableView,
33 NSTableColumn;
34
35@protocol GNUstepAppLauncherDelegate;
36
37extern NSString * const GNUstepAppLauncherProjectWillLaunchNotification;
38extern NSString * const GNUstepAppLauncherProjectDidLaunchNotification;
39extern NSString * const GNUstepAppLauncherProjectDidFailToLaunchNotification;
40extern NSString * const GNUstepAppLauncherProjectDidTerminateNotification;
41
42typedef enum {
43 GNUstepAppLauncherReadyState,
44 GNUstepAppLauncherDelayedLaunchState,
45 GNUstepAppLauncherLaunchedState
46} GNUstepAppLauncherState;
47
48@interface GNUstepAppLauncher : NSObject <ProjectModule>
49{
50 ProjectDocument * document;
51
52 id bogusWindow, view;
53
54 id stderr;
55 id stdout;
56 id stdin;
57 id workingDirectory;
58 id workingDirectoryButton;
59 id targets;
60 // holds the name of the target which was chose when `Launch' was hit
61 NSString * target;
62
63 id args, env;
64 id argsPanel, envPanel;
65 // When we resign being the current project module the arguments
66 // and environment panel are closed to not collide with any other
67 // panels. In these ivars we store whether the panels were open
68 // when the module was changed, so that later on when we again
69 // become the current module we know whether we need to open them
70 // open again
71 BOOL argsPanelWasOpen, envPanelWasOpen;
72
73 NSMutableArray * arguments;
74 NSMutableDictionary * environment;
75 NSArray * sortedEnvironmentNames;
76
77 NSTask * task;
78 NSFileHandle * stdinHandle,
79 * stdoutHandle,
80 * stderrHandle;
81
82 id <GNUstepAppLauncherDelegate> delegate; // weak reference
83
84 GNUstepAppLauncherState launcherState;
85}
86
87- (void) appendStdoutMessage: (NSString *) aMessage;
88- (void) appendStderrMessage: (NSString *) aMessage;
89
90- (void) launch: (id) sender;
91- (void) proceedWithLaunch: (BOOL) flag;
92
93- (void) kill: (id) sender;
94- (void) stopLaunch: (id) sender;
95
96- (void) chooseWorkingDirectory: (id) sender;
97- (void) showArguments: (id) sender;
98- (void) showEnvironment: (id) sender;
99- (void) writeStdin: (id) sender;
100
101- (void) addArg: sender;
102- (void) removeArg: sender;
103- (void) moveArgUp: sender;
104- (void) moveArgDown: sender;
105
106- (void) addEnv: sender;
107- (void) removeEnv: sender;
108
109- (void) moduleChanged: (NSNotification *) notif;
110
111// notification invoked when the task terminates
112- (void) taskTerminated;
113
114// notifications for collecting stdout/err output
115- (void) readStdout;
116- (void) readStderr;
117
118// table view data source methods
119- (int) numberOfRowsInTableView: (NSTableView *)aTableView;
120- (id) tableView: (NSTableView *)aTableView
121objectValueForTableColumn: (NSTableColumn *)aTableColumn
122 row: (int)rowIndex;
123- (void) tableView: (NSTableView *)aTableView
124 setObjectValue: (id)anObject
125 forTableColumn: (NSTableColumn *)aTableColumn
126 row: (int)rowIndex;
127
128@end
Definition GNUstepAppLauncher.h:50
This class is the principal document class for project files.
Definition ProjectDocument.h:44
This protocol declares methods which project modules must implement.
Definition ProjectModule.h:44