|
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 implementation of the Hardware Diagnostics |
|
15 * Suite, which is used to contain all tests and suites. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // System Include Files |
|
21 #include <DiagFrameworkDebug.h> // Debugging Macros |
|
22 #include <StringLoader.h> // StringLoader |
|
23 #include <gulicon.h> // CGulIcon |
|
24 #include <AknIconUtils.h> // AknIconUtils |
|
25 #include <devdiaghardwaresuitepluginrsc.rsg> // Resource Definitions |
|
26 #include <devdiaghardwaresuiteplugin.mbg> // Icon Indices |
|
27 |
|
28 // User Include Files |
|
29 #include "diaghardwaresuiteplugin.h" // CDiagHardwareSuitePlugin |
|
30 #include "diaghardwaresuiteplugin.hrh" // UID definition |
|
31 #include "diaghardwaresuiteplugin.pan" // Panic |
|
32 |
|
33 // Local Constants |
|
34 _LIT( KDiagHardwareSuitePluginResourceFileName, |
|
35 "z:devdiaghardwaresuitepluginrsc.rsc" ); |
|
36 const TUid KDiagHardwareSuitePluginUid = { _UID3 }; |
|
37 |
|
38 |
|
39 // ============================ GLOBAL FUNCTIONS ============================= |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // Static two-phase constructor. |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 MDiagPlugin* CDiagHardwareSuitePlugin::NewL( TAny* aInitParams ) |
|
46 { |
|
47 LOGSTRING2( "CDiagHardwareSuitePlugin::NewL( 0x%x )", aInitParams ) |
|
48 |
|
49 __ASSERT_ALWAYS( aInitParams, |
|
50 Panic( EDiagHardwareSuitePluginConstruction ) ); |
|
51 |
|
52 // Construct the plugin. The base class will take ownership of the |
|
53 // initialization parameters. |
|
54 CDiagPluginConstructionParam* param = |
|
55 static_cast< CDiagPluginConstructionParam* >( aInitParams ); |
|
56 |
|
57 CleanupStack::PushL( param ); |
|
58 CDiagHardwareSuitePlugin* self = |
|
59 new( ELeave ) CDiagHardwareSuitePlugin( param ); |
|
60 CleanupStack::Pop( param ); |
|
61 |
|
62 CleanupStack::PushL( self ); |
|
63 self->ConstructL(); |
|
64 CleanupStack::Pop( self ); |
|
65 |
|
66 return self; |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // Destructor. |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 CDiagHardwareSuitePlugin::~CDiagHardwareSuitePlugin() |
|
74 { |
|
75 LOGSTRING( "CDiagHardwareSuitePlugin::~CDiagHardwareSuitePlugin()" ) |
|
76 |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // The default constructor. |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 CDiagHardwareSuitePlugin::CDiagHardwareSuitePlugin( |
|
84 CDiagPluginConstructionParam* aParam ) |
|
85 : CDiagSuitePluginBase( aParam ) |
|
86 { |
|
87 LOGSTRING2( |
|
88 "CDiagHardwareSuitePlugin::CDiagHardwareSuitePlugin( 0x%x )", |
|
89 aParam ) |
|
90 |
|
91 } |
|
92 |
|
93 // --------------------------------------------------------------------------- |
|
94 // The second phase constructor. |
|
95 // --------------------------------------------------------------------------- |
|
96 // |
|
97 void CDiagHardwareSuitePlugin::ConstructL() |
|
98 { |
|
99 LOGSTRING( "CDiagHardwareSuitePlugin::ConstructL()" ); |
|
100 BaseConstructL ( KDiagHardwareSuitePluginResourceFileName ); |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // From class MDiagPlugin. |
|
105 // Returns whether the plugin should be displayed or not. |
|
106 // --------------------------------------------------------------------------- |
|
107 TBool CDiagHardwareSuitePlugin::IsVisible() const |
|
108 { |
|
109 return ETrue; |
|
110 } |
|
111 |
|
112 // --------------------------------------------------------------------------- |
|
113 // From class MDiagPlugin. |
|
114 // Returns the plugin name. |
|
115 // --------------------------------------------------------------------------- |
|
116 HBufC* CDiagHardwareSuitePlugin::GetPluginNameL( |
|
117 TNameLayoutType aLayoutType ) const |
|
118 { |
|
119 switch ( aLayoutType ) |
|
120 { |
|
121 case ENameLayoutListLargeGraphic: |
|
122 return StringLoader::LoadL( R_DIAG_HARDWARE_SUITE_LIST_LARGE_GRAPHIC ); |
|
123 |
|
124 case ENameLayoutHeadingPane: |
|
125 return StringLoader::LoadL( R_DIAG_HARDWARE_SUITE_HEADING_PANE ); |
|
126 |
|
127 case ENameLayoutPopupInfoPane: |
|
128 return StringLoader::LoadL( R_DIAG_HARDWARE_SUITE_POPUP_INFO_PANE ); |
|
129 |
|
130 case ENameLayoutTitlePane: |
|
131 return StringLoader::LoadL( R_DIAG_HARDWARE_SUITE_TITLE_PANE ); |
|
132 |
|
133 case ENameLayoutListSingleGraphic: |
|
134 return StringLoader::LoadL( R_DIAG_HARDWARE_SUITE_LIST_SINGLE_GRAPHIC ); |
|
135 |
|
136 case ENameLayoutListSingle: |
|
137 return StringLoader::LoadL( R_DIAG_HARDWARE_SUITE_LIST_SINGLE ); |
|
138 |
|
139 default: |
|
140 __ASSERT_DEBUG( EFalse, |
|
141 Panic( EDiagHardwareSuitePluginBadArgument ) ); |
|
142 return StringLoader::LoadL( R_DIAG_HARDWARE_SUITE_LIST_LARGE_GRAPHIC ); |
|
143 } |
|
144 } |
|
145 |
|
146 // --------------------------------------------------------------------------- |
|
147 // From class MDiagPlugin. |
|
148 // Returns the plugin's UID. |
|
149 // --------------------------------------------------------------------------- |
|
150 TUid CDiagHardwareSuitePlugin::Uid() const |
|
151 { |
|
152 return KDiagHardwareSuitePluginUid; |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------------------------- |
|
156 // From class MDiagPlugin. |
|
157 // Load the plugin's icon. |
|
158 // --------------------------------------------------------------------------- |
|
159 // |
|
160 CGulIcon* CDiagHardwareSuitePlugin::CreateIconL() const |
|
161 { |
|
162 LOGSTRING( "CDiagHardwareSuitePlugin::CreateIconL()" ) |
|
163 |
|
164 _LIT( KDiagHardwareSuitePluginIconFile, |
|
165 "\\resource\\apps\\devdiaghardwaresuiteplugin.mif" ); |
|
166 |
|
167 // Load the icon. |
|
168 CFbsBitmap* bitmap; |
|
169 CFbsBitmap* mask; |
|
170 AknIconUtils::CreateIconL( |
|
171 bitmap, |
|
172 mask, |
|
173 KDiagHardwareSuitePluginIconFile(), |
|
174 EMbmDevdiaghardwaresuitepluginQgn_prop_cp_diag_hw, |
|
175 EMbmDevdiaghardwaresuitepluginQgn_prop_cp_diag_hw_mask ); |
|
176 |
|
177 // Create the icon. |
|
178 return CGulIcon::NewL( bitmap, mask ); |
|
179 } |
|
180 |
|
181 // --------------------------------------------------------------------------- |
|
182 // From class CActive. |
|
183 // Active object run handler. |
|
184 // --------------------------------------------------------------------------- |
|
185 void CDiagHardwareSuitePlugin::RunL() |
|
186 { |
|
187 } |
|
188 |
|
189 // --------------------------------------------------------------------------- |
|
190 // From class CActive. |
|
191 // Active object cancel. |
|
192 // --------------------------------------------------------------------------- |
|
193 void CDiagHardwareSuitePlugin::DoCancel() |
|
194 { |
|
195 } |
|
196 |
|
197 // End of File |