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: This file contains the header file of the CCUIDriveUtils class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CUIDRIVEUTILS_H |
|
20 #define CUIDRIVEUTILS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 |
|
27 namespace SwiUI |
|
28 { |
|
29 namespace CommonUI |
|
30 { |
|
31 |
|
32 /** |
|
33 * This class provides functions to launch a common file selection dialog. |
|
34 * @lib SWInstCommonUI.lib |
|
35 * @since 3.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS(CCUIDriveUtils) : public CBase |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 * @param aSize - Size of the package. |
|
44 * @param aDriveUnits - Array of available drives as drive units. |
|
45 * @param aDriveSpaces - Array of free space on each of the drives in the |
|
46 * aDriveLetters array. |
|
47 */ |
|
48 static CCUIDriveUtils* NewL( TInt64 aSize, |
|
49 const RArray<TDriveUnit>& aDriveUnits, |
|
50 const RArray<TInt64>& aDriveSpaces); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CCUIDriveUtils(); |
|
56 |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Show a drive selection dialog. |
|
62 * @since 3.0 |
|
63 * @param aSelectedDrive - Contains the drive letter that user selected. |
|
64 * @return ETrue is user selected a drive, EFalse if user canceled the query. |
|
65 */ |
|
66 TBool ShowSelectionDialogL( TInt& aSelectedDrive ); |
|
67 |
|
68 /** |
|
69 * Function to get info if internal drive is present (phone memory). |
|
70 * @since 3.0 |
|
71 * @return ETrue if yes, EFalse if no. |
|
72 */ |
|
73 TBool IsInternalDrivePresent() const; |
|
74 |
|
75 /** |
|
76 * Function to get info if memory card is present. |
|
77 * @since 3.0 |
|
78 * @return ETrue if yes, EFalse if no. |
|
79 */ |
|
80 TBool IsCardDrivePresent() const; |
|
81 |
|
82 /** |
|
83 * Get the free space on phone memory. |
|
84 * @since 3.0 |
|
85 * @return Free space on phone memory. |
|
86 */ |
|
87 TInt64 GetInternalDriveSpace() const; |
|
88 |
|
89 /** |
|
90 * Get the free space on memory card. |
|
91 * @since 3.0 |
|
92 * @return Free space on memory card. |
|
93 */ |
|
94 TInt64 GetCardDriveSpace() const; |
|
95 |
|
96 /** |
|
97 * Get the free space on drive. |
|
98 * @since 3.0 |
|
99 * @param aIndex - Drive index. |
|
100 * @return Free space on memory card. |
|
101 */ |
|
102 TInt64 GetDriveSpace( TInt aIndex ) const; |
|
103 |
|
104 /** |
|
105 * Get array index of the phone memory in the aDriveLetters array. |
|
106 * @since 3.0 |
|
107 * @return Array index of the phone memory. |
|
108 */ |
|
109 TInt GetInternalDriveIndex() const; |
|
110 |
|
111 /** |
|
112 * Get array index of the memory card in the aDriveLetters array. |
|
113 * @since 3.0 |
|
114 * @return Array index of the memory card. |
|
115 */ |
|
116 TInt GetCardDriveIndex() const; |
|
117 |
|
118 private: |
|
119 |
|
120 /** |
|
121 * Constructor. |
|
122 * @param aSize - Size of the package. |
|
123 * @param aDriveUnits - Array of available drives as drive units. |
|
124 * @param aDriveSpaces - Array of free space on each of the drives in the |
|
125 * aDriveLetters array. |
|
126 */ |
|
127 CCUIDriveUtils( TInt64 aSize, |
|
128 const RArray<TDriveUnit>& aDriveUnits, |
|
129 const RArray<TInt64>& aDriveSpaces); |
|
130 |
|
131 /** |
|
132 * 2nd phase constructor. |
|
133 */ |
|
134 void ConstructL(); |
|
135 |
|
136 private: // Data |
|
137 |
|
138 TInt64 iSize; |
|
139 const RArray<TDriveUnit>& iDriveUnits; |
|
140 const RArray<TInt64>& iDriveSpaces; |
|
141 |
|
142 TInt iInternalArrayIndex; |
|
143 TInt iCardArrayIndex; |
|
144 |
|
145 TChar iCardDriveLetter; |
|
146 |
|
147 TInt64 iInternalFreeMemory; |
|
148 TInt64 iCardFreeMemory; |
|
149 }; |
|
150 } |
|
151 } |
|
152 |
|
153 #endif // SWCOMMONUI_H |
|
154 |
|
155 // End of File |
|