|
1 /* |
|
2 * Copyright (c) 2007-2007 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: Flash File System (FFS) check helper class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CPBK2FFSCHECK_H__ |
|
20 #define __CPBK2FFSCHECK_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> // CBase |
|
24 #include <f32file.h> |
|
25 |
|
26 #include <TVPbkContactStoreUriPtr.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CCoeEnv; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Flash File System (FFS) check helper class. |
|
35 */ |
|
36 class CPbk2DriveSpaceCheck : public CBase |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 /** |
|
40 * Creates a new instance of this class. |
|
41 * @param aFs open file server session, if not given |
|
42 * it will be created. |
|
43 */ |
|
44 IMPORT_C static CPbk2DriveSpaceCheck* NewL( RFs& aFs ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CPbk2DriveSpaceCheck(); |
|
50 |
|
51 public: // New functions |
|
52 /** |
|
53 * Checks critical drive space level. If SetStore is not called before |
|
54 * using this it checks the FFS critical level. If SetStore is called |
|
55 * and store is not located to any drive, this will always pass. |
|
56 * If critical level is reached, this will leave KErrDiskFull. |
|
57 */ |
|
58 IMPORT_C void DriveSpaceCheckL(); |
|
59 |
|
60 /** |
|
61 * Sets current drive to be checked, if given store is in any drive |
|
62 * @param aUriPtr Store Uri that is checked is it in any drive |
|
63 */ |
|
64 IMPORT_C void SetStore( const TVPbkContactStoreUriPtr aUriPtr ); |
|
65 |
|
66 /** |
|
67 * Sets current drive to be checked, if given store is in any drive |
|
68 * @param aFilePath A drive name or file path |
|
69 */ |
|
70 IMPORT_C void SetStore( const TDesC& aFilePath ); |
|
71 |
|
72 private: // Implementation |
|
73 CPbk2DriveSpaceCheck( RFs& aFs ); |
|
74 |
|
75 private: // Data |
|
76 /// Not Owned: CONE environment |
|
77 RFs& iFs; |
|
78 /// Own: drive where store is located if set with SetStore |
|
79 // see TDriveNumber of f32file.h |
|
80 TInt iDrive; |
|
81 /// Own: Store is located to some drive |
|
82 TBool iStoreIsInDrive; |
|
83 }; |
|
84 |
|
85 #endif // __CPBK2FFSCHECK_H__ |
|
86 |
|
87 // End of File |