widgets/widgetapp/src/WidgetUiWindow.cpp
branchRCL_3
changeset 47 e1bea15f9a39
parent 46 30342f40acbf
child 48 79859ed3eea9
equal deleted inserted replaced
46:30342f40acbf 47:e1bea15f9a39
    97 CWidgetUiWindow::CWidgetUiWindow( CWidgetUiWindowManager& aWindowManager, CCpsPublisher* aCpsPublisher )
    97 CWidgetUiWindow::CWidgetUiWindow( CWidgetUiWindowManager& aWindowManager, CCpsPublisher* aCpsPublisher )
    98     : iWindowManager( aWindowManager ), iCpsPublisher( aCpsPublisher ), iNetworkAccessGrant(EInvalid),
    98     : iWindowManager( aWindowManager ), iCpsPublisher( aCpsPublisher ), iNetworkAccessGrant(EInvalid),
    99       iPreferredOrientation(TBrCtlDefs::EOrientationUndefined),
    99       iPreferredOrientation(TBrCtlDefs::EOrientationUndefined),
   100       iIsCurrent(EFalse), iShowSoftkeys(EFalse), iWidgetLoaded(EFalse),
   100       iIsCurrent(EFalse), iShowSoftkeys(EFalse), iWidgetLoaded(EFalse),
   101       iSchemeProcessing (EFalse), iNetworkState(ENetworkNotAllowed), iUserPermission(ETrue), 
   101       iSchemeProcessing (EFalse), iNetworkState(ENetworkNotAllowed), iUserPermission(ETrue), 
   102       iClickCount(0), iWidgetLoadStarted(EFalse)
   102       iClickCount(0), iWidgetLoadStarted(EFalse), iSapiPromptCleared(ETrue),iNeedToIgnoreSapiNtfn(0),
       
   103       iNeedToIgnoreSapiClearNtfn(0)
   103     {
   104     {
   104     }
   105     }
   105 
   106 
   106 // -----------------------------------------------------------------------------
   107 // -----------------------------------------------------------------------------
   107 // CWidgetUiWindow::ConstructL()
   108 // CWidgetUiWindow::ConstructL()
   201     iDlId = 0;
   202     iDlId = 0;
   202 
   203 
   203     iNeedToNotifyNetworkState = EFalse;
   204     iNeedToNotifyNetworkState = EFalse;
   204     // determine initial widget online/offline network state
   205     // determine initial widget online/offline network state
   205     DetermineNetworkState();
   206     DetermineNetworkState();
   206     iAsyncCallBack = new (ELeave) CAsyncCallBack(TCallBack(DeleteItself,this),CActive::EPriorityUserInput);
   207     iAsyncCallBack = new (ELeave) CAsyncCallBack(TCallBack(DeleteItself,this),CActive::EPriorityLow);
   207     }
   208     }
   208 
   209 
   209 // -----------------------------------------------------------------------------
   210 // -----------------------------------------------------------------------------
   210 // CWidgetUiWindow::~CWidgetUiWindow()
   211 // CWidgetUiWindow::~CWidgetUiWindow()
   211 // Destructor
   212 // Destructor
  1301     {
  1302     {
  1302     iDeleteItself = iConnecting;
  1303     iDeleteItself = iConnecting;
  1303     return !iConnecting;
  1304     return !iConnecting;
  1304     }
  1305     }
  1305     
  1306     
       
  1307 
       
  1308 void CWidgetUiWindow::DeleteItself()    
       
  1309 	{	
       
  1310 	iAsyncCallBack->CallBack();    
       
  1311 	}
       
  1312 
  1306 // -----------------------------------------------------------------------------
  1313 // -----------------------------------------------------------------------------
  1307 // CWidgetUiWindow::DeleteItself()
  1314 // CWidgetUiWindow::DeleteItself()
  1308 // -----------------------------------------------------------------------------
  1315 // -----------------------------------------------------------------------------
  1309 //
  1316 //
  1310 TInt CWidgetUiWindow::DeleteItself(TAny* aPtr)
  1317 TInt CWidgetUiWindow::DeleteItself(TAny* aPtr)
  1311     {
  1318     {
  1312     CWidgetUiWindow* self = (CWidgetUiWindow*)aPtr;
  1319     CWidgetUiWindow* self = (CWidgetUiWindow*)aPtr;
  1313     CWidgetUiWindowManager* p = &self->iWindowManager;
  1320     CWidgetUiWindowManager* p = &self->iWindowManager;
       
  1321     //if sync request start another event loop
       
  1322     if(self->Engine()->IsSynchRequestPending())
       
  1323     	{
       
  1324     	self->DeleteItself();
       
  1325     	return KErrNone;
       
  1326     	}
  1314     delete self;
  1327     delete self;
  1315     //The Correct fix is to call AppUI::Exit()
  1328     //The Correct fix is to call AppUI::Exit()
  1316     //But that is leaving
  1329     //But that is leaving
  1317     if(p->WindowListCount() == 0)
  1330     if(p->WindowListCount() == 0)
  1318         User::Exit(KErrNone);
  1331         User::Exit(KErrNone);