|
1 /* |
|
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: The definitions of file operation codes and their parameters |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef RSFWINTERFACE_H |
|
20 #define RSFWINTERFACE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <f32file.h> |
|
24 #include <s32strm.h> |
|
25 |
|
26 #include "rsfwcommon.h" |
|
27 #include "rsfwfile.h" |
|
28 |
|
29 // CONSTANTS |
|
30 _LIT(KRSFWDefaultDrive, "C:"); |
|
31 _LIT(KCacheRootDefault, "\\system\\data\\rsfw_cache\\"); |
|
32 _LIT(KTempFileName, "temp"); |
|
33 _LIT(KRsfwConfigPath, "\\data\\rscfw.cfg"); |
|
34 _LIT(KResolutionLogPath, "\\logs\\rsfw\\rsfw.log"); |
|
35 _LIT(KConfigNameCacheRoot, "cache_root"); |
|
36 _LIT(KDirReadAllMask, "*"); |
|
37 _LIT(KRemoteFs, "eremotefs"); |
|
38 _LIT(KRemoteFSName, "RemoteFS"); |
|
39 _LIT(KPanicSource, "RemoteFS"); |
|
40 _LIT(KRemoteVolumeName, "RemoteFS"); |
|
41 _LIT(KRemoteFEName, "RemoteFE"); |
|
42 _LIT(KCachePanicSource, "cache manager"); |
|
43 _LIT(KRfeInputData, "RemoteFeInputArgsChunk"); |
|
44 _LIT(KRfeOutputData, "RemoteFeOutputArgsChunk"); |
|
45 _LIT(KRfeDataSemaphoreName, "RemoteFeDataSemaphore"); |
|
46 _LIT(KRfeMain, "RemoteFeMain"); |
|
47 _LIT(KRsfwMounterExe, "rsfwbootmounter"); |
|
48 |
|
49 const TInt KMaxMimeTypeLength = 64; |
|
50 // Node Types |
|
51 const TUint KNodeTypeUnknown = 0x00; |
|
52 const TUint KNodeTypeFile = 0x01; |
|
53 const TUint KNodeTypeDir = 0x02; |
|
54 |
|
55 |
|
56 // DATA TYPES |
|
57 // Remote File System plug-in <--> Remote File Engine communications |
|
58 enum TRfeIoctl |
|
59 { |
|
60 ERemoteFsIoctlRefresh = 1, |
|
61 ERemoteFsProtect, |
|
62 ERemoteFsHighCachePriority |
|
63 }; |
|
64 |
|
65 enum TRfeClose |
|
66 { |
|
67 ECloseNotModified, |
|
68 ECloseModified, |
|
69 ECloseLastFlushFailed |
|
70 }; |
|
71 |
|
72 // CLASS DECLARATIONS |
|
73 |
|
74 /** |
|
75 * Node identifier in the framework |
|
76 * |
|
77 * @lib Rsfwsession.dll |
|
78 * @since Series 60 3.1 |
|
79 */ |
|
80 class TFid |
|
81 { |
|
82 public: // New functions |
|
83 inline TBool operator==( const TFid& aFid ) const; |
|
84 public: // Data |
|
85 // Identifiers the volume. Each mount is an own volume. |
|
86 TInt iVolumeId; |
|
87 // Identifies the node (i.e. file or directory) inside the volume. |
|
88 TInt iNodeId; |
|
89 }; |
|
90 |
|
91 /** |
|
92 * Directory attributes for a file or directory. |
|
93 * |
|
94 * @lib rsfwsession.dll |
|
95 * @since Series 60 3.1 |
|
96 */ |
|
97 class TDirEntAttr |
|
98 { |
|
99 public: // New functions |
|
100 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; |
|
101 IMPORT_C void InternalizeL( RReadStream& aStream ); |
|
102 IMPORT_C void Clear(); |
|
103 |
|
104 public: // Data |
|
105 // attribute bits |
|
106 TUint iAtt; |
|
107 // file size in bytes |
|
108 TInt iSize; |
|
109 // last modified |
|
110 TTime iModified; |
|
111 // Symbian data-type (UID) |
|
112 TUid iUid3; |
|
113 }; |
|
114 |
|
115 /** |
|
116 * Encapsulates a file or directory entry. |
|
117 * |
|
118 * @lib rsfwsession.dll |
|
119 * @since Series 60 3.1 |
|
120 */ |
|
121 class TDirEnt |
|
122 { |
|
123 public: // New functions |
|
124 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; |
|
125 IMPORT_C void InternalizeL( RReadStream& aStream ); |
|
126 IMPORT_C void Clear(); |
|
127 |
|
128 public: // Data |
|
129 // attributes |
|
130 TDirEntAttr iAttr; |
|
131 // filename |
|
132 TFileName iName; |
|
133 }; |
|
134 |
|
135 /** |
|
136 * Remote File Engine input parameters header |
|
137 * |
|
138 * @lib rsfwsession.dll |
|
139 * @since Series 60 3.1 |
|
140 */ |
|
141 class TRfeInArgs |
|
142 { |
|
143 public: |
|
144 // operation code, used to cast this instance into the right impl. class |
|
145 TInt iOpCode; |
|
146 // The fid of the target file (not used in root operation). |
|
147 TFid iFid; |
|
148 }; |
|
149 |
|
150 /** |
|
151 * Remote File Engine output parameters header |
|
152 * |
|
153 * @lib rsfwsession.dll |
|
154 * @since Series 60 3.1 |
|
155 */ |
|
156 class TRfeOutArgs |
|
157 { |
|
158 public: // Data |
|
159 TUint iUnique; // The request ID |
|
160 }; |
|
161 |
|
162 /** |
|
163 * Remote File Engine operation input and output parameter structures |
|
164 * |
|
165 * @lib rsfwsession.dll |
|
166 * @since Series 60 3.1 |
|
167 */ |
|
168 // Close |
|
169 class TRfeCloseInArgs : public TRfeInArgs |
|
170 { |
|
171 public: |
|
172 TInt iFlags; |
|
173 }; |
|
174 |
|
175 // Create |
|
176 class TRfeCreateInArgs : public TRfeInArgs |
|
177 { |
|
178 public: |
|
179 TDirEnt iEntry; |
|
180 TInt iExcl; |
|
181 }; |
|
182 |
|
183 class TRfeCreateOutArgs : public TRfeOutArgs |
|
184 { |
|
185 public: |
|
186 TFid iFid; |
|
187 TDirEntAttr iAttr; |
|
188 }; |
|
189 |
|
190 // Fetch and cache |
|
191 class TRfeFetchInArgs : public TRfeInArgs |
|
192 { |
|
193 public: |
|
194 TInt iFirstByte; |
|
195 TInt iLastByte; |
|
196 }; |
|
197 |
|
198 class TRfeFetchOutArgs : public TRfeOutArgs |
|
199 { |
|
200 public: |
|
201 // last byte that was actually fetched, might be more than was requested |
|
202 TInt iLastByte; |
|
203 }; |
|
204 |
|
205 // Fetch without caching |
|
206 class TRfeFetchDataInArgs : public TRfeInArgs |
|
207 { |
|
208 public: |
|
209 TInt iFirstByte; |
|
210 TInt iLastByte; |
|
211 }; |
|
212 |
|
213 class TRfeFetchDataOutArgs : public TRfeOutArgs |
|
214 { |
|
215 public: |
|
216 TFileName iTempPath; |
|
217 TBool iUseTempPath; |
|
218 }; |
|
219 |
|
220 // flush |
|
221 class TRfeFlushInArgs : public TRfeInArgs |
|
222 { |
|
223 public: |
|
224 TInt iFirstByte; |
|
225 TInt iDataLength; |
|
226 TInt iTotalSize; |
|
227 }; |
|
228 |
|
229 |
|
230 // Fsync |
|
231 class TRfeFsyncInArgs : public TRfeInArgs |
|
232 { |
|
233 public: |
|
234 }; |
|
235 |
|
236 // GetAttr |
|
237 class TRfeGetAttrInArgs : public TRfeInArgs |
|
238 { |
|
239 public: |
|
240 }; |
|
241 |
|
242 class TRfeGetAttrOutArgs : public TRfeOutArgs |
|
243 { |
|
244 public: |
|
245 TDirEntAttr iAttr; |
|
246 }; |
|
247 |
|
248 // Ioctl |
|
249 class TRfeIoctlInArgs : public TRfeInArgs |
|
250 { |
|
251 public: |
|
252 TInt iCmd; |
|
253 TInt iLen; |
|
254 union |
|
255 { |
|
256 TUint8 iData8[1]; |
|
257 TUint32 iData32[1]; |
|
258 }; |
|
259 }; |
|
260 |
|
261 // Lookup |
|
262 class TRfeLookupInArgs : public TRfeInArgs |
|
263 { |
|
264 public: |
|
265 TFileName iName; |
|
266 TUint iNodeType; |
|
267 }; |
|
268 |
|
269 class TRfeLookupOutArgs : public TRfeOutArgs |
|
270 { |
|
271 public: |
|
272 TFid iFid; |
|
273 }; |
|
274 |
|
275 // Mkdir |
|
276 class TRfeMkdirInArgs : public TRfeInArgs |
|
277 { |
|
278 public: |
|
279 TDirEnt iEntry; |
|
280 }; |
|
281 |
|
282 class TRfeMkdirOutArgs : public TRfeOutArgs |
|
283 { |
|
284 public: |
|
285 TFid iFid; |
|
286 TDirEntAttr iAttr; |
|
287 }; |
|
288 |
|
289 // OpenByPath |
|
290 class TRfeOpenByPathInArgs : public TRfeInArgs |
|
291 { |
|
292 public: |
|
293 TUint iFlags; |
|
294 TBool iTrueOpen; |
|
295 }; |
|
296 |
|
297 |
|
298 class TRfeOpenByPathOutArgs : public TRfeOutArgs |
|
299 { |
|
300 public: |
|
301 TFileName iPath; |
|
302 TDirEntAttr iAttr; |
|
303 }; |
|
304 |
|
305 // Remove |
|
306 class TRfeRemoveInArgs : public TRfeInArgs |
|
307 { |
|
308 public: |
|
309 TFileName iName; |
|
310 }; |
|
311 |
|
312 // Rename |
|
313 class TRfeRenameInArgs : public TRfeInArgs |
|
314 { |
|
315 public: |
|
316 TFileName iSrcName; |
|
317 TFid iDstFid; |
|
318 TFileName iDstName; |
|
319 TBool iOverWrite; |
|
320 }; |
|
321 |
|
322 // Rmdir |
|
323 class TRfeRmdirInArgs : public TRfeInArgs |
|
324 { |
|
325 public: |
|
326 TFileName iName; |
|
327 }; |
|
328 |
|
329 // Root operation returns the fid of the volume root |
|
330 class TRfeRootInArgs : public TRfeInArgs |
|
331 { |
|
332 }; |
|
333 |
|
334 class TRfeRootOutArgs : public TRfeOutArgs |
|
335 { |
|
336 public: |
|
337 TFid iFid; |
|
338 }; |
|
339 |
|
340 // SetAttr |
|
341 class TRfeSetAttrInArgs : public TRfeInArgs |
|
342 { |
|
343 public: |
|
344 TDirEntAttr iMask; |
|
345 TDirEntAttr iAttr; |
|
346 }; |
|
347 |
|
348 // Requests whether it is ok to write n bytes to the local cache |
|
349 class TRfeWriteDataInArgs : public TRfeInArgs |
|
350 { |
|
351 public: |
|
352 // Number of bytes to be written. |
|
353 TUint iBytes; |
|
354 }; |
|
355 |
|
356 class TRfeWriteDataOutArgs : public TRfeOutArgs |
|
357 { |
|
358 public: |
|
359 // Permission to write. |
|
360 TBool iOkToWrite; |
|
361 }; |
|
362 |
|
363 #include "rsfwinterface.inl" |
|
364 |
|
365 #endif // RSFWINTERFACE_H |
|
366 |
|
367 // End of File |