webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp
branchRCL_3
changeset 73 a1a5d4e727e8
parent 71 4bd5176e1bc8
child 84 800203832575
equal deleted inserted replaced
71:4bd5176e1bc8 73:a1a5d4e727e8
    74 // -----------------------------------------------------------------------------
    74 // -----------------------------------------------------------------------------
    75 CWebFepTextEditor::CWebFepTextEditor(WebView* aView)
    75 CWebFepTextEditor::CWebFepTextEditor(WebView* aView)
    76     : m_webView(aView),
    76     : m_webView(aView),
    77       m_textFormatMask(NULL),
    77       m_textFormatMask(NULL),
    78       m_inlineEditText(NULL),
    78       m_inlineEditText(NULL),
    79       m_longKeyPress(EFalse)
    79       m_longKeyPress(EFalse),
       
    80       m_inlineTextEditingStarted(EFalse)
    80 {
    81 {
    81     // Set up the extended capabilities
    82     // Set up the extended capabilities
    82     TRAP_IGNORE(
    83     TRAP_IGNORE(
    83         m_ExtendedInputCapabilities = CAknExtendedInputCapabilities::NewL();
    84         m_ExtendedInputCapabilities = CAknExtendedInputCapabilities::NewL();
    84         );
    85         );
   321       MFepInlineTextFormatRetriever&,
   322       MFepInlineTextFormatRetriever&,
   322       MFepPointerEventHandlerDuringInlineEdit& /*aPointerEventHandlerDuringInlineEdit*/)
   323       MFepPointerEventHandlerDuringInlineEdit& /*aPointerEventHandlerDuringInlineEdit*/)
   323 {
   324 {
   324     CCoeEnv::Static()->ForEachFepObserverCall(FepObserverHandleStartOfTransactionL);
   325     CCoeEnv::Static()->ForEachFepObserverCall(FepObserverHandleStartOfTransactionL);
   325     ClearInlineText();
   326     ClearInlineText();
       
   327     m_inlineTextEditingStarted= ETrue;
   326     UpdateInlineText(aInitialInlineText);
   328     UpdateInlineText(aInitialInlineText);
   327 }
   329 }
   328 
   330 
   329 // -----------------------------------------------------------------------------
   331 // -----------------------------------------------------------------------------
   330 // UpdateFepInlineTextL
   332 // UpdateFepInlineTextL
   547 		if ( sc ){
   549 		if ( sc ){
   548 			IntRect rect = sc->caretRect();
   550 			IntRect rect = sc->caretRect();
   549 			Node* editNode = sc->focusNode();
   551 			Node* editNode = sc->focusNode();
   550 			TPoint viewPoint = kit(frame)->frameView()->frameCoordsInViewCoords(editNode->getRect().Rect().iBr);
   552 			TPoint viewPoint = kit(frame)->frameView()->frameCoordsInViewCoords(editNode->getRect().Rect().iBr);
   551 			xPos = viewPoint.iX;
   553 			xPos = viewPoint.iX;
   552 			yPos = viewPoint.iY;
   554 			yPos = frame->document()->focusedNode()->getRect().bottomLeft().y() + rect.height();
   553 			String str;
   555 			String str;
   554 			if ( editNode &&
   556 			if ( editNode &&
   555 				 editNode->isTextNode() ) {
   557 				 editNode->isTextNode() ) {
   556 				WebCore::Text* aText = (WebCore::Text*)editNode;
   558 				WebCore::Text* aText = (WebCore::Text*)editNode;
   557 				str = aText->data();
   559 				str = aText->data();
   598     //delete the m_inlineEditText since text is commited
   600     //delete the m_inlineEditText since text is commited
   599     delete m_inlineEditText;
   601     delete m_inlineEditText;
   600     m_inlineEditText = NULL;
   602     m_inlineEditText = NULL;
   601     
   603     
   602     m_longKeyPress = EFalse;
   604     m_longKeyPress = EFalse;
       
   605     m_inlineTextEditingStarted= EFalse;
   603 
   606 
   604     HandleUpdateCursor();
   607     HandleUpdateCursor();
   605     UpdateEditingMode();
   608     UpdateEditingMode();
   606 }
   609 }
   607 
   610 
   920             return EFalse;
   923             return EFalse;
   921         }
   924         }
   922 
   925 
   923         return ETrue;
   926         return ETrue;
   924     }
   927     }
       
   928 	else {
       
   929     setSCTAvailability(true);
       
   930     }
   925 
   931 
   926     return EFalse;
   932     return EFalse;
   927 }
   933 }
   928 
   934 
   929 // -----------------------------------------------------------------------------
   935 // -----------------------------------------------------------------------------
  1386 // -----------------------------------------------------------------------------
  1392 // -----------------------------------------------------------------------------
  1387 void CWebFepTextEditor::EnableCcpuL()
  1393 void CWebFepTextEditor::EnableCcpuL()
  1388 {
  1394 {
  1389     CAknCcpuSupport* ccpu = NULL;
  1395     CAknCcpuSupport* ccpu = NULL;
  1390     CAknEdwinState* edwinState = static_cast<CAknEdwinState*>(this->State(KNullUid));
  1396     CAknEdwinState* edwinState = static_cast<CAknEdwinState*>(this->State(KNullUid));
       
  1397     if ( edwinState && edwinState->MenuBar() && edwinState->MenuBar()->IsDisplayed() )
       
  1398         {
       
  1399         return;
       
  1400         }
  1391     ccpu = new(ELeave) CAknCcpuSupport(this);
  1401     ccpu = new(ELeave) CAknCcpuSupport(this);
  1392     ccpu->SetMopParent(this);
  1402     ccpu->SetMopParent(this);
  1393     CleanupStack::PushL(ccpu);
  1403     CleanupStack::PushL(ccpu);
  1394     ccpu->ConstructL();
  1404     ccpu->ConstructL();
  1395     CleanupStack::Pop(ccpu);
  1405     CleanupStack::Pop(ccpu);
  1506 void CWebFepTextEditor::ReportEventL()
  1516 void CWebFepTextEditor::ReportEventL()
  1507     {
  1517     {
  1508     m_ExtendedInputCapabilities->ReportEventL(CAknExtendedInputCapabilities::
  1518     m_ExtendedInputCapabilities->ReportEventL(CAknExtendedInputCapabilities::
  1509                         MAknEventObserver::EPointerEventReceived, NULL );
  1519                         MAknEventObserver::EPointerEventReceived, NULL );
  1510     }
  1520     }
       
  1521 
       
  1522 TBool CWebFepTextEditor::inlineTextEditingStarted()
       
  1523     {
       
  1524     return m_inlineTextEditingStarted; 
       
  1525     }
       
  1526