|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __FBFILEOPCLIENT_H__ |
|
20 #define __FBFILEOPCLIENT_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 #include "FBFileOpClientServer.h" // TFileOpArgs |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 |
|
29 // CLASS DECLARATIONS |
|
30 |
|
31 class RFBFileOpServerSession : public RSessionBase |
|
32 { |
|
33 public: |
|
34 TInt Connect(); |
|
35 |
|
36 void Copy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch, TRequestStatus& aStatus); |
|
37 TInt Rename(const TDesC& anOld, const TDesC& aNew, TUint aSwitch); |
|
38 TInt Attribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch); |
|
39 void RmDir(const TDesC& aDirName, TUint aSwitch, TRequestStatus& aStatus); |
|
40 void Delete(const TDesC& aName, TUint aSwitch, TRequestStatus& aStatus); |
|
41 TInt MkDirAll(const TDesC& aPath); |
|
42 TInt CreateEmptyFile(const TDesC& aName); |
|
43 TInt EraseMBR(TUint aDriveNumber); |
|
44 TInt PartitionDrive(TUint aDriveNumber, TUint aNumberOfPartitions); |
|
45 TInt CancelOp(); |
|
46 |
|
47 private: |
|
48 TVersion Version() const; |
|
49 TPckgBuf<TFileOpArgs> iPckgBuf; |
|
50 }; |
|
51 |
|
52 |
|
53 class CFBFileOpClient : public CBase |
|
54 { |
|
55 public: |
|
56 IMPORT_C static CFBFileOpClient* NewL(); |
|
57 IMPORT_C ~CFBFileOpClient(); |
|
58 IMPORT_C TInt Copy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch); |
|
59 IMPORT_C TInt Rename(const TDesC& anOld, const TDesC& aNew, TUint aSwitch); |
|
60 IMPORT_C TInt Attribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch); |
|
61 IMPORT_C TInt RmDir(const TDesC& aDirName, TUint aSwitch); |
|
62 IMPORT_C TInt Delete(const TDesC& aName, TUint aSwitch); |
|
63 IMPORT_C TInt MkDirAll(const TDesC& aPath); |
|
64 IMPORT_C TInt CreateEmptyFile(const TDesC& aName); |
|
65 IMPORT_C TInt EraseMBR(TUint aDriveNumber); |
|
66 IMPORT_C TInt PartitionDrive(TUint aDriveNumber, TUint aNumberOfPartitions); |
|
67 IMPORT_C void CancelOp(); |
|
68 |
|
69 private: |
|
70 CFBFileOpClient(); |
|
71 void ConstructL(); |
|
72 |
|
73 private : |
|
74 RFBFileOpServerSession iFBFileOpServerSession; |
|
75 }; |
|
76 |
|
77 |
|
78 /** |
|
79 * Similar class as CAsyncWaiter defined in FBUtils.h, except |
|
80 * CAsyncWaiterClient uses iWait.AsyncStop() instead of |
|
81 * CAknEnv::StopSchedulerWaitWithBusyMessage( iWait ) |
|
82 * to stop the nested loop. This class can be utilized |
|
83 * if CAknEnv is not running. |
|
84 */ |
|
85 class CAsyncWaiterClient : public CActive |
|
86 { |
|
87 public: |
|
88 static CAsyncWaiterClient* NewL( TInt aPriority = EPriorityStandard ); |
|
89 static CAsyncWaiterClient* NewLC( TInt aPriority = EPriorityStandard ); |
|
90 ~CAsyncWaiterClient(); |
|
91 |
|
92 void StartAndWait(); |
|
93 TInt Result() const; |
|
94 |
|
95 private: |
|
96 CAsyncWaiterClient( TInt aPriority ); |
|
97 |
|
98 // from CActive |
|
99 void RunL(); |
|
100 void DoCancel(); |
|
101 |
|
102 private: |
|
103 CActiveSchedulerWait iWait; |
|
104 TInt iError; |
|
105 }; |
|
106 |
|
107 #endif |
|
108 |