phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp
changeset 50 377c906a8701
parent 46 bc5a64e5bc3c
child 60 1eef62f5c541
equal deleted inserted replaced
46:bc5a64e5bc3c 50:377c906a8701
    69 
    69 
    70 const TUid KCRUidTelTouchButtons = {0x2001B2E6};
    70 const TUid KCRUidTelTouchButtons = {0x2001B2E6};
    71 const TUint32 KTelIncallTouchButtons   = 0x00000001;
    71 const TUint32 KTelIncallTouchButtons   = 0x00000001;
    72 
    72 
    73 
    73 
       
    74 inline Qt::TextElideMode clipToElide(
       
    75     TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection clip)
       
    76     {
       
    77     return clip == TPhoneCmdParamCallHeaderData::ELeft ? 
       
    78                    Qt::ElideLeft : Qt::ElideRight;
       
    79     }
       
    80 
    74 PhoneUIQtViewAdapter::PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent) :
    81 PhoneUIQtViewAdapter::PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent) :
    75     QObject (parent),
    82     QObject (parent),
    76     m_view (view),
    83     m_view (view),
    77     m_idleUid(-1),
    84     m_idleUid(-1),
    78     m_bubbleWrapper(0),
    85     m_bubbleWrapper(0),
   102     TPhoneCmdParamInteger intParam;
   109     TPhoneCmdParamInteger intParam;
   103     intParam.SetInteger(m_resourceAdapter->defaultToolbarResourceId());
   110     intParam.SetInteger(m_resourceAdapter->defaultToolbarResourceId());
   104     setToolbarButtons(&intParam);
   111     setToolbarButtons(&intParam);
   105 
   112 
   106     m_telephonyService = new TelephonyService (this, this);
   113     m_telephonyService = new TelephonyService (this, this);
   107 	m_indicatorController = new PhoneIndicatorController(this);
       
   108     m_visibilityHandler = new PhoneVisibilityHandler(view, this);
   114     m_visibilityHandler = new PhoneVisibilityHandler(view, this);
       
   115     m_indicatorController = new PhoneIndicatorController(*m_visibilityHandler,this);
   109     m_appLauncher = new PhoneAppLauncher(this);
   116     m_appLauncher = new PhoneAppLauncher(this);
   110     m_messageController = new PhoneMessageController(*m_appLauncher, this);
   117     m_messageController = new PhoneMessageController(*m_appLauncher, this);
   111     
   118     
   112     int touchButton(-1);
   119     int touchButton(-1);
   113     if ( KErrNone == CPhoneCenRepProxy::Instance()->GetInt(
   120     if ( KErrNone == CPhoneCenRepProxy::Instance()->GetInt(
   380 {
   387 {
   381     TPhoneViewResponseId response = EPhoneViewResponseSuccess;
   388     TPhoneViewResponseId response = EPhoneViewResponseSuccess;
   382 
   389 
   383     switch (aCmdId) {
   390     switch (aCmdId) {
   384     case EPhoneIsDTMFDialerVisible:
   391     case EPhoneIsDTMFDialerVisible:
   385     case EPhoneViewIsDTMFEditorVisible: //TODO
       
   386     case EPhoneIsCustomizedDialerVisible:
   392     case EPhoneIsCustomizedDialerVisible:
   387     case EPhoneViewGetNeedToSendToBackgroundStatus:
   393     case EPhoneViewGetNeedToSendToBackgroundStatus:
   388         // TODO: currently not supported
   394         // TODO: currently not supported
   389         response = EPhoneViewResponseFailed;
   395         response = EPhoneViewResponseFailed;
   390         break;
   396         break;
   391     case EPhoneViewIsMenuBarVisible:
       
   392         {
       
   393         //TODO
       
   394         response = EPhoneViewResponseFailed;
       
   395         break;
       
   396         }
       
   397     case EPhoneViewGetNumberEntryIsVisibleStatus:
   397     case EPhoneViewGetNumberEntryIsVisibleStatus:
   398     case EPhoneViewGetNumberEntryIsUsedStatus: // Fall through
   398     case EPhoneViewGetNumberEntryIsUsedStatus: // Fall through
   399         {
   399         {
   400         response = (m_view.isDialpadVisible() && !m_dialpadAboutToClose) ?
   400         response = (m_view.isDialpadVisible() && !m_dialpadAboutToClose) ?
   401                         EPhoneViewResponseSuccess :
   401                         EPhoneViewResponseSuccess :
   457     case EPhoneViewGetAudioVolumeLevel:
   457     case EPhoneViewGetAudioVolumeLevel:
   458         writeAudioVolumeLevel (aCommandParam);
   458         writeAudioVolumeLevel (aCommandParam);
   459         break;
   459         break;
   460     case EPhoneViewGetNumberFromEntry:
   460     case EPhoneViewGetNumberFromEntry:
   461         getNumberFromDialpad(aCommandParam);
   461         getNumberFromDialpad(aCommandParam);
   462         break;
       
   463     case EPhoneViewSetDtmfOptionsFlag:
       
   464         //TODO
       
   465         break;
       
   466     case EPhoneViewSetVideoCallDTMFVisibilityFlag:
       
   467         //TODO
       
   468         break;
   462         break;
   469     case EPhoneViewBackButtonActive: {
   463     case EPhoneViewBackButtonActive: {
   470         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   464         TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
   471         m_view.setBackButtonVisible(param->Boolean());
   465         m_view.setBackButtonVisible(param->Boolean());
   472 		}
   466 		}
   612         {
   606         {
   613         m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(false);
   607         m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(false);
   614         }
   608         }
   615 
   609 
   616     int bubble = m_bubbleWrapper->createCallHeader (callId);
   610     int bubble = m_bubbleWrapper->createCallHeader (callId);
   617     m_bubbleWrapper->setState (callId, bubble, data.CallState ());
   611     m_bubbleWrapper->setState (callId, bubble, data.CallState ());        
   618     m_bubbleWrapper->setCli (bubble, data.CLIText ());
   612     m_bubbleWrapper->setCli (bubble, data.CLIText (), clipToElide(data.CLITextClippingDirection()));
   619     m_bubbleWrapper->setServiceId(callId, data.ServiceId());
   613     m_bubbleWrapper->setServiceId(callId, data.ServiceId());
   620     m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ());
   614     m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText (), clipToElide(data.CNAPTextClippingDirection()));
   621     m_bubbleWrapper->setLabel (bubble, data.LabelText ());
   615     m_bubbleWrapper->setLabel (bubble, data.LabelText ());
   622     m_bubbleWrapper->setCallType (bubble, data.CallType ());
   616     m_bubbleWrapper->setCallType (bubble, data.CallType ());
   623     m_bubbleWrapper->setDivert (bubble, data.Diverted ());
   617     m_bubbleWrapper->setDivert (bubble, data.Diverted ());
   624     m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering());
   618     m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering());
   625 
   619 
   649         static_cast<TPhoneCmdParamEmergencyCallHeaderData &> (*commandParam);
   643         static_cast<TPhoneCmdParamEmergencyCallHeaderData &> (*commandParam);
   650 
   644 
   651     m_bubbleWrapper->bubbleManager ().startChanges ();
   645     m_bubbleWrapper->bubbleManager ().startChanges ();
   652     int bubble = m_bubbleWrapper->createCallHeader (callId);
   646     int bubble = m_bubbleWrapper->createCallHeader (callId);
   653     m_bubbleWrapper->setLabel (bubble, data.LabelText ());
   647     m_bubbleWrapper->setLabel (bubble, data.LabelText ());
   654     m_bubbleWrapper->setCli (bubble, data.HeaderText ());
   648     m_bubbleWrapper->setCli (bubble, data.HeaderText (), Qt::ElideRight);
   655     m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering());
   649     m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering());
   656     m_bubbleWrapper->bubbleManager ().endChanges ();
   650     m_bubbleWrapper->bubbleManager ().endChanges ();
   657     
   651     
   658     m_indicatorController->setActiveCallData();
   652     m_indicatorController->setActiveCallData();
   659 }
   653 }
   688 
   682 
   689 
   683 
   690      int bubble = m_bubbleWrapper->bubbleId (callId);
   684      int bubble = m_bubbleWrapper->bubbleId (callId);
   691      if ( -1 != bubble ) {
   685      if ( -1 != bubble ) {
   692          m_bubbleWrapper->bubbleManager ().startChanges ();
   686          m_bubbleWrapper->bubbleManager ().startChanges ();
   693          m_bubbleWrapper->setCli (bubble, data.CLIText ());
   687          m_bubbleWrapper->setCli (bubble, data.CLIText (),
   694          m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ());
   688              clipToElide(data.CLITextClippingDirection()));
       
   689          m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText (),
       
   690              clipToElide(data.CNAPTextClippingDirection()));
   695          m_bubbleWrapper->setDivert (bubble, data.Diverted ());
   691          m_bubbleWrapper->setDivert (bubble, data.Diverted ());
   696          m_bubbleWrapper->bubbleManager ().endChanges ();
   692          m_bubbleWrapper->bubbleManager ().endChanges ();
   697      }
   693      }
   698      m_indicatorController->setActiveCallData();
   694      m_indicatorController->setActiveCallData();
   699 
   695 
   708          static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam);
   704          static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam);
   709 
   705 
   710      int bubble = m_bubbleWrapper->bubbleId (callId);
   706      int bubble = m_bubbleWrapper->bubbleId (callId);
   711      if ( -1 != bubble ) {
   707      if ( -1 != bubble ) {
   712          m_bubbleWrapper->bubbleManager ().startChanges ();
   708          m_bubbleWrapper->bubbleManager ().startChanges ();
   713          m_bubbleWrapper->setCli (bubble, data.CLIText ());
   709          m_bubbleWrapper->setCli (bubble, data.CLIText (),
   714          m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ());
   710              clipToElide(data.CLITextClippingDirection()));
       
   711          m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText (),
       
   712              clipToElide(data.CNAPTextClippingDirection()));
   715          m_bubbleWrapper->setLabel (bubble, data.LabelText ());
   713          m_bubbleWrapper->setLabel (bubble, data.LabelText ());
   716          m_bubbleWrapper->setDivert (bubble, data.Diverted ());
   714          m_bubbleWrapper->setDivert (bubble, data.Diverted ());
   717          m_bubbleWrapper->bubbleManager ().endChanges ();
   715          m_bubbleWrapper->bubbleManager ().endChanges ();
   718      }
   716      }
   719 }
   717 }