| Index: xfa/fxfa/app/cxfa_fftexteditdelegate.cpp
|
| diff --git a/xfa/fxfa/app/cxfa_fftexteditdelegate.cpp b/xfa/fxfa/app/cxfa_fftexteditdelegate.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..111f4a5c3c637f766d75dc6808aca58a721eff52
|
| --- /dev/null
|
| +++ b/xfa/fxfa/app/cxfa_fftexteditdelegate.cpp
|
| @@ -0,0 +1,62 @@
|
| +// Copyright 2016 PDFium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
|
| +
|
| +#include "xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.h"
|
| +
|
| +#include "xfa/fwl/core/ifwl_edit.h"
|
| +#include "xfa/fxfa/app/xfa_fftextedit.h"
|
| +
|
| +CXFA_FFTextEditDelegate::CXFA_FFTextEditDelegate(
|
| + std::unique_ptr<IFWL_WidgetDelegate> pDelegate,
|
| + CXFA_FFTextEdit* const pWidget)
|
| + : CXFA_FFFieldDelegate(std::move(pDelegate), pWidget) {}
|
| +
|
| +CXFA_FFTextEditDelegate::~CXFA_FFTextEditDelegate() {}
|
| +
|
| +void CXFA_FFTextEditDelegate::OnProcessMessage(CFWL_Message* pMessage) {
|
| + m_pDelegate->OnProcessMessage(pMessage);
|
| +}
|
| +
|
| +void CXFA_FFTextEditDelegate::OnProcessEvent(CFWL_Event* pEvent) {
|
| + CXFA_FFFieldDelegate::OnProcessEvent(pEvent);
|
| +
|
| + CXFA_FFTextEdit* widget = static_cast<CXFA_FFTextEdit*>(m_pWidget);
|
| +
|
| + switch (pEvent->GetClassID()) {
|
| + case CFWL_EventType::TextChanged: {
|
| + CFWL_EvtEdtTextChanged* event =
|
| + static_cast<CFWL_EvtEdtTextChanged*>(pEvent);
|
| + CFX_WideString wsChange;
|
| + widget->OnTextChanged(widget->GetNormalWidget()->GetWidget(), wsChange,
|
| + event->wsPrevText);
|
| + break;
|
| + }
|
| + case CFWL_EventType::TextFull: {
|
| + widget->OnTextFull(widget->GetNormalWidget()->GetWidget());
|
| + break;
|
| + }
|
| + case CFWL_EventType::CheckWord: {
|
| + CFX_WideString wstr(L"FWL_EVENT_DTP_SelectChanged");
|
| + CFWL_EvtEdtCheckWord* event = static_cast<CFWL_EvtEdtCheckWord*>(pEvent);
|
| + event->bCheckWord = widget->CheckWord(event->bsWord.AsStringC());
|
| + break;
|
| + }
|
| + case CFWL_EventType::GetSuggestedWords: {
|
| + CFWL_EvtEdtGetSuggestWords* event =
|
| + static_cast<CFWL_EvtEdtGetSuggestWords*>(pEvent);
|
| + event->bSuggestWords = FALSE;
|
| + break;
|
| + }
|
| + default:
|
| + break;
|
| + }
|
| + m_pDelegate->OnProcessEvent(pEvent);
|
| +}
|
| +
|
| +void CXFA_FFTextEditDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix) {
|
| + m_pDelegate->OnDrawWidget(pGraphics, pMatrix);
|
| +}
|
|
|