1 /* |
|
2 * Copyright (c) 2006 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: Memory state popup implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CMEMORYSTATEPOPUPIMPL_H__ |
|
20 #define __CMEMORYSTATEPOPUPIMPL_H__ |
|
21 |
|
22 // SYSTEM INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <AknWaitDialog.h> |
|
25 #include <ConeResLoader.h> |
|
26 #include <msenguihandler.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CAknPopupList; |
|
30 class CAknSingleHeadingPopupMenuStyleListBox; |
|
31 class CMemScanEventReceiver; |
|
32 class CMSPUtil; |
|
33 |
|
34 // CLASS DEFINITION |
|
35 NONSHARABLE_CLASS(CMemStatePopupImpl) : |
|
36 public CActive, |
|
37 public MMsengUIHandler, |
|
38 public MProgressDialogCallback |
|
39 { |
|
40 public: |
|
41 // Destructor |
|
42 virtual ~CMemStatePopupImpl( ); |
|
43 |
|
44 private: |
|
45 // Second phase |
|
46 void ConstructL( ); |
|
47 |
|
48 // C++ constructors |
|
49 CMemStatePopupImpl( TDriveNumber aDrive, const TDesC& aTitle ); |
|
50 CMemStatePopupImpl( ); |
|
51 |
|
52 public: |
|
53 /** |
|
54 * Launches the memory scan popup |
|
55 * @param aDrive The drive to be scanned |
|
56 * @param aTitle Title of the popup |
|
57 */ |
|
58 static void RunLD( TDriveNumber aDrive, const TDesC& aTitle ); |
|
59 |
|
60 /** |
|
61 * Get an instance of CMSPUtil class, containing the unit text array |
|
62 * @param aUtil Reference to a CMSPUtil pointer, |
|
63 * updated to point to the instance created |
|
64 */ |
|
65 static void GetUtilL( CMSPUtil*& aUtil ); |
|
66 |
|
67 public: |
|
68 // From MMsengUIHandler |
|
69 void StartL( ); |
|
70 void QuitL( TInt /*aReason*/ ); |
|
71 void ErrorL( TInt aError ); |
|
72 |
|
73 // From MProgressDialogCallback |
|
74 virtual void DialogDismissedL( TInt /*aButtonId*/ ); |
|
75 |
|
76 private: |
|
77 |
|
78 // From CActive |
|
79 void RunL(); |
|
80 void DoCancel(); |
|
81 |
|
82 /** |
|
83 * Starts observing drive dismounts. |
|
84 */ |
|
85 void StartObserver( ); |
|
86 |
|
87 /** |
|
88 * Construct popup and ready it for use. |
|
89 */ |
|
90 void ConstructPopupL( ); |
|
91 |
|
92 /** |
|
93 * Shows wait dialog and start scanning. |
|
94 */ |
|
95 void ExecuteL( ); |
|
96 |
|
97 /** |
|
98 * Refresh the data shown in listbox. |
|
99 */ |
|
100 void RefreshL( ); |
|
101 |
|
102 /** |
|
103 * Set the results to zero. |
|
104 */ |
|
105 void NullifyResults( ); |
|
106 |
|
107 /** |
|
108 * Opens the resource and reads unit array from it. |
|
109 */ |
|
110 void OpenResourceAndReadArrayL( ); |
|
111 |
|
112 private: |
|
113 // Not implemented |
|
114 CMemStatePopupImpl( const CMemStatePopupImpl& ); |
|
115 CMemStatePopupImpl& operator=( CMemStatePopupImpl& ); |
|
116 |
|
117 private: |
|
118 /** |
|
119 * Container class used to prevent all pointer events |
|
120 * passing from listbox to popup-list. |
|
121 */ |
|
122 NONSHARABLE_CLASS(CMemStateListBox) : public CAknSingleHeadingPopupMenuStyleListBox |
|
123 { |
|
124 public: |
|
125 // Destructor |
|
126 virtual ~CMemStateListBox( ) {}; |
|
127 }; |
|
128 |
|
129 private: |
|
130 CDesCArray* iGroupNames; |
|
131 CArrayFix< TInt64 >* iScanResults; |
|
132 CDesCArray* iListModel; |
|
133 CMemStateListBox* iListBox; |
|
134 CAknWaitDialog* iWaitDialog; |
|
135 TBool iFinished; |
|
136 TDriveNumber iDrive; |
|
137 CAknPopupList* iPopup; |
|
138 TDesC* iTitle; |
|
139 CCoeEnv& iCoeEnv; |
|
140 RConeResourceLoader iResLoader; |
|
141 CMSPUtil* iUtil; |
|
142 TBool iOwnsUtil; |
|
143 CMemScanEventReceiver* iEventReceiver; |
|
144 }; |
|
145 |
|
146 #endif // __CMEMORYSTATEPOPUPIMPL_H__ |
|
147 |
|
148 // End of File |
|