clock2/clockui/adtupdater/src/adtupdaterappui.cpp
branchRCL_3
changeset 78 356f28cd5ca0
parent 66 bd7edf625bdd
child 86 ed599363c2d7
equal deleted inserted replaced
74:97232defd20e 78:356f28cd5ca0
    26 
    26 
    27 // Constants
    27 // Constants
    28 const TInt KOrdinalPosition( 0 );
    28 const TInt KOrdinalPosition( 0 );
    29 const TInt KOrdinalPriority( 0 );
    29 const TInt KOrdinalPriority( 0 );
    30 
    30 
       
    31 // Uid of phoneapp
       
    32 const TUid KPhoneUid  = {0x100058B3};
       
    33 
       
    34 
    31 // Literals
    35 // Literals
    32 
    36 
    33 // ---------------------------------------------------------
    37 // ---------------------------------------------------------
    34 // CAdtUpdaterAppUi::CAdtUpdaterAppUi
    38 // CAdtUpdaterAppUi::CAdtUpdaterAppUi
    35 // rest of the details are commented in the header
    39 // rest of the details are commented in the header
    74 	
    78 	
    75 	//Single click integration
    79 	//Single click integration
    76     BaseConstructL( EStandardApp | EAknEnableSkin | EAknEnableMSK |
    80     BaseConstructL( EStandardApp | EAknEnableSkin | EAknEnableMSK |
    77             EAknSingleClickCompatible );
    81             EAknSingleClickCompatible );
    78 
    82 
    79 	
    83     iAdtWgId = iCoeEnv->RootWin().Identifier();
       
    84 
    80 	// Sets the priority for window group
    85 	// Sets the priority for window group
    81 	CEikonEnv &eikEnv = *CEikonEnv::Static();	
    86 	CEikonEnv &eikEnv = *CEikonEnv::Static();	
    82 	eikEnv.RootWin().SetOrdinalPosition( KOrdinalPosition, KOrdinalPriority );
    87 	eikEnv.RootWin().SetOrdinalPosition( KOrdinalPosition, KOrdinalPriority );
    83 	
    88 	
    84     // Disable priority changes of window server.
    89     // Disable priority changes of window server.
   143 	
   148 	
   144 	__PRINTS( "CAdtUpdaterAppUi::HandleForegroundEventL - Exit" );
   149 	__PRINTS( "CAdtUpdaterAppUi::HandleForegroundEventL - Exit" );
   145 	}
   150 	}
   146 
   151 
   147 // ---------------------------------------------------------
   152 // ---------------------------------------------------------
       
   153 // CAdtUpdaterAppUi::IsAppInBackground
       
   154 // rest of the details are commented in the header
       
   155 // ---------------------------------------------------------
       
   156 //
       
   157 TBool CAdtUpdaterAppUi::IsAppInBackground()
       
   158     {
       
   159 	__PRINTS( "CAdtUpdaterAppUi::IsAppInBackground - Entry" );
       
   160     // Gets the window group id of the app coming in foreground
       
   161     TInt activeWgId = iCoeEnv->WsSession().GetFocusWindowGroup();
       
   162     __PRINTS( "CAdtUpdaterAppUi::IsAppInBackground - Exit" );
       
   163     if(activeWgId != iAdtWgId)
       
   164         {
       
   165         return ETrue;
       
   166         }
       
   167     return EFalse;
       
   168     }
       
   169 
       
   170 // ---------------------------------------------------------
       
   171 // CAdtUpdaterAppUi::IsHighPriorityWindowActive
       
   172 // rest of the details are commented in the header
       
   173 // ---------------------------------------------------------
       
   174 //
       
   175 TBool CAdtUpdaterAppUi::IsHighPriorityWindowActive()
       
   176     {
       
   177     __PRINTS( "CCAdtUpdaterAppUi::IsHighPriorityWindowActive - Entry" );
       
   178     // Gets the window group id of the app coming in foreground
       
   179     TInt activeWgId = iCoeEnv->WsSession().GetFocusWindowGroup();
       
   180     TApaTaskList taskList(iCoeEnv->WsSession());
       
   181     
       
   182     //In future, if any other high priority window will be there, then 
       
   183     //add that particular UID in the below check.
       
   184     //Note: Key Lock and alarm are not handled here as these windows already 
       
   185     //have high priority than CDT. In callui window group, the window - when
       
   186     //call is answered, has a low priority, that's why callui is handled here.
       
   187     __PRINTS( "CCAdtUpdaterAppUi::IsHighPriorityWindowActive - Exit" );
       
   188     if(activeWgId == taskList.FindApp(KPhoneUid).WgId())
       
   189         {
       
   190         return ETrue;
       
   191         }
       
   192     return EFalse;
       
   193     }
       
   194 // ---------------------------------------------------------
   148 // CAdtUpdaterAppUi::ToggleAppViewL
   195 // CAdtUpdaterAppUi::ToggleAppViewL
   149 // rest of the details are commented in the header
   196 // rest of the details are commented in the header
   150 // ---------------------------------------------------------
   197 // ---------------------------------------------------------
   151 //
   198 //
   152 void CAdtUpdaterAppUi::ToggleAppViewL( TBool aForeground )
   199 void CAdtUpdaterAppUi::ToggleAppViewL( TBool aForeground )