1 |
/* GWRemote.h |
2 |
* |
3 |
* Copyright (C) 2003 Free Software Foundation, Inc. |
4 |
* |
5 |
* Author: Enrico Sersale <enrico@imago.ro> |
6 |
* Date: August 2001 |
7 |
* |
8 |
* This file is part of the GNUstep GWRemote application |
9 |
* |
10 |
* This program is free software; you can redistribute it and/or modify |
11 |
* it under the terms of the GNU General Public License as published by |
12 |
* the Free Software Foundation; either version 2 of the License, or |
13 |
* (at your option) any later version. |
14 |
* |
15 |
* This program is distributed in the hope that it will be useful, |
16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 |
* GNU General Public License for more details. |
19 |
* |
20 |
* You should have received a copy of the GNU General Public License |
21 |
* along with this program; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 |
*/ |
24 |
|
25 |
|
26 |
#ifndef GWREMOTE_H |
27 |
#define GWREMOTE_H |
28 |
|
29 |
@class NSString; |
30 |
@class NSArray; |
31 |
@class NSMutableArray; |
32 |
@class NSMutableDictionary; |
33 |
@class NSNotification; |
34 |
@class NSFileManager; |
35 |
@class NSWorkspace; |
36 |
@class ViewerWindow; |
37 |
@class PrefController; |
38 |
@class LoginWindow; |
39 |
@class RemoteEditor; |
40 |
@class RemoteTerminal; |
41 |
|
42 |
@protocol GWSdClientProtocol |
43 |
|
44 |
- (void)setServerConnection:(NSConnection *)conn; |
45 |
|
46 |
- (NSString *)userName; |
47 |
|
48 |
- (NSString *)userPassword; |
49 |
|
50 |
- (oneway void)connectionRefused; |
51 |
|
52 |
- (int)requestUserConfirmationWithMessage:(NSString *)message |
53 |
title:(NSString *)title; |
54 |
|
55 |
- (int)showErrorAlertWithMessage:(NSString *)message; |
56 |
|
57 |
- (oneway void)showProgressForFileOperationWithName:(NSString *)name |
58 |
sourcePath:(NSString *)source |
59 |
destinationPath:(NSString *)destination |
60 |
operationRef:(int)ref |
61 |
onServer:(id)server; |
62 |
|
63 |
- (void)endOfFileOperationWithRef:(int)ref onServer:(id)server; |
64 |
|
65 |
- (oneway void)server:(id)aserver fileSystemDidChange:(NSDictionary *)info; |
66 |
|
67 |
- (oneway void)exitedShellTaskWithRef:(NSNumber *)ref; |
68 |
|
69 |
- (oneway void)remoteShellWithRef:(NSNumber *)ref |
70 |
hasAvailableData:(NSData *)data; |
71 |
|
72 |
@end |
73 |
|
74 |
@protocol GWSDProtocol |
75 |
|
76 |
- (void)registerRemoteClient:(id<GWSdClientProtocol>)remote; |
77 |
|
78 |
- (NSString *)homeDirectory; |
79 |
|
80 |
- (BOOL)existsFileAtPath:(NSString *)path; |
81 |
|
82 |
- (BOOL)existsAndIsDirectoryFileAtPath:(NSString *)path; |
83 |
|
84 |
- (NSString *)typeOfFileAt:(NSString *)path; |
85 |
|
86 |
- (BOOL)isPakageAtPath:(NSString *)path; |
87 |
|
88 |
- (NSDictionary *)fileSystemAttributesAtPath:(NSString *)path; |
89 |
|
90 |
- (BOOL)isWritableFileAtPath:(NSString *)path; |
91 |
|
92 |
- (NSDate *)modificationDateForPath:(NSString *)path; |
93 |
|
94 |
- (int)sortTypeForDirectoryAtPath:(NSString *)aPath; |
95 |
|
96 |
- (void)setSortType:(int)type forDirectoryAtPath:(NSString *)aPath; |
97 |
|
98 |
- (NSDictionary *)directoryContentsAtPath:(NSString *)path; |
99 |
|
100 |
- (NSString *)contentsOfFileAt:(NSString *)path; |
101 |
|
102 |
- (BOOL)saveString:(NSString *)str atPath:(NSString *)path; |
103 |
|
104 |
- (void)addWatcherForPath:(NSString *)path; |
105 |
|
106 |
- (void)removeWatcherForPath:(NSString *)path; |
107 |
|
108 |
- (oneway void)performLocalFileOperationWithDictionary:(id)opdict; |
109 |
|
110 |
- (BOOL)pauseFileOpeRationWithRef:(int)ref; |
111 |
|
112 |
- (BOOL)continueFileOpeRationWithRef:(int)ref; |
113 |
|
114 |
- (BOOL)stopFileOpeRationWithRef:(int)ref; |
115 |
|
116 |
- (oneway void)renamePath:(NSString *)oldname toNewName:(NSString *)newname; |
117 |
|
118 |
- (oneway void)newObjectAtPath:(NSString *)basePath isDirectory:(BOOL)directory; |
119 |
|
120 |
- (oneway void)duplicateFiles:(NSArray *)files inDirectory:(NSString *)basePath; |
121 |
|
122 |
- (oneway void)deleteFiles:(NSArray *)files inDirectory:(NSString *)basePath; |
123 |
|
124 |
- (oneway void)openShellOnPath:(NSString *)path refNumber:(NSNumber *)ref; |
125 |
|
126 |
- (oneway void)remoteShellWithRef:(NSNumber *)ref |
127 |
newCommandLine:(NSString *)line; |
128 |
|
129 |
- (oneway void)closedRemoteTerminalWithRefNumber:(NSNumber *)ref; |
130 |
|
131 |
@end |
132 |
|
133 |
@interface GWRemote : NSObject <GWSdClientProtocol> |
134 |
{ |
135 |
NSMutableDictionary *serversDict; |
136 |
NSMutableArray *serversNames; |
137 |
NSString *currentServer; |
138 |
NSString *loginServer; |
139 |
NSString *userName; |
140 |
NSString *userPassword; |
141 |
NSTimer *connectTimer; |
142 |
BOOL haveServersList; |
143 |
|
144 |
PrefController *prefController; |
145 |
LoginWindow *loginWindow; |
146 |
|
147 |
BOOL animateChdir; |
148 |
BOOL animateLaunck; |
149 |
BOOL animateSlideBack; |
150 |
|
151 |
NSMutableArray *fileOpIndicators; |
152 |
BOOL showFileOpStatus; |
153 |
|
154 |
BOOL starting; |
155 |
|
156 |
int shelfCellsWidth; |
157 |
|
158 |
NSMutableArray *viewers; |
159 |
ViewerWindow *currentViewer; |
160 |
ViewerWindow *rootViewer; |
161 |
|
162 |
NSMutableDictionary *cachedContents; |
163 |
int cachedMax; |
164 |
|
165 |
NSMutableArray *editors; |
166 |
|
167 |
NSMutableArray *terminals; |
168 |
NSNumber *remoteTermRef; |
169 |
|
170 |
id nc; |
171 |
id dstnc; |
172 |
NSFileManager *fm; |
173 |
NSWorkspace *ws; |
174 |
} |
175 |
|
176 |
+ (GWRemote *)gwremote; |
177 |
|
178 |
- (void)serversListChanged; |
179 |
|
180 |
- (void)tryLoginOnServer:(NSString *)servername |
181 |
withUserName:(NSString *)usrname |
182 |
userPassword:(NSString *)userpass; |
183 |
|
184 |
- (void)checkConnection:(id)sender; |
185 |
|
186 |
- (void)connectionDidDie:(NSNotification *)notification; |
187 |
|
188 |
- (void)readDefaultsForServer:(NSString *)serverName; |
189 |
|
190 |
- (NSMutableDictionary *)dictionaryForServer:(NSString *)serverName; |
191 |
|
192 |
- (id <GWSDProtocol>)serverWithName:(NSString *)serverName; |
193 |
|
194 |
- (id <GWSDProtocol>)serverWithConnection:(NSConnection *)conn; |
195 |
|
196 |
- (NSString *)nameOfServer:(id)server; |
197 |
|
198 |
- (NSArray *)viewersOfServer:(NSString *)serverName; |
199 |
|
200 |
- (NSString *)homeDirectoryForServerWithName:(NSString *)serverName; |
201 |
|
202 |
- (BOOL)server:(NSString *)serverName fileExistsAtPath:(NSString *)path; |
203 |
|
204 |
- (BOOL)server:(NSString *)serverName |
205 |
existsAndIsDirectoryFileAtPath:(NSString *)path; |
206 |
|
207 |
- (NSString *)server:(NSString *)serverName typeOfFileAt:(NSString *)path; |
208 |
|
209 |
- (BOOL)server:(NSString *)serverName isWritableFileAtPath:(NSString *)path; |
210 |
|
211 |
- (BOOL)server:(NSString *)serverName isPakageAtPath:(NSString *)path; |
212 |
|
213 |
- (BOOL)server:(NSString *)serverName isLockedPath:(NSString *)aPath; |
214 |
|
215 |
- (NSDictionary *)server:(NSString *)serverName |
216 |
fileSystemAttributesAtPath:(NSString *)path; |
217 |
|
218 |
- (int)server:(NSString *)serverName sortTypeForPath:(NSString *)aPath; |
219 |
|
220 |
- (void)server:(NSString *)serverName |
221 |
setSortType:(int)type |
222 |
atPath:(NSString *)aPath; |
223 |
|
224 |
- (BOOL)server:(NSString *)serverName verifyFileAtPath:(NSString *)path; |
225 |
|
226 |
- (NSArray *)server:(NSString *)serverName |
227 |
sortedDirectoryContentsAtPath:(NSString *)path; |
228 |
|
229 |
- (NSArray *)server:(NSString *)serverName |
230 |
checkHiddenFiles:(NSArray *)files |
231 |
atPath:(NSString *)path; |
232 |
|
233 |
- (NSMutableDictionary *)cachedRepresentationForPath:(NSString *)path |
234 |
onServer:(NSString *)serverName; |
235 |
|
236 |
- (void)addCachedRepresentation:(NSDictionary *)contentsDict |
237 |
ofDirectory:(NSString *)path |
238 |
onServer:(NSString *)serverName; |
239 |
|
240 |
- (void)removeCachedRepresentationForPath:(NSString *)path |
241 |
onServer:(NSString *)serverName; |
242 |
|
243 |
- (void)removeOlderCachedForServer:(NSString *)serverName; |
244 |
|
245 |
- (int)entriesInCacheOfServer:(NSString *)serverName; |
246 |
|
247 |
- (NSArray *)selectedPathsForServerWithName:(NSString *)serverName; |
248 |
|
249 |
- (void)server:(NSString *)serverName setSelectedPaths:(NSArray *)paths; |
250 |
|
251 |
- (void)server:(NSString *)serverName |
252 |
openSelectedPaths:(NSArray *)paths |
253 |
newViewer:(BOOL)newv; |
254 |
|
255 |
- (void)server:(NSString *)serverName |
256 |
newObjectAtPath:(NSString *)basePath |
257 |
isDirectory:(BOOL)directory; |
258 |
|
259 |
- (void)duplicateFilesOnServerName:(NSString *)serverName; |
260 |
|
261 |
- (void)deleteFilesOnServerName:(NSString *)serverName; |
262 |
|
263 |
- (void)server:(NSString *)serverName |
264 |
renamePath:(NSString *)oldname |
265 |
toNewName:(NSString *)newname; |
266 |
|
267 |
- (void)performFileOperationWithDictionary:(id)opdict |
268 |
fromSourceHost:(NSString *)fromName |
269 |
toDestinationHost:(NSString *)toName; |
270 |
|
271 |
- (BOOL)pauseFileOperationWithRef:(int)ref |
272 |
onServerWithName:(NSString *)serverName; |
273 |
|
274 |
- (BOOL)continueFileOperationWithRef:(int)ref |
275 |
onServerWithName:(NSString *)serverName; |
276 |
|
277 |
- (BOOL)stopFileOperationWithRef:(int)ref |
278 |
onServerWithName:(NSString *)serverName; |
279 |
|
280 |
- (void)fileSystemWillChangeNotification:(NSNotification *)notif; |
281 |
|
282 |
- (void)fileSystemDidChangeNotification:(NSNotification *)notif; |
283 |
|
284 |
- (void)server:(NSString *)serverName addWatcherForPath:(NSString *)path; |
285 |
|
286 |
- (void)server:(NSString *)serverName removeWatcherForPath:(NSString *)path; |
287 |
|
288 |
- (ViewerWindow *)server:(NSString *)serverName |
289 |
newViewerAtPath:(NSString *)path |
290 |
canViewApps:(BOOL)viewapps; |
291 |
|
292 |
- (void)setCurrentViewer:(ViewerWindow *)viewer; |
293 |
|
294 |
- (id)rootViewer; |
295 |
|
296 |
- (void)viewerHasClosed:(id)sender; |
297 |
|
298 |
- (BOOL)editor:(RemoteEditor *)editor |
299 |
didEditContents:(NSString *)contents |
300 |
ofFile:(NSString *)filepath |
301 |
onRemoteHost:(NSString *)serverName; |
302 |
|
303 |
- (void)remoteEditorHasClosed:(RemoteEditor *)editor; |
304 |
|
305 |
- (void)newTerminal; |
306 |
|
307 |
- (void)remoteTerminalHasClosed:(RemoteTerminal *)terminal; |
308 |
|
309 |
- (void)_exitedShellTaskWithRef:(NSNumber *)ref; |
310 |
|
311 |
- (RemoteTerminal *)remoteTerminalWithRef:(NSNumber *)ref; |
312 |
|
313 |
- (void)_remoteShellWithRef:(NSNumber *)ref hasAvailableData:(NSData *)data; |
314 |
|
315 |
- (void)terminalWithRef:(NSNumber *)ref newCommandLine:(NSString *)line; |
316 |
|
317 |
- (NSNumber *)remoteTerminalRef; |
318 |
|
319 |
- (NSImage *)iconForFile:(NSString *)fullPath ofType:(NSString *)type; |
320 |
|
321 |
- (NSImage *)getImageWithName:(NSString*)name |
322 |
alternate:(NSString *)alternate; |
323 |
|
324 |
- (NSImage *)unknownFiletypeImage; |
325 |
|
326 |
- (NSImage *)folderImage; |
327 |
|
328 |
- (int)shelfCellsWidth; |
329 |
|
330 |
- (int)defaultShelfCellsWidth; |
331 |
|
332 |
- (void)setShelfCellsWidth:(int)w; |
333 |
|
334 |
- (void)updateDefaults; |
335 |
|
336 |
|
337 |
// |
338 |
// Menu Operations |
339 |
// |
340 |
- (void)showViewer:(id)sender; |
341 |
|
342 |
- (void)openRemoteTerminal:(id)sender; |
343 |
|
344 |
- (void)closeMainWin:(id)sender; |
345 |
|
346 |
- (void)showPreferences:(id)sender; |
347 |
|
348 |
- (void)showLoginWindow:(id)sender; |
349 |
|
350 |
- (void)showInfo:(id)sender; |
351 |
|
352 |
- (void)logout:(id)sender; |
353 |
|
354 |
#ifndef GNUSTEP |
355 |
- (void)terminate:(id)sender; |
356 |
#endif |
357 |
|
358 |
@end |
359 |
|
360 |
#endif // GWREMOTE_H |