Index: xfa/fxfa/app/cxfa_fffielddelegate.cpp |
diff --git a/xfa/fxfa/app/cxfa_fffielddelegate.cpp b/xfa/fxfa/app/cxfa_fffielddelegate.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..25e114dda76314cab59aa42ff9f0179691d1e5dc |
--- /dev/null |
+++ b/xfa/fxfa/app/cxfa_fffielddelegate.cpp |
@@ -0,0 +1,64 @@ |
+// 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_fffielddelegate.h" |
+ |
+#include "xfa/fxfa/cxfa_eventparam.h" |
+ |
+CXFA_FFFieldDelegate::CXFA_FFFieldDelegate( |
+ std::unique_ptr<IFWL_WidgetDelegate> pDelegate, |
+ CXFA_FFField* pWidget) |
+ : m_pDelegate(std::move(pDelegate)), m_pWidget(pWidget) {} |
+ |
+CXFA_FFFieldDelegate::~CXFA_FFFieldDelegate() {} |
+ |
+void CXFA_FFFieldDelegate::OnProcessMessage(CFWL_Message* pMessage) {} |
+ |
+void CXFA_FFFieldDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
+ switch (pEvent->GetClassID()) { |
+ case CFWL_EventType::Mouse: { |
+ CFWL_EvtMouse* event = static_cast<CFWL_EvtMouse*>(pEvent); |
+ if (event->m_dwCmd == FWL_MouseCommand::Enter) { |
+ CXFA_EventParam eParam; |
+ eParam.m_eType = XFA_EVENT_MouseEnter; |
+ eParam.m_pTarget = m_pWidget->GetDataAcc(); |
+ m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_MouseEnter, |
+ &eParam); |
+ } else if (event->m_dwCmd == FWL_MouseCommand::Leave) { |
+ CXFA_EventParam eParam; |
+ eParam.m_eType = XFA_EVENT_MouseExit; |
+ eParam.m_pTarget = m_pWidget->GetDataAcc(); |
+ m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_MouseExit, |
+ &eParam); |
+ } else if (event->m_dwCmd == FWL_MouseCommand::LeftButtonDown) { |
+ CXFA_EventParam eParam; |
+ eParam.m_eType = XFA_EVENT_MouseDown; |
+ eParam.m_pTarget = m_pWidget->GetDataAcc(); |
+ m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_MouseDown, |
+ &eParam); |
+ } else if (event->m_dwCmd == FWL_MouseCommand::LeftButtonUp) { |
+ CXFA_EventParam eParam; |
+ eParam.m_eType = XFA_EVENT_MouseUp; |
+ eParam.m_pTarget = m_pWidget->GetDataAcc(); |
+ m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_MouseUp, |
+ &eParam); |
+ } |
+ break; |
+ } |
+ case CFWL_EventType::Click: { |
+ CXFA_EventParam eParam; |
+ eParam.m_eType = XFA_EVENT_Click; |
+ eParam.m_pTarget = m_pWidget->GetDataAcc(); |
+ m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); |
+ break; |
+ } |
+ default: |
+ break; |
+ } |
+} |
+ |
+void CXFA_FFFieldDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
+ const CFX_Matrix* pMatrix) {} |