uifw/AvKon/src/AknPhoneNumberEditor.cpp
branchRCL_3
changeset 51 fcdfafb36fe7
parent 4 8ca85d2f0db7
child 55 aecbbf00d063
equal deleted inserted replaced
50:a1caeb42b3a3 51:fcdfafb36fe7
   373         {
   373         {
   374         iExtension->iCcpuSupport->HandleSelectionChangeL();
   374         iExtension->iCcpuSupport->HandleSelectionChangeL();
   375         }
   375         }
   376     if ( cousorChanged )
   376     if ( cousorChanged )
   377     	{
   377     	{
   378         ReportAknEdStateEventL( MAknEdStateObserver::EAknCursorPositionChanged );
   378         ReportAknEdStateEvent( MAknEdStateObserver::EAknCursorPositionChanged );
   379     	}
   379     	}
   380     // see if we want to remember the old cursor X position
   380     // see if we want to remember the old cursor X position
   381     if ( targetPosUsed )
   381     if ( targetPosUsed )
   382         {
   382         {
   383         if ( iTargetCursorPos == CAknPhedView::KNoPos )
   383         if ( iTargetCursorPos == CAknPhedView::KNoPos )
   419         {
   419         {
   420         TRAP_IGNORE( iExtension->iCcpuSupport->HandleFocusChangeL() );        
   420         TRAP_IGNORE( iExtension->iCcpuSupport->HandleFocusChangeL() );        
   421         }    
   421         }    
   422     if ( ! IsFocused() )
   422     if ( ! IsFocused() )
   423         {
   423         {
   424         TRAP_IGNORE( ReportAknEdStateEventL( MAknEdStateObserver::EAknSyncEdwinState ) );
   424         ReportAknEdStateEvent( MAknEdStateObserver::EAknSyncEdwinState );
   425         }
   425         }
   426     if ( aDrawNow )
   426     if ( aDrawNow )
   427         DrawNow();
   427         DrawNow();
   428     }
   428     }
   429 
   429 
   498 
   498 
   499 EXPORT_C void CAknPhoneNumberEditor::SetSelectionL( TInt aCursorPos,TInt aAnchorPos )
   499 EXPORT_C void CAknPhoneNumberEditor::SetSelectionL( TInt aCursorPos,TInt aAnchorPos )
   500     {
   500     {
   501     iModel->SetRealCursorPosition(aCursorPos);
   501     iModel->SetRealCursorPosition(aCursorPos);
   502     iModel->SetAnchorPosition( aAnchorPos );
   502     iModel->SetAnchorPosition( aAnchorPos );
   503     ReportAknEdStateEventL( 
   503     ReportAknEdStateEvent( 
   504             MAknEdStateObserver::EAknCursorPositionChanged );
   504             MAknEdStateObserver::EAknCursorPositionChanged );
   505     }
   505     }
   506 
   506 
   507 EXPORT_C void CAknPhoneNumberEditor::SetCursorPosL( TInt aCursorPos,TBool aSelect )
   507 EXPORT_C void CAknPhoneNumberEditor::SetCursorPosL( TInt aCursorPos,TBool aSelect )
   508     {
   508     {
   509     TInt anchor = iModel->AnchorPosition();
   509     TInt anchor = iModel->AnchorPosition();
   510     iModel->SetRealCursorPosition( aCursorPos );
   510     iModel->SetRealCursorPosition( aCursorPos );
   511     if ( aSelect )
   511     if ( aSelect )
   512         iModel->SetAnchorPosition( anchor );
   512         iModel->SetAnchorPosition( anchor );
   513     ReportAknEdStateEventL( 
   513     ReportAknEdStateEvent( 
   514         MAknEdStateObserver::EAknCursorPositionChanged );
   514         MAknEdStateObserver::EAknCursorPositionChanged );
   515     }
   515     }
   516 
   516 
   517 EXPORT_C void CAknPhoneNumberEditor::SelectAllL()
   517 EXPORT_C void CAknPhoneNumberEditor::SelectAllL()
   518     {
   518     {
   642 void CAknPhoneNumberEditor::SetCursorSelectionForFepL( const TCursorSelection& aCursorSelection )
   642 void CAknPhoneNumberEditor::SetCursorSelectionForFepL( const TCursorSelection& aCursorSelection )
   643     {
   643     {
   644     iModel->SetRealCursorPosition( iModel->Uncompensate( aCursorSelection.iCursorPos ) );
   644     iModel->SetRealCursorPosition( iModel->Uncompensate( aCursorSelection.iCursorPos ) );
   645     iModel->SetAnchorPosition( iModel->Uncompensate( aCursorSelection.iAnchorPos  ) );
   645     iModel->SetAnchorPosition( iModel->Uncompensate( aCursorSelection.iAnchorPos  ) );
   646     
   646     
   647     ReportAknEdStateEventL( 
   647     ReportAknEdStateEvent( 
   648             MAknEdStateObserver::EAknCursorPositionChanged );
   648             MAknEdStateObserver::EAknCursorPositionChanged );
   649     DrawNow();
   649     DrawNow();
   650     }
   650     }
   651 
   651 
   652 void CAknPhoneNumberEditor::GetCursorSelectionForFep( TCursorSelection& aCursorSelection ) const
   652 void CAknPhoneNumberEditor::GetCursorSelectionForFep( TCursorSelection& aCursorSelection ) const
  1124 // CAknPhoneNumberEditor::CcpuPasteL
  1124 // CAknPhoneNumberEditor::CcpuPasteL
  1125 // --------------------------------------------------------------------------
  1125 // --------------------------------------------------------------------------
  1126 //
  1126 //
  1127 EXPORT_C void CAknPhoneNumberEditor::CcpuPasteL()
  1127 EXPORT_C void CAknPhoneNumberEditor::CcpuPasteL()
  1128     {
  1128     {
       
  1129     // When we paste the buffer to phone number editor, we must get the buffer from clipboard first 
       
  1130     // and then insert buffer to phone number editor. As the main job of CcpuCanPaste() is getting and 
       
  1131     // checking the buffer in clipboard, so we must call CcpuCanPaste() first.
       
  1132     // If iExtension->iPasteText is not NULL, it means CcpuCanPaste() has been called before and the 
       
  1133     // buffer in clipboard is valid. No need to call it once again. 
       
  1134     if ( !iExtension->iPasteText )
       
  1135         {
       
  1136         // If the return value of CcpuCanPaste is EFalse, iExtension->iPasteText must be NULL,
       
  1137         // else if the return value of CcpuCanPaste is ETure, iExtension->iPasteText must not be NULL.
       
  1138         // So we don't need to check if the return value is ETure or EFalse, 
       
  1139         // we will check iExtension->iPasteText instead of that.
       
  1140         CcpuCanPaste();
       
  1141         }
  1129     if ( iExtension->iPasteText )
  1142     if ( iExtension->iPasteText )
  1130         {
  1143         {
  1131         iModel->Paste( iExtension->iPasteText->Des() );
  1144         iModel->Paste( iExtension->iPasteText->Des() );
  1132         DrawNow();
  1145         DrawNow();
  1133         }
  1146         }
  1251 EXPORT_C void CAknPhoneNumberEditor::OpenVKB( )
  1264 EXPORT_C void CAknPhoneNumberEditor::OpenVKB( )
  1252     {
  1265     {
  1253     TUint cap = iExtension->iExtendedInputCapabilities->Capabilities();
  1266     TUint cap = iExtension->iExtendedInputCapabilities->Capabilities();
  1254     cap &= ~CAknExtendedInputCapabilities::EInputEditorDisableVKB;
  1267     cap &= ~CAknExtendedInputCapabilities::EInputEditorDisableVKB;
  1255     iExtension->iExtendedInputCapabilities->SetCapabilities( cap );
  1268     iExtension->iExtendedInputCapabilities->SetCapabilities( cap );
  1256     TRAP_IGNORE( ReportAknEdStateEventL( 
  1269     ReportAknEdStateEvent( 
  1257     		     MAknEdStateObserver::EAknActivatePenInputRequest ) );
  1270     		     MAknEdStateObserver::EAknActivatePenInputRequest );
  1258     }
  1271     }
  1259 
  1272 
  1260 // --------------------------------------------------------------------------
  1273 // --------------------------------------------------------------------------
  1261 // CAknPhoneNumberEditor::CloseVKB
  1274 // CAknPhoneNumberEditor::CloseVKB
  1262 // --------------------------------------------------------------------------
  1275 // --------------------------------------------------------------------------
  1264 void CAknPhoneNumberEditor::CloseVKB( )
  1277 void CAknPhoneNumberEditor::CloseVKB( )
  1265     {
  1278     {
  1266     TUint cap = iExtension->iExtendedInputCapabilities->Capabilities();
  1279     TUint cap = iExtension->iExtendedInputCapabilities->Capabilities();
  1267     cap |= CAknExtendedInputCapabilities::EInputEditorDisableVKB;
  1280     cap |= CAknExtendedInputCapabilities::EInputEditorDisableVKB;
  1268     iExtension->iExtendedInputCapabilities->SetCapabilities( cap );
  1281     iExtension->iExtendedInputCapabilities->SetCapabilities( cap );
  1269     ReportAknEdStateEventL( MAknEdStateObserver::EAknClosePenInputRequest );
  1282     ReportAknEdStateEvent( MAknEdStateObserver::EAknClosePenInputRequest );
  1270     }
  1283     }
  1271 
  1284 
  1272 // --------------------------------------------------------------------------
  1285 // --------------------------------------------------------------------------
  1273 // CAknPhoneNumberEditor::ReportAknEdStateEventL
  1286 // CAknPhoneNumberEditor::ReportAknEdStateEventL
  1274 // --------------------------------------------------------------------------
  1287 // --------------------------------------------------------------------------
  1275 //
  1288 //
  1276 void CAknPhoneNumberEditor::ReportAknEdStateEventL( 
  1289 void CAknPhoneNumberEditor::ReportAknEdStateEvent( 
  1277          MAknEdStateObserver::EAknEdwinStateEvent aStateEvent )
  1290          MAknEdStateObserver::EAknEdwinStateEvent aStateEvent )
  1278     {
  1291     {
  1279     CAknEdwinState* edwinState = STATIC_CAST( CAknEdwinState*,State(KNullUid) );
  1292     CAknEdwinState* edwinState = STATIC_CAST( CAknEdwinState*,State(KNullUid) );
  1280     if ( edwinState )
  1293     if ( edwinState )
  1281         {                   
  1294         {