OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/include/xfa_ffwidgethandler.h" | 7 #include "xfa/fxfa/include/xfa_ffwidgethandler.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 CFX_Matrix* pMatrix, | 180 CFX_Matrix* pMatrix, |
181 FX_BOOL bHighlight) { | 181 FX_BOOL bHighlight) { |
182 hWidget->RenderWidget(pGS, pMatrix, | 182 hWidget->RenderWidget(pGS, pMatrix, |
183 bHighlight ? XFA_WidgetStatus_Highlight : 0); | 183 bHighlight ? XFA_WidgetStatus_Highlight : 0); |
184 } | 184 } |
185 | 185 |
186 FX_BOOL CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, | 186 FX_BOOL CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, |
187 XFA_EVENTTYPE eEventType) { | 187 XFA_EVENTTYPE eEventType) { |
188 if (!pWidgetAcc || eEventType == XFA_EVENT_Unknown) | 188 if (!pWidgetAcc || eEventType == XFA_EVENT_Unknown) |
189 return FALSE; | 189 return FALSE; |
190 if (pWidgetAcc->GetClassID() == XFA_Element::Draw) | 190 if (pWidgetAcc->GetElementType() == XFA_Element::Draw) |
191 return FALSE; | 191 return FALSE; |
192 | 192 |
193 switch (eEventType) { | 193 switch (eEventType) { |
194 case XFA_EVENT_Calculate: { | 194 case XFA_EVENT_Calculate: { |
195 CXFA_Calculate calc = pWidgetAcc->GetCalculate(); | 195 CXFA_Calculate calc = pWidgetAcc->GetCalculate(); |
196 if (!calc) | 196 if (!calc) |
197 return FALSE; | 197 return FALSE; |
198 if (calc.GetScript()) | 198 if (calc.GetScript()) |
199 return TRUE; | 199 return TRUE; |
200 return FALSE; | 200 return FALSE; |
(...skipping 11 matching lines...) Expand all Loading... |
212 } | 212 } |
213 CXFA_NodeArray eventArray; | 213 CXFA_NodeArray eventArray; |
214 return pWidgetAcc->GetEventByActivity(gs_EventActivity[eEventType], | 214 return pWidgetAcc->GetEventByActivity(gs_EventActivity[eEventType], |
215 eventArray); | 215 eventArray); |
216 } | 216 } |
217 | 217 |
218 int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, | 218 int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, |
219 CXFA_EventParam* pParam) { | 219 CXFA_EventParam* pParam) { |
220 if (!pParam || pParam->m_eType == XFA_EVENT_Unknown) | 220 if (!pParam || pParam->m_eType == XFA_EVENT_Unknown) |
221 return XFA_EVENTERROR_NotExist; | 221 return XFA_EVENTERROR_NotExist; |
222 if (!pWidgetAcc || pWidgetAcc->GetClassID() == XFA_Element::Draw) | 222 if (!pWidgetAcc || pWidgetAcc->GetElementType() == XFA_Element::Draw) |
223 return XFA_EVENTERROR_NotExist; | 223 return XFA_EVENTERROR_NotExist; |
224 | 224 |
225 switch (pParam->m_eType) { | 225 switch (pParam->m_eType) { |
226 case XFA_EVENT_Calculate: | 226 case XFA_EVENT_Calculate: |
227 return pWidgetAcc->ProcessCalculate(); | 227 return pWidgetAcc->ProcessCalculate(); |
228 case XFA_EVENT_Validate: | 228 case XFA_EVENT_Validate: |
229 if (m_pDocView->GetDoc()->GetDocProvider()->IsValidationsEnabled( | 229 if (m_pDocView->GetDoc()->GetDocProvider()->IsValidationsEnabled( |
230 m_pDocView->GetDoc())) { | 230 m_pDocView->GetDoc())) { |
231 return pWidgetAcc->ProcessValidate(); | 231 return pWidgetAcc->ProcessValidate(); |
232 } | 232 } |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 } | 545 } |
546 | 546 |
547 CXFA_Document* CXFA_FFWidgetHandler::GetObjFactory() const { | 547 CXFA_Document* CXFA_FFWidgetHandler::GetObjFactory() const { |
548 return GetXFADoc()->GetParser()->GetFactory(); | 548 return GetXFADoc()->GetParser()->GetFactory(); |
549 } | 549 } |
550 | 550 |
551 CXFA_Document* CXFA_FFWidgetHandler::GetXFADoc() const { | 551 CXFA_Document* CXFA_FFWidgetHandler::GetXFADoc() const { |
552 return m_pDocView->GetDoc()->GetXFADoc(); | 552 return m_pDocView->GetDoc()->GetXFADoc(); |
553 } | 553 } |
554 | 554 |
OLD | NEW |