phoneapp/phoneuistates/src/cphoneerrormessageshandler.cpp
changeset 77 2be0b271d017
parent 72 c76a0b1755b9
equal deleted inserted replaced
72:c76a0b1755b9 77:2be0b271d017
    17 
    17 
    18 
    18 
    19 // INCLUDES
    19 // INCLUDES
    20 #include <mpeengineinfo.h>
    20 #include <mpeengineinfo.h>
    21 #include <telephonydomainpskeys.h>
    21 #include <telephonydomainpskeys.h>
    22 #include <UikonInternalPSKeys.h>
       
    23 #include <ccpdefs.h>
    22 #include <ccpdefs.h>
    24 
    23 
    25 #include "phoneui.pan"
    24 #include "phoneui.pan"
    26 #include "phonerssbase.h"
    25 #include "phonerssbase.h"
    27 #include "cphoneerrormessageshandler.h"
    26 #include "cphoneerrormessageshandler.h"
   109         TInt aResourceId, TBool aNotificationDialog )
   108         TInt aResourceId, TBool aNotificationDialog )
   110     {
   109     {
   111     __LOGMETHODSTARTEND( EPhoneControl, 
   110     __LOGMETHODSTARTEND( EPhoneControl, 
   112         "CPhoneErrorMessagesHandler::SendGlobalInfoNoteL()" );
   111         "CPhoneErrorMessagesHandler::SendGlobalInfoNoteL()" );
   113     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   112     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   114     if ( CPhonePubSubProxy::Instance()->Value( 
   113     
   115             KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
   114     TPhoneCmdParamBoolean globalNotifierParam;
       
   115     globalNotifierParam.SetBoolean( EFalse );
       
   116     iViewCommandHandle->ExecuteCommandL( 
       
   117             EPhoneViewSetGlobalNotifiersDisabled,    
       
   118             &globalNotifierParam );
       
   119         
       
   120     TPhoneCmdParamGlobalNote globalNoteParam;
       
   121     PhoneNotificationType type = aNotificationDialog ? 
       
   122             EPhoneNotificationDialog : EPhoneMessageBoxInformation;
       
   123     globalNoteParam.SetType( type );
       
   124     globalNoteParam.SetNotificationDialog( aNotificationDialog );
       
   125 
       
   126     TInt resourceID( aResourceId );
       
   127     TInt causeCode( KErrNotFound );
       
   128     TBool notification( ETrue );
       
   129     if ( iCauseCodeVariation && GetCauseCode( causeCode, resourceID, notification ) )
   116         {
   130         {
   117         TPhoneCmdParamBoolean globalNotifierParam;
   131         globalNoteParam.SetNotificationDialog( notification );
   118         globalNotifierParam.SetBoolean( EFalse );
   132         globalNoteParam.SetCauseCode(causeCode);
   119         iViewCommandHandle->ExecuteCommandL( 
   133         globalNoteParam.SetTextResourceId( 
   120                 EPhoneViewSetGlobalNotifiersDisabled,    
   134             CPhoneMainResourceResolver::Instance()->
   121                 &globalNotifierParam );
   135             ResolveResourceID( resourceID ) );
   122             
       
   123         TPhoneCmdParamGlobalNote globalNoteParam;
       
   124         PhoneNotificationType type = aNotificationDialog ? 
       
   125                 EPhoneNotificationDialog : EPhoneMessageBoxInformation;
       
   126         globalNoteParam.SetType( type );
       
   127         globalNoteParam.SetNotificationDialog( aNotificationDialog );
       
   128 
       
   129         TInt resourceID( aResourceId );
       
   130         TInt causeCode( KErrNotFound );
       
   131         TBool notification( ETrue );
       
   132         if ( iCauseCodeVariation && GetCauseCode( causeCode, resourceID, notification ) )
       
   133             {
       
   134             globalNoteParam.SetNotificationDialog( notification );
       
   135             globalNoteParam.SetCauseCode(causeCode);
       
   136             globalNoteParam.SetTextResourceId( 
       
   137                 CPhoneMainResourceResolver::Instance()->
       
   138                 ResolveResourceID( resourceID ) );
       
   139             }
       
   140         else
       
   141             {
       
   142             globalNoteParam.SetTextResourceId( 
       
   143                 CPhoneMainResourceResolver::Instance()->
       
   144                 ResolveResourceID( aResourceId ) );
       
   145             }
       
   146         iViewCommandHandle->ExecuteCommandL( 
       
   147             EPhoneViewShowGlobalNote, &globalNoteParam );
       
   148         }
   136         }
       
   137     else
       
   138         {
       
   139         globalNoteParam.SetTextResourceId( 
       
   140             CPhoneMainResourceResolver::Instance()->
       
   141             ResolveResourceID( aResourceId ) );
       
   142         }
       
   143     iViewCommandHandle->ExecuteCommandL( 
       
   144         EPhoneViewShowGlobalNote, &globalNoteParam );
       
   145    
   149     }
   146     }
   150  
   147  
   151 // ---------------------------------------------------------
   148 // ---------------------------------------------------------
   152 //  CPhoneErrorMessagesHandler::SendGlobalErrorNoteL
   149 //  CPhoneErrorMessagesHandler::SendGlobalErrorNoteL
   153 // ---------------------------------------------------------
   150 // ---------------------------------------------------------
   156         TInt aResourceId, TBool aNotificationDialog )
   153         TInt aResourceId, TBool aNotificationDialog )
   157     {
   154     {
   158     __LOGMETHODSTARTEND( EPhoneControl, 
   155     __LOGMETHODSTARTEND( EPhoneControl, 
   159         "CPhoneErrorMessagesHandler::SendGlobalErrorNoteL()" );
   156         "CPhoneErrorMessagesHandler::SendGlobalErrorNoteL()" );
   160     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   157     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   161     if ( CPhonePubSubProxy::Instance()->Value( 
   158     TPhoneCmdParamBoolean globalNotifierParam;
   162             KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
   159     globalNotifierParam.SetBoolean( EFalse );
       
   160     iViewCommandHandle->ExecuteCommandL( 
       
   161          EPhoneViewSetGlobalNotifiersDisabled,
       
   162         &globalNotifierParam );
       
   163         
       
   164     TPhoneCmdParamGlobalNote globalNoteParam;
       
   165     PhoneNotificationType type = aNotificationDialog ? 
       
   166             EPhoneNotificationDialog : EPhoneMessageBoxInformation;
       
   167     globalNoteParam.SetType( type );
       
   168     globalNoteParam.SetNotificationDialog( aNotificationDialog );
       
   169     
       
   170     TInt resourceID( aResourceId );
       
   171     TInt causeCode( KErrNotFound );
       
   172     TBool notification( ETrue );
       
   173     if ( iCauseCodeVariation && GetCauseCode( causeCode, resourceID, notification ) )
   163         {
   174         {
   164         TPhoneCmdParamBoolean globalNotifierParam;
   175         globalNoteParam.SetNotificationDialog( notification );
   165         globalNotifierParam.SetBoolean( EFalse );
   176         globalNoteParam.SetCauseCode(causeCode);
   166         iViewCommandHandle->ExecuteCommandL( 
   177         globalNoteParam.SetTextResourceId( 
   167              EPhoneViewSetGlobalNotifiersDisabled,
   178             CPhoneMainResourceResolver::Instance()->
   168             &globalNotifierParam );
   179             ResolveResourceID( resourceID ) );
   169             
       
   170         TPhoneCmdParamGlobalNote globalNoteParam;
       
   171         PhoneNotificationType type = aNotificationDialog ? 
       
   172                 EPhoneNotificationDialog : EPhoneMessageBoxInformation;
       
   173         globalNoteParam.SetType( type );
       
   174         globalNoteParam.SetNotificationDialog( aNotificationDialog );
       
   175         
       
   176         TInt resourceID( aResourceId );
       
   177         TInt causeCode( KErrNotFound );
       
   178         TBool notification( ETrue );
       
   179         if ( iCauseCodeVariation && GetCauseCode( causeCode, resourceID, notification ) )
       
   180             {
       
   181             globalNoteParam.SetNotificationDialog( notification );
       
   182             globalNoteParam.SetCauseCode(causeCode);
       
   183             globalNoteParam.SetTextResourceId( 
       
   184                 CPhoneMainResourceResolver::Instance()->
       
   185                 ResolveResourceID( resourceID ) );
       
   186             }
       
   187         else
       
   188             {
       
   189             globalNoteParam.SetTextResourceId( 
       
   190                 CPhoneMainResourceResolver::Instance()->
       
   191                 ResolveResourceID( aResourceId ) );
       
   192             }
       
   193         iViewCommandHandle->ExecuteCommandL(  
       
   194             EPhoneViewShowGlobalNote, &globalNoteParam );
       
   195         }
   180         }
       
   181     else
       
   182         {
       
   183         globalNoteParam.SetTextResourceId( 
       
   184             CPhoneMainResourceResolver::Instance()->
       
   185             ResolveResourceID( aResourceId ) );
       
   186         }
       
   187     iViewCommandHandle->ExecuteCommandL(  
       
   188         EPhoneViewShowGlobalNote, &globalNoteParam );
       
   189     
   196     }
   190     }
   197 
   191 
   198 // ---------------------------------------------------------
   192 // ---------------------------------------------------------
   199 //  CPhoneErrorMessagesHandler::SendGlobalWarningNoteL
   193 //  CPhoneErrorMessagesHandler::SendGlobalWarningNoteL
   200 // ---------------------------------------------------------
   194 // ---------------------------------------------------------
   202 EXPORT_C void CPhoneErrorMessagesHandler::SendGlobalWarningNoteL( 
   196 EXPORT_C void CPhoneErrorMessagesHandler::SendGlobalWarningNoteL( 
   203         TInt aResourceId, TBool aNotificationDialog )
   197         TInt aResourceId, TBool aNotificationDialog )
   204     {
   198     {
   205     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneErrorMessagesHandler::SendGlobalWarningNoteL( ) ");
   199     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneErrorMessagesHandler::SendGlobalWarningNoteL( ) ");
   206     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   200     __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
   207     if ( CPhonePubSubProxy::Instance()->Value( 
   201    
   208             KPSUidUikon, KUikGlobalNotesAllowed ) == 1 || 
   202     TPhoneCmdParamBoolean globalNotifierParam;
   209             SimState() == EPESimReadable )
   203     globalNotifierParam.SetBoolean( EFalse );
       
   204     iViewCommandHandle->ExecuteCommandL(  
       
   205         EPhoneViewSetGlobalNotifiersDisabled,
       
   206         &globalNotifierParam );
       
   207         
       
   208     TPhoneCmdParamGlobalNote globalNoteParam;
       
   209     PhoneNotificationType type = aNotificationDialog ? 
       
   210             EPhoneNotificationDialog : EPhoneMessageBoxInformation;
       
   211     globalNoteParam.SetType( type );
       
   212     globalNoteParam.SetNotificationDialog( aNotificationDialog );
       
   213 
       
   214     TInt resourceID( aResourceId );
       
   215     TInt causeCode( KErrNotFound );
       
   216     TBool notification( ETrue );
       
   217     if ( iCauseCodeVariation && GetCauseCode( causeCode, resourceID, notification) )
   210         {
   218         {
   211         TPhoneCmdParamBoolean globalNotifierParam;
   219         globalNoteParam.SetNotificationDialog( notification );
   212         globalNotifierParam.SetBoolean( EFalse );
   220         globalNoteParam.SetCauseCode(causeCode);
   213         iViewCommandHandle->ExecuteCommandL(  
   221         globalNoteParam.SetTextResourceId( 
   214             EPhoneViewSetGlobalNotifiersDisabled,
   222             CPhoneMainResourceResolver::Instance()->
   215             &globalNotifierParam );
   223             ResolveResourceID( resourceID ) );
   216             
       
   217         TPhoneCmdParamGlobalNote globalNoteParam;
       
   218         PhoneNotificationType type = aNotificationDialog ? 
       
   219                 EPhoneNotificationDialog : EPhoneMessageBoxInformation;
       
   220         globalNoteParam.SetType( type );
       
   221         globalNoteParam.SetNotificationDialog( aNotificationDialog );
       
   222 
       
   223         TInt resourceID( aResourceId );
       
   224         TInt causeCode( KErrNotFound );
       
   225         TBool notification( ETrue );
       
   226         if ( iCauseCodeVariation && GetCauseCode( causeCode, resourceID, notification) )
       
   227             {
       
   228             globalNoteParam.SetNotificationDialog( notification );
       
   229             globalNoteParam.SetCauseCode(causeCode);
       
   230             globalNoteParam.SetTextResourceId( 
       
   231                 CPhoneMainResourceResolver::Instance()->
       
   232                 ResolveResourceID( resourceID ) );
       
   233             }
       
   234         else
       
   235             {
       
   236             globalNoteParam.SetTextResourceId( 
       
   237                 CPhoneMainResourceResolver::Instance()->
       
   238                 ResolveResourceID( aResourceId ) );
       
   239             }
       
   240         iViewCommandHandle->ExecuteCommandL( 
       
   241             EPhoneViewShowGlobalNote, &globalNoteParam );
       
   242         }
   224         }
       
   225     else
       
   226         {
       
   227         globalNoteParam.SetTextResourceId( 
       
   228             CPhoneMainResourceResolver::Instance()->
       
   229             ResolveResourceID( aResourceId ) );
       
   230         }
       
   231     iViewCommandHandle->ExecuteCommandL( 
       
   232         EPhoneViewShowGlobalNote, &globalNoteParam );
   243     }
   233     }
   244 
   234 
   245 // ---------------------------------------------------------
   235 // ---------------------------------------------------------
   246 // CPhoneErrorMessagesHandler::SimState()
   236 // CPhoneErrorMessagesHandler::SimState()
   247 // ---------------------------------------------------------
   237 // ---------------------------------------------------------