homescreenapp/hsapplication/src/hsstatemachine.cpp
changeset 92 6727c5d0afc7
parent 85 35368b604b28
child 96 458d8c8d9580
equal deleted inserted replaced
85:35368b604b28 92:6727c5d0afc7
   274     if (!mPublisher->isConnected()){
   274     if (!mPublisher->isConnected()){
   275     	// No permanent layer available
   275     	// No permanent layer available
   276     	mPublisher = new QValueSpacePublisher(HsStatePSKeyPath);
   276     	mPublisher = new QValueSpacePublisher(HsStatePSKeyPath);
   277     }
   277     }
   278 
   278 
   279     mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenInactive);
   279     // initialize state to invalid, actual status updates after state creation
       
   280     mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenInvalid);
   280 }
   281 }
   281 
   282 
   282 /*!
   283 /*!
   283     Creates content service parts.
   284     Creates content service parts.
   284 */
   285 */
   434 {	
   435 {	
   435 	if (!mPublisher){
   436 	if (!mPublisher){
   436 		createStatePublisher();
   437 		createStatePublisher();
   437 	}
   438 	}
   438 
   439 
   439 	if (mHomeScreenActive && mIdleStateActive){
   440     if (mHomeScreenActive && mIdleStateActive) {
   440     	qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenIdleState";
   441     	qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenWidgetViewForeground";
   441     	mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenIdleState);
   442     	mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenWidgetViewForeground);
   442     }
   443         captureEndKey(false);
   443     else{
   444     } else if (mHomeScreenActive && !mIdleStateActive) {
   444     	qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenInactive";
   445     	qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenApplicationLibraryViewForeground";
   445     	mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenInactive);
   446     	mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenApplicationLibraryViewForeground);
   446     }	
       
   447     
       
   448     if (mHomeScreenActive && !mIdleStateActive) {
       
   449         captureEndKey(true);
   447         captureEndKey(true);
       
   448     } else if (!mHomeScreenActive && mIdleStateActive){
       
   449         qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenApplicationBackground | EHomeScreenWidgetViewActive";
       
   450         mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenApplicationBackground | EHomeScreenWidgetViewActive);
       
   451         captureEndKey(false);
   450     } else {
   452     } else {
       
   453         qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenApplicationBackground | EHomeScreenApplicationLibraryViewActive";
       
   454         mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenApplicationBackground | EHomeScreenApplicationLibraryViewActive);
   451         captureEndKey(false);
   455         captureEndKey(false);
   452     }
   456     }
   453     mSendKeyCaptured = false;
   457     mSendKeyCaptured = false;
   454 }
   458 }
   455 
   459 
   464         keyCapture.captureKey(Qt::Key_No);        
   468         keyCapture.captureKey(Qt::Key_No);        
   465     } else if (mEndKeyCaptured) {
   469     } else if (mEndKeyCaptured) {
   466         mEndKeyCaptured = false;
   470         mEndKeyCaptured = false;
   467         keyCapture.cancelCaptureKey(Qt::Key_No);
   471         keyCapture.cancelCaptureKey(Qt::Key_No);
   468     }
   472     }
       
   473 #else
       
   474     Q_UNUSED(enable)
   469 #endif
   475 #endif
   470 }
   476 }
   471 
   477 
   472 /*!
   478 /*!
   473     Called when state machine is in Idle state.
   479     Called when state machine is in Idle state.