|
1 /* |
|
2 * Copyright (c) 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: External Media Card Plugin |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DIAGEXTERNALMEDIACARDPLUGIN_H |
|
20 #define DIAGEXTERNALMEDIACARDPLUGIN_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <DiagTestPluginBase.h> // CDiagTestPluginBase |
|
24 #include <DiagResultsDatabaseItem.h> // DiagResultsDatabaseItem::TResult |
|
25 #include <f32file.h> // RFs, RFile |
|
26 #include <AknWaitDialog.h> |
|
27 //CONSTANTS |
|
28 const TUid KDiagExternalMediaCardPluginUid = { 0x2000E58B }; |
|
29 _LIT( KDiagExternalMediaCardPluginResourceFileName, "z:DevDiagExternalMediaCardPluginRsc.rsc" ); |
|
30 const TInt KDiagExternalMediaCardBufferSize = 256; |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // DATA TYPES |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class CDiagResultsDbItemBuilder; |
|
40 |
|
41 // CLASS DEFINITION |
|
42 class CDiagExternalMediaCardPlugin : public CDiagTestPluginBase, |
|
43 public MProgressDialogCallback |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 |
|
47 enum TStates |
|
48 { |
|
49 EIdle, |
|
50 EWriting, |
|
51 EReading |
|
52 }; |
|
53 |
|
54 /** |
|
55 * Symbian OS two-phased constructor |
|
56 * @return Timer Test Plugin |
|
57 */ |
|
58 static MDiagPlugin* NewL( TAny* aInitParams ); |
|
59 |
|
60 /** |
|
61 * Destructor |
|
62 */ |
|
63 virtual ~CDiagExternalMediaCardPlugin(); |
|
64 |
|
65 public: // From CDiagTestPluginBase |
|
66 |
|
67 /** |
|
68 * @see CDiagTestPluginBase::IsVisible() |
|
69 */ |
|
70 virtual TBool IsVisible() const; |
|
71 |
|
72 /** |
|
73 * @see CDiagTestPluginBase::IsSupported() |
|
74 */ |
|
75 virtual TBool IsSupported() const; |
|
76 |
|
77 /** |
|
78 * @see CDiagTestPluginBase::RunMode() |
|
79 */ |
|
80 virtual TRunMode RunMode() const; |
|
81 |
|
82 /** |
|
83 * @see CDiagTestPluginBase::TotalSteps() |
|
84 */ |
|
85 virtual TUint TotalSteps() const; |
|
86 |
|
87 /** |
|
88 * @see CDiagTestPluginBase::GetPluginNameL |
|
89 */ |
|
90 virtual HBufC* GetPluginNameL( TNameLayoutType aLayoutType ) const; |
|
91 |
|
92 /** |
|
93 * @see CDiagTestPluginBase::Uid |
|
94 */ |
|
95 virtual TUid Uid() const; |
|
96 |
|
97 |
|
98 private: // from CDiagTestPluginBase |
|
99 |
|
100 /** |
|
101 * Handle plug-in execution. |
|
102 * @see CDiagTestPluginBaseExtended::DoRunTestL |
|
103 */ |
|
104 virtual void DoRunTestL(); |
|
105 |
|
106 /** |
|
107 * Stop and clean up |
|
108 * @see CDiagTestPluginBaseExtended::DoStopAndCleanupL |
|
109 */ |
|
110 virtual void DoStopAndCleanupL(); |
|
111 |
|
112 private: // from CActive |
|
113 |
|
114 /** |
|
115 * Handle active object completion event |
|
116 */ |
|
117 virtual void RunL(); |
|
118 |
|
119 /** |
|
120 * Handle RunL leaves |
|
121 */ |
|
122 virtual TInt RunError( TInt aError ); |
|
123 |
|
124 /** |
|
125 * Handle cancel |
|
126 */ |
|
127 virtual void DoCancel(); |
|
128 |
|
129 private: // from MProgressDialogCallback |
|
130 |
|
131 /** |
|
132 * Called when the progress dialog is dismissed. |
|
133 * |
|
134 * @param aButtonId - indicate which button made dialog to dismiss |
|
135 */ |
|
136 virtual void DialogDismissedL( TInt aButtonId ); |
|
137 |
|
138 void ShowProgressNoteL(); |
|
139 |
|
140 private: // private functions |
|
141 |
|
142 /** |
|
143 * C++ default constructor. |
|
144 */ |
|
145 CDiagExternalMediaCardPlugin( CDiagPluginConstructionParam* aInitParams ); |
|
146 |
|
147 /** |
|
148 * Symbian OS default constructor. |
|
149 * |
|
150 */ |
|
151 void ConstructL(); |
|
152 |
|
153 /* |
|
154 * Set the states |
|
155 */ |
|
156 void SetState( TStates aState ); |
|
157 |
|
158 // ADO & Platformization Changes |
|
159 TBool ShowMessageQueryL( TInt aResourceId, TInt &aButtonId ); |
|
160 |
|
161 void ReportResultToPluginL(CDiagResultsDatabaseItem::TResult aResult); |
|
162 |
|
163 TBool ShowTitleMessageL(); |
|
164 |
|
165 private: // data |
|
166 TInt iCounter; |
|
167 TStates iState; //rw states |
|
168 RFs iFs; |
|
169 RFile iFile; |
|
170 RFile iFile2; |
|
171 TBuf8<KDiagExternalMediaCardBufferSize> iBufw; |
|
172 TBuf8<KDiagExternalMediaCardBufferSize> iBufr; |
|
173 TFileName iFileName; |
|
174 TBool idialogOn; |
|
175 TBool idialogDismissed; |
|
176 CAknWaitDialog* iWaitDialog; |
|
177 |
|
178 }; |
|
179 |
|
180 #endif //DIAGEXTERNALMEDIACARDPLUGIN_H |
|
181 |
|
182 // End of File |