--- a/uifw/AvKon/src/AknPhoneNumberEditor.cpp Tue Aug 31 15:28:30 2010 +0300
+++ b/uifw/AvKon/src/AknPhoneNumberEditor.cpp Wed Sep 01 12:16:19 2010 +0100
@@ -375,7 +375,7 @@
}
if ( cousorChanged )
{
- ReportAknEdStateEventL( MAknEdStateObserver::EAknCursorPositionChanged );
+ ReportAknEdStateEvent( MAknEdStateObserver::EAknCursorPositionChanged );
}
// see if we want to remember the old cursor X position
if ( targetPosUsed )
@@ -421,7 +421,7 @@
}
if ( ! IsFocused() )
{
- TRAP_IGNORE( ReportAknEdStateEventL( MAknEdStateObserver::EAknSyncEdwinState ) );
+ ReportAknEdStateEvent( MAknEdStateObserver::EAknSyncEdwinState );
}
if ( aDrawNow )
DrawNow();
@@ -500,7 +500,7 @@
{
iModel->SetRealCursorPosition(aCursorPos);
iModel->SetAnchorPosition( aAnchorPos );
- ReportAknEdStateEventL(
+ ReportAknEdStateEvent(
MAknEdStateObserver::EAknCursorPositionChanged );
}
@@ -510,7 +510,7 @@
iModel->SetRealCursorPosition( aCursorPos );
if ( aSelect )
iModel->SetAnchorPosition( anchor );
- ReportAknEdStateEventL(
+ ReportAknEdStateEvent(
MAknEdStateObserver::EAknCursorPositionChanged );
}
@@ -644,7 +644,7 @@
iModel->SetRealCursorPosition( iModel->Uncompensate( aCursorSelection.iCursorPos ) );
iModel->SetAnchorPosition( iModel->Uncompensate( aCursorSelection.iAnchorPos ) );
- ReportAknEdStateEventL(
+ ReportAknEdStateEvent(
MAknEdStateObserver::EAknCursorPositionChanged );
DrawNow();
}
@@ -908,7 +908,7 @@
if ( feedback )
{
- feedback->InstantFeedback( this, ETouchFeedbackEditor );
+ feedback->InstantFeedback( this, ETouchFeedbackEdit );
}
}
//cancel previous selection
@@ -1081,7 +1081,9 @@
// check if the characters are allowed, if one character is not allowed,
// it will not be pasted into phone number editor
- if ( fepState->CurrentInputMode() != EAknEditorTextInputMode )
+ CAknExtendedInputCapabilities * pCapabilities(iExtension->iExtendedInputCapabilities);
+ if ( fepState->CurrentInputMode() != EAknEditorTextInputMode && pCapabilities
+ && pCapabilities->EditorType() != CAknExtendedInputCapabilities::EHybridAlphaNumericEditor )
{
TInt pos = 0;
TInt index = 0;
@@ -1124,6 +1126,19 @@
//
EXPORT_C void CAknPhoneNumberEditor::CcpuPasteL()
{
+ // When we paste the buffer to phone number editor, we must get the buffer from clipboard first
+ // and then insert buffer to phone number editor. As the main job of CcpuCanPaste() is getting and
+ // checking the buffer in clipboard, so we must call CcpuCanPaste() first.
+ // If iExtension->iPasteText is not NULL, it means CcpuCanPaste() has been called before and the
+ // buffer in clipboard is valid. No need to call it once again.
+ if ( !iExtension->iPasteText )
+ {
+ // If the return value of CcpuCanPaste is EFalse, iExtension->iPasteText must be NULL,
+ // else if the return value of CcpuCanPaste is ETure, iExtension->iPasteText must not be NULL.
+ // So we don't need to check if the return value is ETure or EFalse,
+ // we will check iExtension->iPasteText instead of that.
+ CcpuCanPaste();
+ }
if ( iExtension->iPasteText )
{
iModel->Paste( iExtension->iPasteText->Des() );
@@ -1251,8 +1266,8 @@
TUint cap = iExtension->iExtendedInputCapabilities->Capabilities();
cap &= ~CAknExtendedInputCapabilities::EInputEditorDisableVKB;
iExtension->iExtendedInputCapabilities->SetCapabilities( cap );
- TRAP_IGNORE( ReportAknEdStateEventL(
- MAknEdStateObserver::EAknActivatePenInputRequest ) );
+ ReportAknEdStateEvent(
+ MAknEdStateObserver::EAknActivatePenInputRequest );
}
// --------------------------------------------------------------------------
@@ -1264,14 +1279,14 @@
TUint cap = iExtension->iExtendedInputCapabilities->Capabilities();
cap |= CAknExtendedInputCapabilities::EInputEditorDisableVKB;
iExtension->iExtendedInputCapabilities->SetCapabilities( cap );
- ReportAknEdStateEventL( MAknEdStateObserver::EAknClosePenInputRequest );
+ ReportAknEdStateEvent( MAknEdStateObserver::EAknClosePenInputRequest );
}
// --------------------------------------------------------------------------
// CAknPhoneNumberEditor::ReportAknEdStateEventL
// --------------------------------------------------------------------------
//
-void CAknPhoneNumberEditor::ReportAknEdStateEventL(
+void CAknPhoneNumberEditor::ReportAknEdStateEvent(
MAknEdStateObserver::EAknEdwinStateEvent aStateEvent )
{
CAknEdwinState* edwinState = STATIC_CAST( CAknEdwinState*,State(KNullUid) );
@@ -1294,5 +1309,17 @@
return edwinState->Flags();
}
+// --------------------------------------------------------------------------
+// CAknPhoneNumberEditor::MakeVisible
+// --------------------------------------------------------------------------
+//
+void CAknPhoneNumberEditor::MakeVisible(TBool aVisible)
+ {
+ CCoeControl::MakeVisible(aVisible);
+ if ( !aVisible )
+ {
+ CloseVKB();
+ }
+ }
// End of file