--- a/webengine/osswebengine/WebKit/s60/webcoresupport/WebEditorClient.cpp Thu Aug 19 10:58:56 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webcoresupport/WebEditorClient.cpp Tue Aug 31 16:17:46 2010 +0300
@@ -31,9 +31,9 @@
#include "WebView.h"
#include "WebFrame.h"
#include "WebFormFill.h"
-#include "HtmlNames.h"
+#include "HTMLNames.h"
#include "WebFepTextEditor.h"
-#include <eikcoctl.rsg>
+#include <EIKCOCTL.rsg>
#include <eikon.hrh>
@@ -317,7 +317,7 @@
//-----------------------------------------------------------------------------
void WebEditorClient::handleKeypress(KeyboardEvent* event)
{
- if (!(m_webView && m_webView->page())) {
+ if (!m_webView && !m_webView->page()) {
return;
}
@@ -380,12 +380,12 @@
frame->editor()->execCommand("MoveLeft");
}
m_webView->fepTextEditor()->HandleUpdateCursor();
- if (frame->selectionController()->start() == startPos &&
- frame->selectionController()->end() == endPos && !select) {
- m_shouldEndEditing = !(m_webView->fepTextEditor()->IsTextAreaFocused() || m_webView->fepTextEditor()->IsInputElementFocused());
+ if (frame->selectionController()->start() != startPos &&
+ frame->selectionController()->end() != endPos) {
+ event->setDefaultHandled();
}
else {
- event->setDefaultHandled();
+ m_shouldEndEditing = !m_webView->fepTextEditor()->IsTextAreaFocused();
}
break;
@@ -403,51 +403,37 @@
frame->editor()->execCommand("MoveRight");
}
m_webView->fepTextEditor()->HandleUpdateCursor();
- if (frame->selectionController()->start() == startPos &&
- frame->selectionController()->end() == endPos && !select) {
- m_shouldEndEditing = !(m_webView->fepTextEditor()->IsTextAreaFocused() || m_webView->fepTextEditor()->IsInputElementFocused());
+ if (frame->selectionController()->start() != startPos &&
+ frame->selectionController()->end() != endPos) {
+ event->setDefaultHandled();
}
else {
- event->setDefaultHandled();
+ m_shouldEndEditing = !m_webView->fepTextEditor()->IsTextAreaFocused();
}
break;
case EKeyUpArrow:
- if (select) { //If shift is pressed then highlight the selection
- if(kevent->isKeyDown())
- break;
- frame->editor()->execCommand("MoveUpAndModifySelection");//from createCommandMap()
+ frame->editor()->execCommand("MoveUp");
+ m_webView->fepTextEditor()->HandleUpdateCursor();
+ if (frame->selectionController()->start() != startPos &&
+ frame->selectionController()->end() != endPos) {
+ event->setDefaultHandled();
}
else {
- frame->editor()->execCommand("MoveUp");
- }
- m_webView->fepTextEditor()->HandleUpdateCursor();
- if (frame->selectionController()->start() == startPos &&
- frame->selectionController()->end() == endPos && !select) {
m_shouldEndEditing = true;
}
- else {
- event->setDefaultHandled();
- }
break;
case EKeyDownArrow:
- if (select) {//If shift is pressed then highlight the selection
- if(kevent->isKeyDown())
- break;
- frame->editor()->execCommand("MoveDownAndModifySelection");//from createCommandMap()
+ frame->editor()->execCommand("MoveDown");
+ m_webView->fepTextEditor()->HandleUpdateCursor();
+ if (frame->selectionController()->start() != startPos &&
+ frame->selectionController()->end() != endPos) {
+ event->setDefaultHandled();
}
else {
- frame->editor()->execCommand("MoveDown");
- }
- m_webView->fepTextEditor()->HandleUpdateCursor();
- if (frame->selectionController()->start() == startPos &&
- frame->selectionController()->end() == endPos && !select) {
m_shouldEndEditing = true;
}
- else {
- event->setDefaultHandled();
- }
break;
case EKeyEnter:
@@ -465,6 +451,26 @@
break;
case EKeyF18:
+ if (magnify)
+ {
+ switch (kevent->symbianEvent().iScanCode)
+ {
+ case EEikCmdEditCut:
+ m_webView->fepTextEditor()->CcpuCutL();
+ frame->editor()->deleteWithDirection(SelectionController::BACKWARD,
+ CharacterGranularity, false, true);
+ m_webView->fepTextEditor()->HandleUpdateCursor();
+ break;
+ case EEikCmdEditCopy:
+ m_webView->fepTextEditor()->CcpuCopyL();
+ break;
+ case EEikCmdEditPaste:
+ m_webView->fepTextEditor()->CcpuPasteL();
+ break;
+ default:
+ break;
+ }
+ }
break;
// All of the diagonal KeyEvents are allowed to flow through the "default" case...
@@ -500,8 +506,6 @@
break;
}
- if(m_webView->fepTextEditor()->inlineTextEditingStarted())
- return;
if (TChar(kevent->symbianEvent().iCode).IsPrint()) {
if (m_webView->fepTextEditor()->DocumentLengthForFep() <
m_webView->fepTextEditor()->DocumentMaximumLengthForFep()) {
@@ -522,11 +526,9 @@
//-----------------------------------------------------------------------------
// WebEditorClient::handleInputMethodKeypress
//-----------------------------------------------------------------------------
-void WebEditorClient::handleInputMethodKeypress(KeyboardEvent* event)
+void WebEditorClient::handleInputMethodKeypress(KeyboardEvent*)
{
- const PlatformKeyboardEvent* kevent = event->keyEvent();
- if(kevent->isKeyDown())
- handleKeypress(event);
+ notImplemented();
}
//-----------------------------------------------------------------------------
@@ -561,9 +563,8 @@
//-----------------------------------------------------------------------------
bool WebEditorClient::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
{
-
- notImplemented();
- return false;
+ notImplemented();
+ return false;
}
//-----------------------------------------------------------------------------
@@ -690,7 +691,3 @@
}
}
-
-
-
-