36 #include "FocusController.h" |
38 #include "FocusController.h" |
37 #include "WebFrameView.h" |
39 #include "WebFrameView.h" |
38 |
40 |
39 #include "Frame.h" |
41 #include "Frame.h" |
40 #include "Editor.h" |
42 #include "Editor.h" |
41 #include "HTMLNames.h" |
43 #include "HtmlNames.h" |
42 #include "EventHandler.h" |
44 #include "EventHandler.h" |
43 #include "HTMLInputElement.h" |
45 #include "HtmlInputElement.h" |
44 #include "HTMLTextAreaElement.h" |
46 #include "HtmlTextAreaElement.h" |
45 #include "PlatformKeyboardEvent.h" |
47 #include "PlatformKeyboardEvent.h" |
46 #include "CSSPropertyNames.h" |
48 #include "CSSPropertyNames.h" |
47 #include "CSSValueKeywords.h" |
49 #include "CSSValueKeywords.h" |
48 |
50 |
49 #include <coemain.h> |
51 #include <coemain.h> |
50 #include <eikpanic.h> |
52 #include <eikpanic.h> |
51 #include <aknedsts.h> |
53 #include <aknedsts.h> |
52 #include <AknUtils.h> |
54 #include <aknutils.h> |
53 #include "Text.h" |
55 #include "Text.h" |
|
56 |
|
57 #include <e32const.h> |
|
58 |
|
59 #define KLineEnterChar 0x21b2 |
54 |
60 |
55 using namespace WebCore; |
61 using namespace WebCore; |
56 |
62 |
57 static const int kInfinite = -1; |
63 static const int kInfinite = -1; |
58 _LIT(KBlankDesC," "); |
64 _LIT(KBlankDesC," "); |
127 // ----------------------------------------------------------------------------- |
136 // ----------------------------------------------------------------------------- |
128 void CWebFepTextEditor::UpdateEditingMode() |
137 void CWebFepTextEditor::UpdateEditingMode() |
129 { |
138 { |
130 Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame(); |
139 Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame(); |
131 if (frame) { |
140 if (frame) { |
132 Node *node = frame->document()->focusedNode(); |
141 Node *node = frame->document()->focusedNode(); |
133 if (frame && frame->document() && node) { |
142 if (frame && frame->document() && node) { |
134 if (node->hasTagName(HTMLNames::inputTag) |
143 if (node->hasTagName(HTMLNames::inputTag) |
135 && (static_cast<HTMLInputElement*>(node)->inputType() == HTMLInputElement::PASSWORD) |
144 && (static_cast<HTMLInputElement*>(node)->inputType() == HTMLInputElement::PASSWORD) |
136 && !static_cast<HTMLInputElement*>(node)->readOnly()) { |
145 && !static_cast<HTMLInputElement*>(node)->readOnly()) { |
137 // Set the state as if it was the CEikSecretEditor |
146 // Set the state as if it was the CEikSecretEditor |
138 CAknEdwinState* state = static_cast<CAknEdwinState*>(State(KNullUid)); |
147 CAknEdwinState* state = static_cast<CAknEdwinState*>(State(KNullUid)); |
139 if (state) { |
148 if (state) { |
140 state->SetFlags( EAknEditorFlagNoLRNavigation | |
149 state->SetFlags( EAknEditorFlagNoLRNavigation | |
141 EAknEditorFlagLatinInputModesOnly | |
150 EAknEditorFlagLatinInputModesOnly | |
142 EAknEditorFlagNoT9 | |
151 EAknEditorFlagNoT9 | |
143 EAknEditorFlagUseSCTNumericCharmap ); |
152 EAknEditorFlagUseSCTNumericCharmap | |
|
153 EAknEditorFlagNoLRNavigation); |
144 state->SetDefaultInputMode(EAknEditorSecretAlphaInputMode); |
154 state->SetDefaultInputMode(EAknEditorSecretAlphaInputMode); |
145 state->SetCurrentInputMode(EAknEditorSecretAlphaInputMode); |
155 state->SetCurrentInputMode(EAknEditorSecretAlphaInputMode); |
146 state->SetPermittedCases(EAknEditorLowerCase|EAknEditorUpperCase); |
156 state->SetPermittedCases(EAknEditorLowerCase|EAknEditorUpperCase); |
147 state->SetCurrentCase(EAknEditorLowerCase); |
157 state->SetCurrentCase(EAknEditorLowerCase); |
148 state->SetPermittedInputModes(EAknEditorSecretAlphaInputMode | EAknEditorNumericInputMode); |
158 state->SetPermittedInputModes(EAknEditorSecretAlphaInputMode | EAknEditorNumericInputMode); |
149 state->SetDefaultCase(EAknEditorLowerCase); |
159 state->SetDefaultCase(EAknEditorLowerCase); |
150 state->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY); |
160 state->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY); |
151 state->SetNumericKeymap(EAknEditorPlainNumberModeKeymap); |
161 state->SetNumericKeymap(EAknEditorStandardNumberModeKeymap); |
|
162 state->SetCcpuState(NULL); |
|
163 TRAP_IGNORE( state->ReportAknEdStateEventL(MAknEdStateObserver::EAknEdwinStateFlagsUpdate ) ); |
152 } |
164 } |
153 } |
165 } |
154 else { |
166 else { |
155 CreateTextFormatMask(); |
167 CreateTextFormatMask(); |
156 TUint currentCase ( EAknEditorLowerCase ) ; |
168 TUint currentCase ( EAknEditorLowerCase ) ; |
157 TUint permittedCase ( EAknEditorAllCaseModes ) ; |
169 TUint permittedCase ( EAknEditorAllCaseModes ) ; |
158 TUint inputMode( EAknEditorNullInputMode ); |
170 TUint inputMode( EAknEditorNullInputMode ); |
159 TUint permittedInputModes( EAknEditorAllInputModes ); |
171 TUint permittedInputModes( EAknEditorAllInputModes ); |
|
172 #ifdef BRDO_MULTITOUCH_ENABLED_FF |
|
173 TUint flags( EAknEditorFlagDefault | EAknEditorFlagSelectionVisible ); |
|
174 #else |
160 TUint flags( EAknEditorFlagDefault ); |
175 TUint flags( EAknEditorFlagDefault ); |
|
176 #endif |
161 TUint numericKeyMap( EAknEditorStandardNumberModeKeymap ); |
177 TUint numericKeyMap( EAknEditorStandardNumberModeKeymap ); |
162 |
178 |
163 if (GetStateFromFormatMask(currentCase, permittedCase, inputMode, permittedInputModes, flags, numericKeyMap)) { |
179 if (GetStateFromFormatMask(currentCase, permittedCase, inputMode, permittedInputModes, flags, numericKeyMap)) { |
164 UpdateFlagsState(flags); |
180 UpdateFlagsState(flags); |
165 UpdateInputModeState(inputMode, permittedInputModes, numericKeyMap); |
181 UpdateInputModeState(inputMode, permittedInputModes, numericKeyMap); |
166 UpdateCaseState(currentCase, permittedCase); |
182 UpdateCaseState(currentCase, permittedCase); |
167 } |
183 } |
188 delete m_textFormatMask; |
205 delete m_textFormatMask; |
189 m_textFormatMask = NULL; |
206 m_textFormatMask = NULL; |
190 |
207 |
191 delete m_inlineEditText; |
208 delete m_inlineEditText; |
192 m_inlineEditText = NULL; |
209 m_inlineEditText = NULL; |
|
210 |
|
211 m_longKeyPress = EFalse ; |
193 |
212 |
194 UpdateInputModeState(EAknEditorNullInputMode, EAknEditorAllInputModes,EAknEditorStandardNumberModeKeymap); |
213 UpdateInputModeState(EAknEditorNullInputMode, EAknEditorAllInputModes,EAknEditorStandardNumberModeKeymap); |
195 UpdateFlagsState(EAknEditorFlagDefault); |
214 UpdateFlagsState(EAknEditorFlagDefault); |
196 UpdateCaseState(EAknEditorLowerCase, EAknEditorAllCaseModes); |
215 UpdateCaseState(EAknEditorLowerCase, EAknEditorAllCaseModes); |
197 |
216 |
198 CancelFepInlineEdit(); |
217 CancelFepInlineEdit(); |
199 } |
218 } |
200 |
219 |
337 // |
357 // |
338 // |
358 // |
339 // ----------------------------------------------------------------------------- |
359 // ----------------------------------------------------------------------------- |
340 void CWebFepTextEditor::CancelFepInlineEdit() |
360 void CWebFepTextEditor::CancelFepInlineEdit() |
341 { |
361 { |
|
362 if (IsTextAreaFocused()||IsInputElementFocused()) { |
|
363 if (m_inlineEditText && DocumentLengthForFep() < DocumentMaximumLengthForFep()) { |
|
364 HBufC* tempBuf = HBufC::NewLC(DocumentLengthForFep()); |
|
365 TPtr ptr(tempBuf->Des()); |
|
366 GetEditorContentForFep(ptr, 0, DocumentLengthForFep()); |
|
367 TInt position = ptr.Locate(KLineEnterChar); |
|
368 if(position != KErrNotFound){ |
|
369 TRAP_IGNORE(m_webView->fepTextEditor()->DoCommitFepInlineEditL()); |
|
370 Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame(); |
|
371 if(frame){ |
|
372 frame->editor()->execCommand("BackwardDelete"); |
|
373 } |
|
374 } |
|
375 CleanupStack::PopAndDestroy(); |
|
376 } |
|
377 } |
342 } |
378 } |
343 |
379 |
344 // ----------------------------------------------------------------------------- |
380 // ----------------------------------------------------------------------------- |
345 // DocumentLengthForFep |
381 // DocumentLengthForFep |
346 // |
382 // |
401 { |
440 { |
402 // The other part of the rather hackish way to check if we are at the end of the editing field |
441 // The other part of the rather hackish way to check if we are at the end of the editing field |
403 // see WebEditorClient::handleKeypress |
442 // see WebEditorClient::handleKeypress |
404 Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame(); |
443 Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame(); |
405 Node* focusedNode = frame->document()->focusedNode(); |
444 Node* focusedNode = frame->document()->focusedNode(); |
406 if ( frame && focusedNode) { |
445 if ( focusedNode ) { |
407 TInt lowPos = aCursorSelection.LowerPos(); |
446 TInt lowPos = aCursorSelection.LowerPos(); |
408 TInt highPos = aCursorSelection.HigherPos(); |
447 TInt highPos = aCursorSelection.HigherPos(); |
409 if (focusedNode->hasTagName(HTMLNames::textareaTag)) { |
448 if (focusedNode->hasTagName(HTMLNames::textareaTag)) { |
410 HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(focusedNode); |
449 HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(focusedNode); |
411 textArea->setSelectionRange(lowPos, highPos); |
450 textArea->setSelectionRange(lowPos, highPos); |
428 { |
467 { |
429 aCursorSelection.SetSelection(0,0); |
468 aCursorSelection.SetSelection(0,0); |
430 |
469 |
431 Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame(); |
470 Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame(); |
432 Node* focusedNode = frame->document()->focusedNode(); |
471 Node* focusedNode = frame->document()->focusedNode(); |
433 if (frame && focusedNode) { |
472 if (focusedNode) { |
434 if (focusedNode->hasTagName(HTMLNames::textareaTag)) { |
473 if (focusedNode->hasTagName(HTMLNames::textareaTag)) { |
435 HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(focusedNode); |
474 HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(focusedNode); |
436 TInt anchorPos = textArea->selectionStart(); |
475 TInt anchorPos = textArea->selectionStart(); |
437 TInt cursorPos = textArea->selectionEnd(); |
476 TInt cursorPos = textArea->selectionEnd(); |
438 aCursorSelection.SetSelection(cursorPos, anchorPos); |
477 aCursorSelection.SetSelection(cursorPos, anchorPos); |
511 int xPos(0); |
550 int xPos(0); |
512 int yPos(0); |
551 int yPos(0); |
513 if ( sc ){ |
552 if ( sc ){ |
514 IntRect rect = sc->caretRect(); |
553 IntRect rect = sc->caretRect(); |
515 Node* editNode = sc->focusNode(); |
554 Node* editNode = sc->focusNode(); |
516 TPoint viewPoint = kit(frame)->frameView()->frameCoordsInViewCoords(editNode->getRect().Rect().iBr); |
555 if ( editNode && editNode->isTextNode() ) { |
517 xPos = viewPoint.iX; |
556 TPoint viewPoint = kit(frame)->frameView()->frameCoordsInViewCoords(editNode->getRect().Rect().iBr); |
518 yPos = viewPoint.iY; |
557 xPos = viewPoint.iX; |
519 String str; |
558 yPos = frame->document()->focusedNode()->getRect().bottomLeft().y() + rect.height(); |
520 if ( editNode && |
559 |
521 editNode->isTextNode() ) { |
560 String str; |
522 WebCore::Text* aText = (WebCore::Text*)editNode; |
561 WebCore::Text* aText = (WebCore::Text*)editNode; |
523 str = aText->data(); |
562 str = aText->data(); |
524 aDocumentPosition = aText->length(); |
563 aDocumentPosition = aText->length(); |
525 TInt position = aDocumentPosition - ( str.reverseFind(KBlankDesC(), aDocumentPosition )+1); |
564 TInt position = aDocumentPosition - ( str.reverseFind(KBlankDesC(), aDocumentPosition )+1); |
526 String word(str); |
565 String word(str); |
527 if( position > 0 ){ |
566 if( position > 0 ){ |
555 if (frame){ |
594 if (frame){ |
556 if(IsWapMaskedModeInput(frame)) { |
595 if(IsWapMaskedModeInput(frame)) { |
557 HandleMaskedInsertText(frame, (String(*m_inlineEditText))); |
596 HandleMaskedInsertText(frame, (String(*m_inlineEditText))); |
558 } |
597 } |
559 else { |
598 else { |
560 frame->editor()->insertTextWithoutSendingTextEvent(String(*m_inlineEditText), false); |
599 frame->editor()->insertTextWithoutSendingTextEvent(String(*m_inlineEditText), false); |
561 } |
600 } |
562 } |
601 } |
563 } |
602 } |
564 //delete the m_inlineEditText since text is commited |
603 //delete the m_inlineEditText since text is commited |
565 delete m_inlineEditText; |
604 delete m_inlineEditText; |
566 m_inlineEditText = NULL; |
605 m_inlineEditText = NULL; |
|
606 |
|
607 m_longKeyPress = EFalse; |
|
608 m_inlineTextEditingStarted= EFalse; |
567 |
609 |
568 HandleUpdateCursor(); |
610 HandleUpdateCursor(); |
569 UpdateEditingMode(); |
611 UpdateEditingMode(); |
570 } |
612 } |
571 |
613 |
633 MFepInlineTextFormatRetriever& aInlineTextFormatRetriever, |
675 MFepInlineTextFormatRetriever& aInlineTextFormatRetriever, |
634 MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit) |
676 MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit) |
635 { |
677 { |
636 aSetToTrue=ETrue; |
678 aSetToTrue=ETrue; |
637 SetCursorSelectionForFepL(aCursorSelection); |
679 SetCursorSelectionForFepL(aCursorSelection); |
|
680 m_longKeyPress = ETrue ; |
638 StartFepInlineEditL(aInitialInlineText, aPositionOfInsertionPointInInlineText, aCursorVisibility, aCustomDraw, aInlineTextFormatRetriever, aPointerEventHandlerDuringInlineEdit); |
681 StartFepInlineEditL(aInitialInlineText, aPositionOfInsertionPointInInlineText, aCursorVisibility, aCustomDraw, aInlineTextFormatRetriever, aPointerEventHandlerDuringInlineEdit); |
639 } |
682 } |
640 |
683 |
641 // ----------------------------------------------------------------------------- |
684 // ----------------------------------------------------------------------------- |
642 // SetCursorType |
685 // SetCursorType |
691 void CWebFepTextEditor::UpdateFlagsState(TUint flags) |
734 void CWebFepTextEditor::UpdateFlagsState(TUint flags) |
692 { |
735 { |
693 CAknEdwinState* state = static_cast<CAknEdwinState*>(State(KNullUid)); |
736 CAknEdwinState* state = static_cast<CAknEdwinState*>(State(KNullUid)); |
694 |
737 |
695 if ( IsTextAreaFocused() ) { |
738 if ( IsTextAreaFocused() ) { |
|
739 #ifdef BRDO_MULTITOUCH_ENABLED_FF |
696 // If in a TextArea, allow "enter" key presses to be newline/paragraph |
740 // If in a TextArea, allow "enter" key presses to be newline/paragraph |
697 state->SetFlags( flags | EAknEditorFlagUseSCTNumericCharmap |
741 state->SetFlags( flags | EAknEditorFlagUseSCTNumericCharmap |
698 | EAknEditorFlagAllowEntersWithScrollDown ); |
742 | EAknEditorFlagAllowEntersWithScrollDown | EAknEditorFlagSelectionVisible ); |
|
743 #else |
|
744 state->SetFlags( flags | EAknEditorFlagUseSCTNumericCharmap |
|
745 | EAknEditorFlagAllowEntersWithScrollDown ); |
|
746 #endif |
699 } |
747 } |
700 else { |
748 else { |
701 state->SetFlags(flags | EAknEditorFlagUseSCTNumericCharmap); |
749 #ifdef BRDO_MULTITOUCH_ENABLED_FF |
|
750 state->SetFlags(flags | EAknEditorFlagUseSCTNumericCharmap | EAknEditorFlagSelectionVisible); |
|
751 #else |
|
752 state->SetFlags(flags | EAknEditorFlagUseSCTNumericCharmap ); |
|
753 #endif |
702 } |
754 } |
703 |
755 |
704 state->ReportAknEdStateEventL(MAknEdStateObserver::EAknEdwinStateFlagsUpdate); |
756 state->ReportAknEdStateEventL(MAknEdStateObserver::EAknEdwinStateFlagsUpdate); |
|
757 if (m_CcpuSupport) |
|
758 { |
|
759 TRAP_IGNORE(m_CcpuSupport->HandleFocusChangeL()); |
|
760 } |
705 } |
761 } |
706 |
762 |
707 // ----------------------------------------------------------------------------- |
763 // ----------------------------------------------------------------------------- |
708 // UpdateInputModeState |
764 // UpdateInputModeState |
709 // |
765 // |
791 |
850 |
792 TInt cursorpos = DocumentLengthForFep(); |
851 TInt cursorpos = DocumentLengthForFep(); |
793 TInputFormatMaskType fm = m_textFormatMask->getInputFormatMaskType(frame, cursorpos); |
852 TInputFormatMaskType fm = m_textFormatMask->getInputFormatMaskType(frame, cursorpos); |
794 if (!cursorpos) { |
853 if (!cursorpos) { |
795 while(fm == EStatic) { |
854 while(fm == EStatic) { |
796 fm = m_textFormatMask->getInputFormatMaskType(frame, ++cursorpos); |
855 fm = m_textFormatMask->getInputFormatMaskType(frame, ++cursorpos); |
797 } |
856 } |
798 } |
857 } |
799 setSCTAvailability(true); |
858 setSCTAvailability(true); |
|
859 CAknEdwinState* state = static_cast<CAknEdwinState*>(State(KNullUid)); |
800 switch( fm ) { |
860 switch( fm ) { |
801 case ELeUpSymPuc: //A any upper case letter or symbolic |
861 case ELeUpSymPuc: //A any upper case letter or symbolic |
802 flags = EAknEditorFlagNoT9 | EAknEditorFlagFixedCase; |
862 flags = EAknEditorFlagNoT9 | EAknEditorFlagFixedCase; |
803 currentCase = EAknEditorUpperCase; |
863 currentCase = EAknEditorUpperCase; |
804 permittedCase = EAknEditorUpperCase; |
864 permittedCase = EAknEditorUpperCase; |
814 break; |
874 break; |
815 case ELeUpNumSymPuc: //X any upper case, number or symbolic |
875 case ELeUpNumSymPuc: //X any upper case, number or symbolic |
816 flags = EAknEditorFlagNoT9 | EAknEditorFlagFixedCase; |
876 flags = EAknEditorFlagNoT9 | EAknEditorFlagFixedCase; |
817 currentCase = EAknEditorUpperCase; |
877 currentCase = EAknEditorUpperCase; |
818 permittedCase= EAknEditorUpperCase; |
878 permittedCase= EAknEditorUpperCase; |
819 inputMode = EAknEditorTextInputMode; |
879 inputMode = state->CurrentInputMode(); |
820 permittedInputModes= EAknEditorTextInputMode; |
880 permittedInputModes= EAknEditorTextInputMode; |
821 break; |
881 break; |
822 case ELeLoNumSymPuc: //x any lower case, number or symbolic |
882 case ELeLoNumSymPuc: //x any lower case, number or symbolic |
823 flags = EAknEditorFlagNoT9 | EAknEditorFlagFixedCase; |
883 flags = EAknEditorFlagNoT9 | EAknEditorFlagFixedCase; |
824 currentCase = EAknEditorLowerCase; |
884 currentCase = EAknEditorLowerCase; |
825 permittedCase= EAknEditorLowerCase; |
885 permittedCase= EAknEditorLowerCase; |
826 inputMode = EAknEditorTextInputMode; |
886 inputMode = state->CurrentInputMode(); |
827 permittedInputModes= EAknEditorTextInputMode | EAknEditorNumericInputMode; |
887 permittedInputModes= EAknEditorTextInputMode | EAknEditorNumericInputMode; |
828 break; |
888 break; |
829 case EAnyLow: //m any lower character can be changed to upper |
889 case EAnyLow: //m any lower character can be changed to upper |
830 flags = EAknEditorFlagNoT9; |
890 flags = EAknEditorFlagNoT9; |
831 currentCase = EAknEditorLowerCase; |
891 currentCase = EAknEditorLowerCase; |
1089 // ----------------------------------------------------------------------------- |
1162 // ----------------------------------------------------------------------------- |
1090 TBool CWebFepTextEditor::CcpuCanCopy() const |
1163 TBool CWebFepTextEditor::CcpuCanCopy() const |
1091 { |
1164 { |
1092 TCursorSelection selection; |
1165 TCursorSelection selection; |
1093 GetCursorSelectionForFep(selection); |
1166 GetCursorSelectionForFep(selection); |
1094 return selection.Length(); |
1167 return m_CcpuSupport && selection.Length(); |
1095 } |
1168 } |
1096 |
1169 |
1097 // ----------------------------------------------------------------------------- |
1170 // ----------------------------------------------------------------------------- |
1098 // CcpuCopyL |
1171 // CcpuCopyL |
1099 // |
1172 // |
1100 // |
1173 // |
1101 // ----------------------------------------------------------------------------- |
1174 // ----------------------------------------------------------------------------- |
1102 void CWebFepTextEditor::CcpuCopyL() |
1175 void CWebFepTextEditor::CcpuCopyL() |
1103 { |
1176 { |
1104 PlaceDataOnClipboardL(); |
1177 PlaceDataOnClipboardL(); |
|
1178 if (m_CcpuSupport) |
|
1179 m_CcpuSupport->HandleSelectionChangeL(); |
1105 } |
1180 } |
1106 |
1181 |
1107 // ----------------------------------------------------------------------------- |
1182 // ----------------------------------------------------------------------------- |
1108 // CcpuCanPaste |
1183 // CcpuCanPaste |
1109 // |
1184 // |
1110 // |
1185 // |
1111 // ----------------------------------------------------------------------------- |
1186 // ----------------------------------------------------------------------------- |
1112 TBool CWebFepTextEditor::CcpuCanPaste() const |
1187 TBool CWebFepTextEditor::CcpuCanPaste() const |
1113 { |
1188 { |
1114 TRAPD(err, DoCcpuCanPasteL()); |
1189 TRAPD(err, DoCcpuCanPasteL()); |
1115 return err == KErrNone; |
1190 return (err == KErrNone) && m_CcpuSupport; |
1116 } |
1191 } |
1117 |
1192 |
1118 // ----------------------------------------------------------------------------- |
1193 // ----------------------------------------------------------------------------- |
1119 // CcpuPasteL |
1194 // CcpuPasteL |
1120 // |
1195 // |
1235 } |
1310 } |
1236 |
1311 |
1237 // ----------------------------------------------------------------------------- |
1312 // ----------------------------------------------------------------------------- |
1238 // IsWapMaskedModeInput |
1313 // IsWapMaskedModeInput |
1239 // |
1314 // |
1240 // |
1315 // |
1241 // ----------------------------------------------------------------------------- |
1316 // ----------------------------------------------------------------------------- |
1242 bool CWebFepTextEditor::IsWapMaskedModeInput(WebCore::Frame* frame) |
1317 bool CWebFepTextEditor::IsWapMaskedModeInput(WebCore::Frame* frame) |
1243 { |
1318 { |
1244 bool maskedInput(false); |
1319 bool maskedInput(false); |
1245 if (m_textFormatMask && frame->document() && frame->document()->focusedNode()) { |
1320 if (m_textFormatMask && frame->document() && frame->document()->focusedNode()) { |
1246 RenderStyle* s = frame->document()->focusedNode()->renderStyle(); |
1321 RenderStyle* s = frame->document()->focusedNode()->renderStyle(); |
1247 if (s && (!s->wapInputFormat().isEmpty() || s->wapInputRequired())){ |
1322 if (s && (!s->wapInputFormat().isEmpty() || s->wapInputRequired())){ |
1248 maskedInput = true; |
1323 maskedInput = true; |
1249 } |
1324 } |
1250 } |
1325 } |
1251 return maskedInput; |
1326 return maskedInput; |
1252 } |
1327 } |
1316 // ----------------------------------------------------------------------------- |
1391 // ----------------------------------------------------------------------------- |
1317 // EnableCcpu |
1392 // EnableCcpu |
1318 // |
1393 // |
1319 // |
1394 // |
1320 // ----------------------------------------------------------------------------- |
1395 // ----------------------------------------------------------------------------- |
1321 void CWebFepTextEditor::EnableCcpu(TBool aSupport) |
1396 void CWebFepTextEditor::EnableCcpuL() |
1322 { |
1397 { |
|
1398 CAknCcpuSupport* ccpu = NULL; |
1323 CAknEdwinState* edwinState = static_cast<CAknEdwinState*>(this->State(KNullUid)); |
1399 CAknEdwinState* edwinState = static_cast<CAknEdwinState*>(this->State(KNullUid)); |
1324 if(aSupport) |
1400 if ( edwinState && edwinState->MenuBar() && edwinState->MenuBar()->IsDisplayed() ) |
1325 { |
1401 { |
1326 edwinState->SetCcpuState(this); |
1402 return; |
1327 } |
1403 } |
1328 else |
1404 ccpu = new(ELeave) CAknCcpuSupport(this); |
|
1405 ccpu->SetMopParent(this); |
|
1406 CleanupStack::PushL(ccpu); |
|
1407 ccpu->ConstructL(); |
|
1408 CleanupStack::Pop(ccpu); |
|
1409 delete m_CcpuSupport; |
|
1410 m_CcpuSupport = ccpu; |
|
1411 if (edwinState) |
1329 { |
1412 { |
1330 edwinState->SetCcpuState(NULL); |
1413 edwinState->SetCcpuState(this); |
1331 } |
1414 edwinState->SetMenu(); |
|
1415 if (edwinState->MenuBar()) |
|
1416 edwinState->MenuBar()->SetEditMenuObserver( m_CcpuSupport ); |
|
1417 } |
1332 } |
1418 } |
1333 |
1419 |
1334 // ----------------------------------------------------------------------------- |
1420 // ----------------------------------------------------------------------------- |
1335 // findPrevSiblingTextLen |
1421 // findPrevSiblingTextLen |
1336 // |
1422 // |
1411 } |
1497 } |
1412 m_ExtendedInputCapabilities->SetCapabilities(capabilities); |
1498 m_ExtendedInputCapabilities->SetCapabilities(capabilities); |
1413 } |
1499 } |
1414 } |
1500 } |
1415 |
1501 |
|
1502 // ----------------------------------------------------------------------------- |
|
1503 // IsLongKeyPress |
|
1504 // |
|
1505 // Called to know the status of the key pressed |
|
1506 // ----------------------------------------------------------------------------- |
|
1507 TBool CWebFepTextEditor::IsLongKeyPress() const |
|
1508 { |
|
1509 return m_longKeyPress ; |
|
1510 } |
|
1511 |
|
1512 TBool CWebFepTextEditor::IsInputElementFocused() const |
|
1513 { |
|
1514 Frame* frame = m_webView->page()->focusController()->focusedOrMainFrame(); |
|
1515 return ( frame && frame->document()->focusedNode() && |
|
1516 frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)); |
|
1517 } |
|
1518 |
|
1519 void CWebFepTextEditor::ReportEventL() |
|
1520 { |
|
1521 m_ExtendedInputCapabilities->ReportEventL(CAknExtendedInputCapabilities:: |
|
1522 MAknEventObserver::EPointerEventReceived, NULL ); |
|
1523 } |
|
1524 |
|
1525 TBool CWebFepTextEditor::inlineTextEditingStarted() |
|
1526 { |
|
1527 return m_inlineTextEditingStarted; |
|
1528 } |
|
1529 |