1 /* |
1 /* |
2 * Copyright (c) 2007-2007 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
149 |
149 |
150 iOfferedPluginUids.Reset(); |
150 iOfferedPluginUids.Reset(); |
151 |
151 |
152 delete iSettingsUi; |
152 delete iSettingsUi; |
153 delete iContainer; |
153 delete iContainer; |
154 |
154 delete iEngTimer; |
|
155 |
155 CSCDEBUG( "CCSCServiceView::~CCSCServiceView - end" ); |
156 CSCDEBUG( "CCSCServiceView::~CCSCServiceView - end" ); |
156 } |
|
157 |
|
158 |
|
159 // --------------------------------------------------------------------------- |
|
160 // Updates container data because of layout change. |
|
161 // --------------------------------------------------------------------------- |
|
162 // |
|
163 void CCSCServiceView::UpdateLayout( TInt aType ) |
|
164 { |
|
165 CSCDEBUG( "CCSCServiceView::UpdateLayout - begin" ); |
|
166 |
|
167 if ( iContainer ) |
|
168 { |
|
169 iContainer->SetRect( ClientRect() ); |
|
170 TRAP_IGNORE( iContainer->UpdateServiceViewL() ); |
|
171 iContainer->HandleResourceChange( aType ); |
|
172 } |
|
173 |
|
174 CSCDEBUG( "CCSCServiceView::UpdateLayout - end" ); |
|
175 } |
157 } |
176 |
158 |
177 |
159 |
178 // --------------------------------------------------------------------------- |
160 // --------------------------------------------------------------------------- |
179 // CCSCServiceView::InitializeWithStartupParametersL |
161 // CCSCServiceView::InitializeWithStartupParametersL |
511 // --------------------------------------------------------------------------- |
493 // --------------------------------------------------------------------------- |
512 // |
494 // |
513 TBool CCSCServiceView::HandleServiceConfigurationL( TUid aUid ) |
495 TBool CCSCServiceView::HandleServiceConfigurationL( TUid aUid ) |
514 { |
496 { |
515 CSCDEBUG( "CCSCServiceView::HandleServiceConfigurationL" ); |
497 CSCDEBUG( "CCSCServiceView::HandleServiceConfigurationL" ); |
516 |
498 |
517 TInt initializedCount( iServicePluginHandler.PluginCount( |
499 TInt initializedCount( iServicePluginHandler.PluginCount( |
518 CCSCEngServicePluginHandler::EInitialized ) ); |
500 CCSCEngServicePluginHandler::EInitialized ) ); |
519 |
501 |
520 TBool canceled( EFalse ); |
502 TBool canceled( EFalse ); |
521 TServicePluginInfo pluginInfo; |
503 TServicePluginInfo pluginInfo; |
522 |
504 |
|
505 iUid = aUid; |
|
506 |
523 if ( KNullUid != aUid ) |
507 if ( KNullUid != aUid ) |
524 { |
508 { |
525 for ( TInt i( 0 ) ; i < initializedCount ; i++ ) |
509 for ( TInt i( 0 ) ; i < initializedCount ; i++ ) |
526 { |
510 { |
527 pluginInfo = iServicePluginHandler.ItemFromPluginInfoArray( i ); |
511 pluginInfo = iServicePluginHandler.ItemFromPluginInfoArray( i ); |
528 |
512 |
529 if ( aUid == pluginInfo.iPluginsUid && !pluginInfo.iProvisioned ) |
513 if ( aUid == pluginInfo.iPluginsUid && !pluginInfo.iProvisioned ) |
530 { |
514 { |
531 iStartupHandler.ResetUid( CCSCEngStartupHandler::EPluginUid ); |
515 iStartupHandler.ResetUid( CCSCEngStartupHandler::EPluginUid ); |
532 |
516 |
533 iOfferedPluginUids.Append( pluginInfo.iPluginsUid ); |
517 iOfferedPluginUids.Append( pluginInfo.iPluginsUid ); |
534 |
518 |
535 CCSCNoteUtilities::TCSCNoteType |
519 iPluginInfo = pluginInfo; |
536 type = CCSCNoteUtilities::ECSCConfigureServiceQuery; |
520 |
537 |
521 iNextPluginIndex = i; |
538 if ( CCSCNoteUtilities::ShowCommonQueryL( |
522 |
539 type, pluginInfo.iProviderName ) ) |
523 delete iEngTimer; |
540 { |
524 iEngTimer = NULL; |
541 iServicePluginHandler.DoProvisioningL( |
525 iEngTimer = CCSCEngTimer::NewL( *this ); |
542 pluginInfo.iPluginsUid, KCSCServiceViewId ); |
526 |
543 } |
527 iEngTimer->StartTimer( CCSCEngTimer::ENoteDelayTimer ); |
544 else |
528 |
545 { |
529 break; |
546 canceled = ETrue; |
|
547 } |
|
548 } |
530 } |
549 } |
531 } |
550 |
532 |
551 } |
533 } |
552 else |
534 else |
553 { |
535 { |
554 for ( TInt j( 0 ) ; j < initializedCount ; j++ ) |
536 for ( TInt j( 0 ) ; j < initializedCount ; j++ ) |
555 { |
537 { |
556 pluginInfo = iServicePluginHandler.ItemFromPluginInfoArray( j ); |
538 pluginInfo = iServicePluginHandler.ItemFromPluginInfoArray( j ); |
557 |
539 |
558 if ( !pluginInfo.iProvisioned ) |
540 if ( !pluginInfo.iProvisioned ) |
559 { |
541 { |
560 iOfferedPluginUids.Append( pluginInfo.iPluginsUid ); |
542 iOfferedPluginUids.Append( pluginInfo.iPluginsUid ); |
561 |
543 |
562 CCSCNoteUtilities::TCSCNoteType type = |
544 iPluginInfo = pluginInfo; |
563 CCSCNoteUtilities::ECSCConfigureServiceQuery; |
545 |
564 |
546 iNextPluginIndex = j; |
565 if ( CCSCNoteUtilities::ShowCommonQueryL( |
547 |
566 type, pluginInfo.iProviderName ) ) |
548 delete iEngTimer; |
567 { |
549 iEngTimer = NULL; |
568 iServicePluginHandler.DoProvisioningL( |
550 iEngTimer = CCSCEngTimer::NewL( *this ); |
569 pluginInfo.iPluginsUid, KCSCServiceViewId ); |
551 |
570 } |
552 iEngTimer->StartTimer( CCSCEngTimer::ENoteDelayTimer ); |
571 else |
553 |
572 { |
554 break; |
573 canceled = ETrue; |
555 } |
574 } |
556 } |
575 } |
557 } |
576 } |
558 |
577 } |
559 return canceled; |
578 |
|
579 return canceled; |
|
580 } |
560 } |
581 |
561 |
582 |
562 |
583 // --------------------------------------------------------------------------- |
563 // --------------------------------------------------------------------------- |
584 // Executes startup actions based on startup parameters. |
564 // Executes startup actions based on startup parameters. |
822 iContainer = NULL; |
800 iContainer = NULL; |
823 } |
801 } |
824 |
802 |
825 CSCDEBUG( "CCSCServiceView::DoDeactivate - end" ); |
803 CSCDEBUG( "CCSCServiceView::DoDeactivate - end" ); |
826 } |
804 } |
827 |
805 |
|
806 |
|
807 // --------------------------------------------------------------------------- |
|
808 // From class MCSCEngTimerObserver. |
|
809 // CCSCServiceView::TimerExpired |
|
810 // --------------------------------------------------------------------------- |
|
811 // |
|
812 void CCSCServiceView::TimerExpired() |
|
813 { |
|
814 CSCDEBUG( "CCSCServiceView::TimerExpired - begin" ); |
|
815 |
|
816 iStartupHandler.ResetUid( CCSCEngStartupHandler::EPluginUid ); |
|
817 iOfferedPluginUids.Append( iPluginInfo.iPluginsUid ); |
|
818 |
|
819 CCSCNoteUtilities::TCSCNoteType |
|
820 type = CCSCNoteUtilities::ECSCConfigureServiceQuery; |
|
821 |
|
822 if ( CCSCNoteUtilities::ShowCommonQueryL( |
|
823 type, iPluginInfo.iProviderName ) ) |
|
824 { |
|
825 iServicePluginHandler.DoProvisioningL( |
|
826 iPluginInfo.iPluginsUid, KCSCServiceViewId ); |
|
827 } |
|
828 |
|
829 iNextPluginIndex++; |
|
830 TInt pluginCount = iServicePluginHandler.PluginCount( |
|
831 CCSCEngServicePluginHandler::EInitialized ); |
|
832 |
|
833 for ( ; iNextPluginIndex < pluginCount; iNextPluginIndex++ ) |
|
834 { |
|
835 CSCDEBUG2( "CCSCServiceView::TimerExpired -iNextPluginIndex = %d", |
|
836 iNextPluginIndex ); |
|
837 |
|
838 iPluginInfo = |
|
839 iServicePluginHandler.ItemFromPluginInfoArray( iNextPluginIndex ); |
|
840 |
|
841 if ( KNullUid != iUid ) |
|
842 { |
|
843 if ( iUid == iPluginInfo.iPluginsUid && !iPluginInfo.iProvisioned ) |
|
844 { |
|
845 iEngTimer->StartTimer( CCSCEngTimer::ENoteDelayTimer ); |
|
846 break; |
|
847 } |
|
848 } |
|
849 else |
|
850 { |
|
851 if ( !iPluginInfo.iProvisioned ) |
|
852 { |
|
853 iEngTimer->StartTimer( CCSCEngTimer::ENoteDelayTimer ); |
|
854 break; |
|
855 } |
|
856 } |
|
857 } |
|
858 CSCDEBUG( "CCSCServiceView::TimerExpired - end" ); |
|
859 } |
|
860 |