25
|
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: Internal Memory Plugin
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef DIAGINTERNALMEMORYPLUGIN_H
|
|
20 |
#define DIAGINTERNALMEMORYPLUGIN_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 KDiagInternalMemoryPluginUid = { 0x2000E589 };
|
|
29 |
_LIT( KDiagInternalMemoryPluginResourceFileName, "z:DevDiagInternalMemoryPluginRsc.rsc" );
|
|
30 |
const TInt KDiagInternalMemoryBufferSize = 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 CDiagInternalMemoryPlugin : 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 ~CDiagInternalMemoryPlugin();
|
|
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 |
TBool ShowMessageQueryL(TInt aResourceId,TInt &aButtonId);
|
|
99 |
|
|
100 |
|
|
101 |
private: // from CDiagTestPluginBase
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Handle plug-in execution.
|
|
105 |
* @see CDiagTestPluginBase::DoRunTestL
|
|
106 |
*/
|
|
107 |
virtual void DoRunTestL();
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Stop and clean up
|
|
111 |
* @see CDiagTestPluginBase::DoStopAndCleanupL
|
|
112 |
*/
|
|
113 |
virtual void DoStopAndCleanupL();
|
|
114 |
|
|
115 |
private: // from CActive
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Handle active object completion event
|
|
119 |
*/
|
|
120 |
virtual void RunL();
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Handle RunL leaves
|
|
124 |
*/
|
|
125 |
virtual TInt RunError( TInt aError );
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Handle cancel
|
|
129 |
*/
|
|
130 |
virtual void DoCancel();
|
|
131 |
|
|
132 |
private: // from MProgressDialogCallback
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Called when the progress dialog is dismissed.
|
|
136 |
*
|
|
137 |
* @param aButtonId - indicate which button made dialog to dismiss
|
|
138 |
*/
|
|
139 |
virtual void DialogDismissedL( TInt aButtonId );
|
|
140 |
|
|
141 |
void ShowProgressNoteL();
|
|
142 |
|
|
143 |
private: // private functions
|
|
144 |
|
|
145 |
/**
|
|
146 |
* C++ default constructor.
|
|
147 |
*/
|
|
148 |
CDiagInternalMemoryPlugin( CDiagPluginConstructionParam* aInitParams );
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Symbian OS default constructor.
|
|
152 |
*
|
|
153 |
*/
|
|
154 |
void ConstructL();
|
|
155 |
|
|
156 |
/*
|
|
157 |
* Close file sessions
|
|
158 |
*/
|
|
159 |
void Reset();
|
|
160 |
|
|
161 |
/*
|
|
162 |
* Set the states
|
|
163 |
*/
|
|
164 |
void SetState( TStates aState );
|
|
165 |
|
|
166 |
void ReportResultToPluginL(CDiagResultsDatabaseItem::TResult aResult);
|
|
167 |
|
|
168 |
private: // data
|
|
169 |
|
|
170 |
TInt iCounter;
|
|
171 |
TStates iState; //rw states
|
|
172 |
RFs iFs;
|
|
173 |
RFile iFile;
|
|
174 |
RFile iFile2;
|
|
175 |
TBuf8<KDiagInternalMemoryBufferSize > iBufw;
|
|
176 |
TBuf8<KDiagInternalMemoryBufferSize > iBufr;
|
|
177 |
TFileName iFileName;
|
|
178 |
TBool idialogOn;
|
|
179 |
TBool idialogDismissed;
|
|
180 |
CAknWaitDialog* iWaitDialog;
|
|
181 |
|
|
182 |
};
|
|
183 |
|
|
184 |
#endif //DIAGINTERNALMEMORYPLUGIN_H
|
|
185 |
|
|
186 |
// End of File
|