|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32test\defrag\d_defrag.h |
|
15 // |
|
16 // |
|
17 |
|
18 #if !defined(__D_DEFRAG_H__) |
|
19 #define __D_DEFRAG_H__ |
|
20 #include <e32cmn.h> |
|
21 #ifndef __KERNEL_MODE__ |
|
22 #include <e32std.h> |
|
23 #endif |
|
24 |
|
25 |
|
26 _LIT(KLddName,"DefragRef"); |
|
27 |
|
28 class TCapsDefragTestV01 |
|
29 { |
|
30 public: |
|
31 TVersion iVersion; |
|
32 }; |
|
33 |
|
34 /** User-side interface to the defrag LDD |
|
35 */ |
|
36 class RDefragChannel : public RBusLogicalChannel |
|
37 { |
|
38 public: |
|
39 enum TControl |
|
40 { |
|
41 EControlGeneralDefragDfc, |
|
42 EControlGeneralDefragDfcComplete, |
|
43 EControlGeneralDefragSem, |
|
44 EControlGeneralDefrag, |
|
45 EControlAllocLowestZone, |
|
46 EControlClaimLowestZone, |
|
47 EControlCloseChunk, |
|
48 }; |
|
49 |
|
50 public: |
|
51 inline TInt Open(); |
|
52 inline TInt GeneralDefragDfc(TRequestStatus* aReq); |
|
53 inline TInt GeneralDefragDfcComplete(); |
|
54 inline TInt GeneralDefrag(); |
|
55 inline TInt GeneralDefragSem(); |
|
56 inline TInt AllocLowestZone(); |
|
57 inline TInt ClaimLowestZone(); |
|
58 inline TInt CloseChunk(); |
|
59 }; |
|
60 |
|
61 |
|
62 #ifndef __KERNEL_MODE__ |
|
63 inline TInt RDefragChannel::Open() |
|
64 { |
|
65 return DoCreate(KLddName,TVersion(0,1,1),KNullUnit,NULL,NULL); |
|
66 } |
|
67 |
|
68 inline TInt RDefragChannel::GeneralDefragDfc(TRequestStatus* aReq) |
|
69 { |
|
70 if (aReq != NULL) |
|
71 { |
|
72 *aReq = KRequestPending; |
|
73 } |
|
74 return DoControl(EControlGeneralDefragDfc, (TAny*)aReq); |
|
75 } |
|
76 |
|
77 inline TInt RDefragChannel::GeneralDefragDfcComplete() |
|
78 { |
|
79 return DoControl(EControlGeneralDefragDfcComplete); |
|
80 } |
|
81 |
|
82 inline TInt RDefragChannel::GeneralDefragSem() |
|
83 { return DoControl(EControlGeneralDefragSem); } |
|
84 |
|
85 inline TInt RDefragChannel::GeneralDefrag() |
|
86 { return DoControl(EControlGeneralDefrag); } |
|
87 |
|
88 inline TInt RDefragChannel::AllocLowestZone() |
|
89 { return DoControl(EControlAllocLowestZone); } |
|
90 |
|
91 inline TInt RDefragChannel::ClaimLowestZone() |
|
92 { return DoControl(EControlClaimLowestZone);} |
|
93 |
|
94 inline TInt RDefragChannel::CloseChunk() |
|
95 { return DoControl(EControlCloseChunk); } |
|
96 #endif |
|
97 |
|
98 #endif |