uifw/EikStd/srvuisrc/EIKSRVUI.CPP
branchRCL_3
changeset 19 aecbbf00d063
parent 13 a8834a2e9a96
child 20 d48ab3b357f1
equal deleted inserted replaced
18:fcdfafb36fe7 19:aecbbf00d063
   122 
   122 
   123 #include "AknNotifierControllerPlugin.h"
   123 #include "AknNotifierControllerPlugin.h"
   124 #include <AknCustomCursorSupport.h>
   124 #include <AknCustomCursorSupport.h>
   125 #include "AknEikSrv.pan"
   125 #include "AknEikSrv.pan"
   126 
   126 
       
   127 #include <hb/hbcore/hbsymbianvariant.h>
       
   128 #include <hb/hbcore/hbdevicedialogsymbian.h>
       
   129 
   127 #if defined(__WINS__)
   130 #if defined(__WINS__)
   128 const TInt KEikServSideBarWidth = 35;
   131 const TInt KEikServSideBarWidth = 35;
   129 const TInt KEikServAppbarHeight = 50;
   132 const TInt KEikServAppbarHeight = 50;
   130 #endif
   133 #endif
   131 
   134 
   582         R_EIK_SYSTEM_VIEW_SERVER_CLIENT_REQUEST_TIME_OUT, iEikonEnv);
   585         R_EIK_SYSTEM_VIEW_SERVER_CLIENT_REQUEST_TIME_OUT, iEikonEnv);
   583         
   586         
   584     iVwsSession->SetClientRequestTimeOut( TTimeIntervalMicroSeconds32(clientRequestTimeOutDuration) );
   587     iVwsSession->SetClientRequestTimeOut( TTimeIntervalMicroSeconds32(clientRequestTimeOutDuration) );
   585 
   588 
   586     iVwsSession->EnableServerBlankScreen(EFalse);
   589     iVwsSession->EnableServerBlankScreen(EFalse);
       
   590     iVwsSession->EnableServerEventTimeOut(EFalse);
   587     
   591     
   588     // Start Comms
   592     // Start Comms
   589     TInt err = StartC32();
   593     TInt err = StartC32();
   590     if (err != KErrNone && err != KErrAlreadyExists)
   594     if (err != KErrNone && err != KErrAlreadyExists)
   591         {
   595         {
   622     iEikServExtra->iServerRestarter = CPeriodic::NewL(CActive::EPriorityStandard);
   626     iEikServExtra->iServerRestarter = CPeriodic::NewL(CActive::EPriorityStandard);
   623     }
   627     }
   624 
   628 
   625 EXPORT_C void CEikServAppUiBase::HandleThreadExitL(RThread& aThread)
   629 EXPORT_C void CEikServAppUiBase::HandleThreadExitL(RThread& aThread)
   626     {
   630     {
       
   631     _LIT(KAppArcServerThread, "AppArcServerThread");
   627     if (aThread.Name() == ASCliDefinitions::ServerAndThreadName()) // alarm server died
   632     if (aThread.Name() == ASCliDefinitions::ServerAndThreadName()) // alarm server died
   628         {
   633         {
   629         aThread.Close(); // need to Close() before restarting with same name
   634         aThread.Close(); // need to Close() before restarting with same name
   630         iServerToRestart |= EAlwlSvr; // restarted under active object
   635         iServerToRestart |= EAlwlSvr; // restarted under active object
   631         }
   636         }
   632     else if (aThread.Name()==NameApaServServerThread()) // AppArc server died
   637     else if (aThread.Name() == KAppArcServerThread) // AppArc server died
   633         {
   638         {
   634         aThread.Close();
   639         aThread.Close();
   635         iServerToRestart|=EApaSvr;
   640         iServerToRestart|=EApaSvr;
   636         }
   641         }
   637         
   642         
  1057     // Invented new API.
  1062     // Invented new API.
  1058     ReplaceKeySoundsL(0x100053D0);
  1063     ReplaceKeySoundsL(0x100053D0);
  1059     KeySounds()->BringToForeground();
  1064     KeySounds()->BringToForeground();
  1060     }
  1065     }
  1061 
  1066 
       
  1067 LOCAL_C void ShowNotificationDialog(const TDesC& aNoteText)
       
  1068     {
       
  1069     _LIT(KNotificationDialogPlugin, "com.nokia.hb.devicenotificationdialog/1.0");
       
  1070     _LIT(KTimeout, "timeout");
       
  1071     _LIT(KTitle,   "title");
       
  1072 
       
  1073     //@TODO replace the hardcoded parameter after enum EASyncServerStartup
       
  1074     // is defined(after MCL wk26).
       
  1075     //CHbDeviceDialogSymbian* dlg = CHbDeviceDialogSymbian::NewL(
       
  1076     //                    CHbDeviceDialogSymbian::EASyncServerStartup);
       
  1077     CHbDeviceDialogSymbian* dlg = CHbDeviceDialogSymbian::NewL(2);
       
  1078     CleanupStack::PushL(dlg);
       
  1079 
       
  1080     TInt  timeout = 0;
       
  1081         
       
  1082     CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL();
       
  1083     CleanupStack::PushL(map);
       
  1084     
       
  1085     map->Add(KTimeout, CHbSymbianVariant::NewL(&timeout,    CHbSymbianVariant::EInt));
       
  1086     map->Add(KTitle,   CHbSymbianVariant::NewL(&aNoteText,  CHbSymbianVariant::EDes));
       
  1087     
       
  1088     dlg->Show(KNotificationDialogPlugin, *map);
       
  1089 
       
  1090     CleanupStack::PopAndDestroy(2);
       
  1091     }
  1062 
  1092 
  1063 void CEikServAppUi::HandleThreadExitL(RThread& aThread)
  1093 void CEikServAppUi::HandleThreadExitL(RThread& aThread)
  1064     {
  1094     {
  1065     if(aThread.Name().CompareF(_L("aknnfysrv")) == 0)
  1095     if(aThread.Name().CompareF(_L("aknnfysrv")) == 0)
  1066         {
  1096         {
  1092         KFeatureIdShowPanics )) )
  1122         KFeatureIdShowPanics )) )
  1093         {
  1123         {
  1094         // Construct text for a panic note.
  1124         // Construct text for a panic note.
  1095         HBufC* panicText = ConstructPanicTextLC( aThread, rdSupport );
  1125         HBufC* panicText = ConstructPanicTextLC( aThread, rdSupport );
  1096         
  1126         
  1097         iAknCapServerClient.ShowGlobalNoteL(panicText->Des(), EAknGlobalErrorNote);
  1127         /* iAknCapServerClient.ShowGlobalNoteL(panicText->Des(), EAknGlobalErrorNote); */
       
  1128 
       
  1129         ShowNotificationDialog( panicText->Des() );
       
  1130 
  1098         CleanupStack::PopAndDestroy(); // panicText
  1131         CleanupStack::PopAndDestroy(); // panicText
  1099         }
  1132         }
  1100         
  1133         
  1101     CEikServAppUiBase::HandleThreadExitL(aThread);
  1134     CEikServAppUiBase::HandleThreadExitL(aThread);
  1102     }
  1135     }
  1161     }
  1194     }
  1162 
  1195 
  1163 void CEikServAppUi::HandleResourceChangeL(TInt aType)
  1196 void CEikServAppUi::HandleResourceChangeL(TInt aType)
  1164     {
  1197     {
  1165     CEikServAppUiBase::HandleResourceChangeL(aType);
  1198     CEikServAppUiBase::HandleResourceChangeL(aType);
  1166     if ( aType == KEikDynamicLayoutVariantSwitch || aType == KAknsMessageSkinChange )
  1199     if ( aType == KEikDynamicLayoutVariantSwitch )
  1167         {
  1200         {
  1168         UpdateCursorsL();
  1201         UpdateCursorsL();
  1169         }
  1202         }
  1170     }
  1203     }
  1171 
  1204 
  1431             }
  1464             }
  1432         else
  1465         else
  1433             {
  1466             {
  1434             spriteMember.iBitmap = AknIconUtils::CreateIconL( *bmpFile, bmpId );
  1467             spriteMember.iBitmap = AknIconUtils::CreateIconL( *bmpFile, bmpId );
  1435             CleanupStack::PushL( spriteMember.iBitmap );
  1468             CleanupStack::PushL( spriteMember.iBitmap );
  1436             
       
  1437             // set color for the cursor
       
  1438             MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
  1439             if ( skin )
       
  1440                 {
       
  1441                 TRgb color = KRgbBlack;
       
  1442                 AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG10 );
       
  1443                 AknIconUtils::SetIconColor( spriteMember.iBitmap, color );
       
  1444                 }
       
  1445 
       
  1446             }
  1469             }
  1447          
  1470          
  1448         TAknWindowLineLayout l;
  1471         TAknWindowLineLayout l;
  1449 
  1472 
  1450         switch( id )
  1473         switch( id )