Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: xfa/fxfa/app/cxfa_fffielddelegate.cpp

Issue 2466273003: Change IFWL_Widget to store a single delegate. (Closed)
Patch Set: Fix Mac Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/app/cxfa_fffielddelegate.h ('k') | xfa/fxfa/app/cxfa_ffimageeditdelegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_fffielddelegate.h"
8
9 #include "xfa/fxfa/cxfa_eventparam.h"
10
11 CXFA_FFFieldDelegate::CXFA_FFFieldDelegate(
12 std::unique_ptr<IFWL_WidgetDelegate> pDelegate,
13 CXFA_FFField* pWidget)
14 : m_pDelegate(std::move(pDelegate)), m_pWidget(pWidget) {}
15
16 CXFA_FFFieldDelegate::~CXFA_FFFieldDelegate() {}
17
18 void CXFA_FFFieldDelegate::OnProcessMessage(CFWL_Message* pMessage) {}
19
20 void CXFA_FFFieldDelegate::OnProcessEvent(CFWL_Event* pEvent) {
21 switch (pEvent->GetClassID()) {
22 case CFWL_EventType::Mouse: {
23 CFWL_EvtMouse* event = static_cast<CFWL_EvtMouse*>(pEvent);
24 if (event->m_dwCmd == FWL_MouseCommand::Enter) {
25 CXFA_EventParam eParam;
26 eParam.m_eType = XFA_EVENT_MouseEnter;
27 eParam.m_pTarget = m_pWidget->GetDataAcc();
28 m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_MouseEnter,
29 &eParam);
30 } else if (event->m_dwCmd == FWL_MouseCommand::Leave) {
31 CXFA_EventParam eParam;
32 eParam.m_eType = XFA_EVENT_MouseExit;
33 eParam.m_pTarget = m_pWidget->GetDataAcc();
34 m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_MouseExit,
35 &eParam);
36 } else if (event->m_dwCmd == FWL_MouseCommand::LeftButtonDown) {
37 CXFA_EventParam eParam;
38 eParam.m_eType = XFA_EVENT_MouseDown;
39 eParam.m_pTarget = m_pWidget->GetDataAcc();
40 m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_MouseDown,
41 &eParam);
42 } else if (event->m_dwCmd == FWL_MouseCommand::LeftButtonUp) {
43 CXFA_EventParam eParam;
44 eParam.m_eType = XFA_EVENT_MouseUp;
45 eParam.m_pTarget = m_pWidget->GetDataAcc();
46 m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_MouseUp,
47 &eParam);
48 }
49 break;
50 }
51 case CFWL_EventType::Click: {
52 CXFA_EventParam eParam;
53 eParam.m_eType = XFA_EVENT_Click;
54 eParam.m_pTarget = m_pWidget->GetDataAcc();
55 m_pWidget->GetDataAcc()->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam);
56 break;
57 }
58 default:
59 break;
60 }
61 }
62
63 void CXFA_FFFieldDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
64 const CFX_Matrix* pMatrix) {}
OLDNEW
« no previous file with comments | « xfa/fxfa/app/cxfa_fffielddelegate.h ('k') | xfa/fxfa/app/cxfa_ffimageeditdelegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698