|
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: This is the header for the Diagnostics USB Cable Test Plug-in |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef DIAGUSBCABLETESTPLUGIN_H |
|
22 #define DIAGUSBCABLETESTPLUGIN_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 // System includes |
|
27 #include <DiagResultsDatabaseItem.h> // CDiagResultsDatabaseItem |
|
28 #include <DiagTestPluginBase.h> // CDiagTestPluginBase |
|
29 |
|
30 // User includes |
|
31 #include "diagusbcabletestcallbackinterface.h" // MDiagUSBTestCallBackInterface |
|
32 |
|
33 |
|
34 //CONSTANTS |
|
35 |
|
36 // MACROS |
|
37 |
|
38 // DATA TYPES |
|
39 |
|
40 // FUNCTION PROTOTYPES |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 class CDiagResultsDbItemBuilder; |
|
44 class CDiagUSBCableTestEngine; |
|
45 |
|
46 // CLASS DEFINITION |
|
47 class CDiagUSBCableTestPlugin : public CDiagTestPluginBase, |
|
48 public MDiagUSBTestCallBackInterface |
|
49 { |
|
50 |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Symbian OS two-phased constructor |
|
55 * @return USB CableTest Test Plugin |
|
56 */ |
|
57 static MDiagPlugin* NewL( TAny* aInitParams ); |
|
58 |
|
59 /** |
|
60 * Destructor |
|
61 */ |
|
62 ~CDiagUSBCableTestPlugin(); |
|
63 |
|
64 private: // from MDiagUSBTestCallBackInterface |
|
65 |
|
66 /** |
|
67 * The USB Cable Test Engine calls this callback to provide the result of the test |
|
68 */ |
|
69 void ReportTestResultL(CDiagResultsDatabaseItem::TResult aResult); |
|
70 |
|
71 /** |
|
72 * The engine class uses this callback on the plugin class to ask the user if the entire test |
|
73 * execution needs to be cancelled. |
|
74 * @param aUserResponse : The user response is returned in this reference argument. |
|
75 * |
|
76 * @return ETrue : The dialog was dismissed by the user. |
|
77 * EFalse : The dialog was dismissed internally. |
|
78 */ |
|
79 TBool AskCancelExecutionL(TInt& aUserResponse, TInt aOption); |
|
80 |
|
81 private: // From CDiagTestPluginBase |
|
82 |
|
83 /** |
|
84 * @see CDiagTestPluginBase::Visible() |
|
85 */ |
|
86 TBool IsVisible() const; |
|
87 |
|
88 /** |
|
89 * @see CDiagTestPluginBase::RunMode() |
|
90 */ |
|
91 TRunMode RunMode() const; |
|
92 |
|
93 /** |
|
94 * @see CDiagTestPluginBase::TotalSteps() |
|
95 */ |
|
96 TUint TotalSteps() const; |
|
97 |
|
98 /** |
|
99 * @see CDiagTestPluginBase::GetPluginNameL |
|
100 */ |
|
101 HBufC* GetPluginNameL( TNameLayoutType aLayoutType ) const; |
|
102 |
|
103 |
|
104 /** |
|
105 * @see CDiagTestPluginBase::Uid |
|
106 */ |
|
107 TUid Uid() const; |
|
108 |
|
109 /** |
|
110 * Handle plug-in execution. |
|
111 * @see CDiagTestPluginBase::DoRunTestL |
|
112 */ |
|
113 void DoRunTestL(); |
|
114 |
|
115 /** |
|
116 * Clean up |
|
117 * @see CDiagTestPluginBase::DoStopAndCleanupL |
|
118 */ |
|
119 void DoStopAndCleanupL(); |
|
120 |
|
121 private: // private constructors |
|
122 |
|
123 /** |
|
124 * C++ default constructor. |
|
125 */ |
|
126 CDiagUSBCableTestPlugin( CDiagPluginConstructionParam* aInitParams ); |
|
127 |
|
128 /** |
|
129 * Symbian OS default constructor. |
|
130 * |
|
131 */ |
|
132 void ConstructL(); |
|
133 |
|
134 |
|
135 |
|
136 private: // from CActive |
|
137 /** |
|
138 * Handle active object completion event |
|
139 */ |
|
140 void RunL(); |
|
141 |
|
142 /** |
|
143 * Handle cancel |
|
144 */ |
|
145 void DoCancel(); |
|
146 |
|
147 private: // private data |
|
148 |
|
149 /** |
|
150 * An instance of the engine class. Own |
|
151 */ |
|
152 CDiagUSBCableTestEngine *iEngine; |
|
153 }; |
|
154 |
|
155 #endif //DIAGUSBCABLETESTPLUGIN_H |
|
156 |
|
157 // End of File |
|
158 |