35 #include <bautils.h> |
35 #include <bautils.h> |
36 #include <eikmenup.h> |
36 #include <eikmenup.h> |
37 #include <eikbtgpc.h> |
37 #include <eikbtgpc.h> |
38 #include <hlplch.h> |
38 #include <hlplch.h> |
39 #include <StringLoader.h> |
39 #include <StringLoader.h> |
40 #include <layoutmetadata.cdl.h> |
40 |
41 // Middle Softkey control ID. |
41 // Middle Softkey control ID. |
42 const TInt KGSMSKControlID = 3; |
42 const TInt KGSMSKControlID = 3; |
43 const TInt KGSMSKLength = 256; |
43 const TInt KGSMSKLength = 256; |
44 const TInt KGSPluginArrayInitSize = 10; |
44 const TInt KGSPluginArrayInitSize = 10; |
45 |
45 |
212 TBuf<1> empty( KEmptyText ); |
212 TBuf<1> empty( KEmptyText ); |
213 iContainer->SetListBoxEmptyTextL( empty ); |
213 iContainer->SetListBoxEmptyTextL( empty ); |
214 |
214 |
215 // Update listbox from already existing iPluginArray: |
215 // Update listbox from already existing iPluginArray: |
216 iContainer->UpdateListBoxL(); |
216 iContainer->UpdateListBoxL(); |
217 if (position.Count() > 0) |
217 iAppUi->AddToViewStackL( *this, iContainer ); |
218 { |
218 if( iTopPluginUid != KGSNoneSelected ) |
219 if (iScreenMode == Layout_Meta_Data::IsLandscapeOrientation()) |
219 { |
220 { |
220 iContainer->SetTopItem( iTopPluginUid ); |
221 iContainer->SetPosition(position, EFalse); |
221 } |
222 } |
222 if( iSelectedPluginUid != KGSNoneSelected ) |
223 else |
223 { |
224 { |
224 iContainer->SetSelectedItem( iSelectedPluginUid ); |
225 iContainer->SetPosition(position, ETrue); |
225 } |
226 } |
226 } |
227 } |
227 |
228 iAppUi->AddToViewStackL(*this, iContainer); |
|
229 // Navigating to parent view will reset all child plugin selected indexes: |
228 // Navigating to parent view will reset all child plugin selected indexes: |
230 for( TInt i = 0; i < iPluginArray->Count(); i++ ) |
229 for( TInt i = 0; i < iPluginArray->Count(); i++ ) |
231 { |
230 { |
232 CGSPluginInterface* plugin = iPluginArray->operator[]( i ); |
231 CGSPluginInterface* plugin = iPluginArray->operator[]( i ); |
233 plugin->ResetSelectedItemIndex(); |
232 plugin->ResetSelectedItemIndex(); |
236 iMskCommandId = EAknSoftkeyOpen; |
235 iMskCommandId = EAknSoftkeyOpen; |
237 |
236 |
238 SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen ); |
237 SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen ); |
239 CheckMiddleSoftkeyLabelL(); |
238 CheckMiddleSoftkeyLabelL(); |
240 |
239 |
241 // If this view was launched from external source, use "exit" as RSK |
240 // If this view was launched from external source, use "exit" as RSK |
242 if (iPrevViewId.iAppUid != KUidGS) |
241 if ( iPrevViewId.iAppUid != KUidGS ) |
|
242 { |
|
243 CEikButtonGroupContainer* cbaGroup = Cba(); |
|
244 if(cbaGroup) |
243 { |
245 { |
244 CEikButtonGroupContainer* cbaGroup = Cba(); |
246 HBufC* rightSKText = StringLoader::LoadLC (R_GS_PARENTPLUGIN_CBA_EXIT); |
245 if (cbaGroup) |
247 TPtr rskPtr = rightSKText->Des(); |
246 { |
248 cbaGroup->SetCommandL(2,EAknSoftkeyExit,*rightSKText); |
247 HBufC* rightSKText = StringLoader::LoadLC( |
249 CleanupStack::PopAndDestroy(rightSKText); |
248 R_GS_PARENTPLUGIN_CBA_EXIT); |
|
249 TPtr rskPtr = rightSKText->Des(); |
|
250 cbaGroup->SetCommandL(2, EAknSoftkeyExit, *rightSKText); |
|
251 CleanupStack::PopAndDestroy(rightSKText); |
|
252 } |
|
253 } |
250 } |
254 |
|
255 } |
251 } |
|
252 |
256 } |
253 } |
257 |
254 |
258 // --------------------------------------------------------------------------- |
255 // --------------------------------------------------------------------------- |
259 // CGSParentPlugin::DoDeactivate() |
256 // CGSParentPlugin::DoDeactivate() |
260 // |
257 // |
266 |
263 |
267 iPluginLoader->RequestPriority( CActive::EPriorityLow ); |
264 iPluginLoader->RequestPriority( CActive::EPriorityLow ); |
268 |
265 |
269 if ( iContainer ) |
266 if ( iContainer ) |
270 { |
267 { |
271 if (position.Count() > 0) |
268 CGSPluginInterface* selectedPlugin = iContainer->SelectedPlugin(); |
272 { |
269 if( selectedPlugin ) |
273 position.Reset(); |
270 { |
274 } |
271 iSelectedPluginUid = selectedPlugin->Id(); |
275 TRAPD(err, iContainer->GetPositionL(position)); |
272 } |
276 iScreenMode = Layout_Meta_Data::IsLandscapeOrientation(); |
273 else |
277 |
274 { |
278 iAppUi->RemoveFromViewStack(*this, iContainer); |
275 iSelectedPluginUid = KGSNoneSelected; |
|
276 } |
|
277 |
|
278 CGSPluginInterface* topPlugin = iContainer->TopPlugin(); |
|
279 if ( topPlugin ) |
|
280 { |
|
281 iTopPluginUid = topPlugin->Id(); |
|
282 } |
|
283 else |
|
284 { |
|
285 iTopPluginUid = KGSNoneSelected; |
|
286 } |
|
287 iAppUi->RemoveFromViewStack( *this, iContainer ); |
279 delete iContainer; |
288 delete iContainer; |
280 iContainer = NULL; |
289 iContainer = NULL; |
281 } |
290 } |
282 __GSLOGSTRING( "[CGSParentPlugin::DoDeactivate] Done" ); |
291 __GSLOGSTRING( "[CGSParentPlugin::DoDeactivate] Done" ); |
283 } |
292 } |