bluetoothengine/btnotif/src/btnssppasskeyentrynotifier.cpp
branchRCL_3
changeset 6 6a29d5ad0713
parent 0 f63038272f30
child 11 f7fbeaeb166a
equal deleted inserted replaced
2:0b192a3a05a4 6:6a29d5ad0713
    29 #include <btextnotifiers.h>
    29 #include <btextnotifiers.h>
    30 #include <btextnotifierspartner.h>
    30 #include <btextnotifierspartner.h>
    31 #endif
    31 #endif
    32 #include <BTNotif.rsg>       // Own resources
    32 #include <BTNotif.rsg>       // Own resources
    33 #include <SecondaryDisplay/BTnotifSecondaryDisplayAPI.h>
    33 #include <SecondaryDisplay/BTnotifSecondaryDisplayAPI.h>
    34 
    34 #include <bluetoothuiutil.h>
    35 #include "btnotif.hrh"       // Own resource header
    35 #include "btnotif.hrh"       // Own resource header
    36 #include "btnssppasskeyentrynotifier.h"  // Own class definition
    36 #include "btnssppasskeyentrynotifier.h"  // Own class definition
    37 #include "btNotifDebug.h"    // Debugging macros
    37 #include "btNotifDebug.h"    // Debugging macros
    38 #include "btnotifnameutils.h"
    38 #include "btnotifnameutils.h"
    39 
    39 
   182             break;
   182             break;
   183             }
   183             }
   184         }
   184         }
   185     if ( !iNotifUiUtil->IsQueryReleased() )
   185     if ( !iNotifUiUtil->IsQueryReleased() )
   186         {
   186         {
   187         HBufC* update = GenerateQueryPromoptLC();
   187         RBuf prompt;
   188         iNotifUiUtil->UpdateQueryDlgL( *update );
   188         prompt.CleanupClosePushL();
   189         CleanupStack::PopAndDestroy( update ); 
   189         GenerateQueryPromptL( prompt );
       
   190         iNotifUiUtil->UpdateQueryDlgL( prompt );
       
   191         CleanupStack::PopAndDestroy( &prompt ); 
   190         }        
   192         }        
   191     
   193     
   192     FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::UpdateL() completed"));
   194     FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::UpdateL() completed"));
   193     TPtrC8 ret(KNullDesC8);
   195     TPtrC8 ret(KNullDesC8);
   194     return (ret);
   196     return (ret);
   224     TBTDeviceName nameCoverUi( KNullDesC );
   226     TBTDeviceName nameCoverUi( KNullDesC );
   225     
   227     
   226     iBuf.Zero();
   228     iBuf.Zero();
   227     iBuf.Append(iPasskey);
   229     iBuf.Append(iPasskey);
   228     iBuf.Append(_L("    "));
   230     iBuf.Append(_L("    "));
   229     HBufC* prompt = GenerateQueryPromoptLC();
   231     
   230     
   232     RBuf prompt;
   231     TInt answer = iNotifUiUtil->ShowQueryL( *prompt, R_BT_PASSKEY_QUERY, 
   233     prompt.CleanupClosePushL();
       
   234     GenerateQueryPromptL( prompt );
       
   235     
       
   236     TInt answer = iNotifUiUtil->ShowQueryL( prompt, R_BT_PASSKEY_QUERY, 
   232             ECmdBTnotifUnavailable, nameCoverUi );    
   237             ECmdBTnotifUnavailable, nameCoverUi );    
   233     CleanupStack::PopAndDestroy( prompt );  
   238     CleanupStack::PopAndDestroy( &prompt );  
   234 
   239 
   235     if( iAnswer ) // user pressed entry key from remote keyboard.
   240     if( iAnswer ) // user pressed entry key from remote keyboard.
   236         {
   241         {
   237         CompleteMessage(KErrNone);
   242         CompleteMessage(KErrNone);
   238         }
   243         }
   258     
   263     
   259      FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::HandleGetDeviceCompletedL() completed"));
   264      FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::HandleGetDeviceCompletedL() completed"));
   260     }
   265     }
   261 
   266 
   262 // ----------------------------------------------------------
   267 // ----------------------------------------------------------
   263 // CBTSSPPasskeyEntryNotifier::GenerateQueryPromoptLC
   268 // CBTSSPPasskeyEntryNotifier::GenerateQueryPromptL
   264 // ----------------------------------------------------------
   269 // ----------------------------------------------------------
   265 //
   270 //
   266 HBufC* CBTSSPPasskeyEntryNotifier::GenerateQueryPromoptLC()
   271 void CBTSSPPasskeyEntryNotifier::GenerateQueryPromptL(  RBuf& aRBuf )
   267     {
   272     {
   268     FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::GenerateQueryPromoptLC()"));
   273     FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::GenerateQueryPromptL()"));
   269     TBTDeviceName devName; 
   274     TBTDeviceName devName; 
   270     BtNotifNameUtils::GetDeviceDisplayName(devName, iDevice);   
   275     BtNotifNameUtils::GetDeviceDisplayName(devName, iDevice);   
   271     
   276     BluetoothUiUtil::LoadResourceAndSubstringL( 
   272     CPtrCArray* subsPrompt = new (ELeave) CPtrCArray(2);
   277             aRBuf, R_BT_SSP_PASSKEY_ENTRY, devName, 0 );
   273     CleanupStack::PushL( subsPrompt );
   278     BluetoothUiUtil::AddSubstringL( aRBuf, iBuf, 1 );
   274     subsPrompt->AppendL( devName );
   279     FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::GenerateQueryPromptL() << "));
   275     subsPrompt->AppendL( iBuf );
   280 
   276     HBufC* prompt = StringLoader::LoadL( R_BT_SSP_PASSKEY_ENTRY , *subsPrompt );
       
   277     CleanupStack::PopAndDestroy( subsPrompt );
       
   278     CleanupStack::PushL( prompt );
       
   279     FLOG(_L("[BTNOTIF]\t CBTSSPPasskeyEntryNotifier::GenerateQueryPromoptLC() << "));
       
   280     return prompt;
       
   281     }
   281     }
   282 // End of File
   282 // End of File