/[gnustep]/gnustep/usr-apps/gworkspace/GWorkspace/FileOperations/FileOperation.h
ViewVC logotype

Contents of /gnustep/usr-apps/gworkspace/GWorkspace/FileOperations/FileOperation.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Aug 25 17:19:14 2003 UTC (20 years, 8 months ago) by esersale
Branch: MAIN
Changes since 1.1: +24 -0 lines
File MIME type: text/plain
*** empty log message ***

1 /* FileOperation.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 GWorkspace 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 #ifndef FILEOPERATION_H
26 #define FILEOPERATION_H
27
28 #include <Foundation/NSObject.h>
29
30 @class NSString;
31 @class NSMutableArray;
32 @class NSMutableDictionary;
33 @class NSFileManager;
34 @class NSTimer;
35 @class NSLock;
36 @class GWorkspace;
37 @class FileOpExecutor;
38
39 @protocol FileOpProtocol
40
41 - (void)registerExecutor:(id)anObject;
42
43 - (int)requestUserConfirmationWithMessage:(NSString *)message
44 title:(NSString *)title;
45
46 - (int)showErrorAlertWithMessage:(NSString *)message;
47
48 - (void)updateProgressIndicator;
49
50 - (int)sendDidChangeNotification;
51
52 - (void)endOperation;
53
54 @end
55
56 @protocol FileOpExecutorProtocol
57
58 + (void)setPorts:(NSArray *)thePorts;
59
60 - (void)setFileop:(NSArray *)thePorts;
61
62 - (BOOL)setOperation:(NSDictionary *)opDict;
63
64 - (BOOL)checkSameName;
65
66 - (int)calculateNumFiles;
67
68 - (oneway void)performOperation;
69
70 - (void)Pause;
71
72 - (void)Stop;
73
74 - (BOOL)isPaused;
75
76 - (void)done;
77
78 @end
79
80 @interface FileOperation: NSObject <FileOpProtocol>
81 {
82 NSString *operation;
83 NSString *source;
84 NSString *destination;
85 NSMutableArray *files;
86 NSMutableDictionary *operationDict;
87 NSMutableArray *notifNames;
88 int fileOperationRef;
89 int filescount;
90 BOOL confirm;
91 BOOL showwin;
92 BOOL opdone;
93 NSConnection *execconn;
94 id <FileOpExecutorProtocol> executor;
95 NSTimer *timer;
96 NSNotificationCenter *dnc;
97 NSFileManager *fm;
98 GWorkspace *gw;
99
100 IBOutlet id win;
101 IBOutlet id fromLabel;
102 IBOutlet id fromField;
103 IBOutlet id toLabel;
104 IBOutlet id toField;
105 IBOutlet id progInd;
106 IBOutlet id pauseButt;
107 IBOutlet id stopButt;
108 }
109
110 - (id)initWithOperation:(NSString *)opr
111 source:(NSString *)src
112 destination:(NSString *)dest
113 files:(NSArray *)fls
114 useConfirmation:(BOOL)conf
115 showWindow:(BOOL)showw
116 windowRect:(NSRect)wrect;
117
118 - (void)checkExecutor:(id)sender;
119
120 - (BOOL)showFileOperationAlert;
121
122 - (void)showProgressWin;
123
124 - (void)sendWillChangeNotification;
125
126 - (IBAction)pause:(id)sender;
127
128 - (IBAction)stop:(id)sender;
129
130 - (int)fileOperationRef;
131
132 - (NSRect)winRect;
133
134 - (BOOL)showsWindow;
135
136 @end
137
138
139 @interface FileOpExecutor: NSObject <FileOpExecutorProtocol>
140 {
141 NSString *operation;
142 NSString *source;
143 NSString *destination;
144 NSMutableArray *files;
145 NSString *filename;
146 int fcount;
147 BOOL stopped;
148 BOOL paused;
149 BOOL canupdate;
150 BOOL samename;
151 NSFileManager *fm;
152 NSConnection *fopConn;
153 id <FileOpProtocol> fileOp;
154 }
155
156 - (void)doMove;
157
158 - (void)doCopy;
159
160 - (void)doLink;
161
162 - (void)doRemove;
163
164 - (void)doDuplicate;
165
166 - (void)removeExisting:(NSString *)fname;
167
168 @end
169
170 #endif // FILEOPERATION_H

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26