OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #include "xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.h" |
| 8 |
| 9 #include "xfa/fwl/core/ifwl_edit.h" |
| 10 #include "xfa/fxfa/app/xfa_fftextedit.h" |
| 11 |
| 12 CXFA_FFTextEditDelegate::CXFA_FFTextEditDelegate( |
| 13 std::unique_ptr<IFWL_WidgetDelegate> pDelegate, |
| 14 CXFA_FFTextEdit* const pWidget) |
| 15 : CXFA_FFFieldDelegate(std::move(pDelegate), pWidget) {} |
| 16 |
| 17 CXFA_FFTextEditDelegate::~CXFA_FFTextEditDelegate() {} |
| 18 |
| 19 void CXFA_FFTextEditDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
| 20 m_pDelegate->OnProcessMessage(pMessage); |
| 21 } |
| 22 |
| 23 void CXFA_FFTextEditDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
| 24 CXFA_FFFieldDelegate::OnProcessEvent(pEvent); |
| 25 |
| 26 CXFA_FFTextEdit* widget = static_cast<CXFA_FFTextEdit*>(m_pWidget); |
| 27 |
| 28 switch (pEvent->GetClassID()) { |
| 29 case CFWL_EventType::TextChanged: { |
| 30 CFWL_EvtEdtTextChanged* event = |
| 31 static_cast<CFWL_EvtEdtTextChanged*>(pEvent); |
| 32 CFX_WideString wsChange; |
| 33 widget->OnTextChanged(widget->GetNormalWidget()->GetWidget(), wsChange, |
| 34 event->wsPrevText); |
| 35 break; |
| 36 } |
| 37 case CFWL_EventType::TextFull: { |
| 38 widget->OnTextFull(widget->GetNormalWidget()->GetWidget()); |
| 39 break; |
| 40 } |
| 41 case CFWL_EventType::CheckWord: { |
| 42 CFX_WideString wstr(L"FWL_EVENT_DTP_SelectChanged"); |
| 43 CFWL_EvtEdtCheckWord* event = static_cast<CFWL_EvtEdtCheckWord*>(pEvent); |
| 44 event->bCheckWord = widget->CheckWord(event->bsWord.AsStringC()); |
| 45 break; |
| 46 } |
| 47 case CFWL_EventType::GetSuggestedWords: { |
| 48 CFWL_EvtEdtGetSuggestWords* event = |
| 49 static_cast<CFWL_EvtEdtGetSuggestWords*>(pEvent); |
| 50 event->bSuggestWords = FALSE; |
| 51 break; |
| 52 } |
| 53 default: |
| 54 break; |
| 55 } |
| 56 m_pDelegate->OnProcessEvent(pEvent); |
| 57 } |
| 58 |
| 59 void CXFA_FFTextEditDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 60 const CFX_Matrix* pMatrix) { |
| 61 m_pDelegate->OnDrawWidget(pGraphics, pMatrix); |
| 62 } |
OLD | NEW |