|
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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Contains declaration for BSUL class to cache drive information |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 |
|
24 #ifndef CCACHEDDRIVEINFO_H |
|
25 #define CCACHEDDRIVEINFO_H |
|
26 |
|
27 #include <e32def.h> |
|
28 #include <f32file.h> |
|
29 |
|
30 namespace BSUL |
|
31 { |
|
32 /** |
|
33 Class used to cache F32 drive information. |
|
34 @see TDriveInfo |
|
35 @publishedAll |
|
36 @released |
|
37 */ |
|
38 NONSHARABLE_CLASS(CCachedDriveInfo) : public CBase |
|
39 { |
|
40 private: // private type declarations |
|
41 // Struct to hold drive and media attributes retrieved from a TDriveInfo. |
|
42 struct TDriveAndMediaAttributes |
|
43 { |
|
44 // bit-field of drive attributes |
|
45 TUint32 iDriveAttributes; |
|
46 // bit-field of media attributes |
|
47 TUint32 iMediaAttributes; |
|
48 // Media type of the drive |
|
49 TMediaType iMediaType; |
|
50 }; |
|
51 |
|
52 public: // public methods |
|
53 IMPORT_C static CCachedDriveInfo* NewL(RFs& aFs); |
|
54 IMPORT_C static CCachedDriveInfo* NewLC(RFs& aFs); |
|
55 IMPORT_C ~CCachedDriveInfo(); |
|
56 |
|
57 IMPORT_C TBool IsReadOnlyInternalL(const TDesC& aFullName) const; |
|
58 IMPORT_C TBool IsReadOnlyInternalL(TDriveUnit aDrive) const; |
|
59 IMPORT_C TBool IsFlagSetOnDriveL(TDriveUnit aDrive, TUint aFlags) const; |
|
60 IMPORT_C TBool MediaTypeL(TDriveUnit aDrive, TMediaType aTestValue, TMediaType* aActual = NULL) const; |
|
61 IMPORT_C TDriveUnit GetDefaultRemovableMemoryCardDriveL() const; |
|
62 |
|
63 private: // private methods |
|
64 CCachedDriveInfo(); |
|
65 void ConstructL(RFs& aFs); |
|
66 |
|
67 static TDriveUnit PathToDriveUnitL(const TDesC& aFullName); |
|
68 |
|
69 private: // private data |
|
70 // Array containing the cached attributes for every drive. |
|
71 TDriveAndMediaAttributes iDriveAndMediaAttributes[KMaxDrives]; |
|
72 }; |
|
73 } |
|
74 |
|
75 #endif // #ifndef CCACHEDDRIVEINFO_H |