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/app/xfa_ffnotify.h" | 7 #include "xfa/fxfa/app/xfa_ffnotify.h" |
8 | 8 |
9 #include "fxjse/include/cfxjse_value.h" | 9 #include "fxjse/include/cfxjse_value.h" |
10 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 10 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 XFA_EVENTTYPE eEventType, | 214 XFA_EVENTTYPE eEventType, |
215 FX_BOOL bIsFormReady, | 215 FX_BOOL bIsFormReady, |
216 FX_BOOL bRecursive, | 216 FX_BOOL bRecursive, |
217 CXFA_WidgetAcc* pExclude) { | 217 CXFA_WidgetAcc* pExclude) { |
218 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 218 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
219 if (!pDocView) { | 219 if (!pDocView) { |
220 return XFA_EVENTERROR_NotExist; | 220 return XFA_EVENTERROR_NotExist; |
221 } | 221 } |
222 return pDocView->ExecEventActivityByDeepFirst( | 222 return pDocView->ExecEventActivityByDeepFirst( |
223 pFormNode, eEventType, bIsFormReady, bRecursive, | 223 pFormNode, eEventType, bIsFormReady, bRecursive, |
224 pExclude ? pExclude->GetNode() : NULL); | 224 pExclude ? pExclude->GetNode() : nullptr); |
225 } | 225 } |
226 void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode) { | 226 void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode) { |
227 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 227 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
228 if (!pDocView) { | 228 if (!pDocView) { |
229 return; | 229 return; |
230 } | 230 } |
231 CXFA_WidgetAcc* pWidgetAcc = | 231 CXFA_WidgetAcc* pWidgetAcc = |
232 static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); | 232 static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); |
233 if (!pWidgetAcc) { | 233 if (!pWidgetAcc) { |
234 return; | 234 return; |
235 } | 235 } |
236 pDocView->AddCalculateWidgetAcc(pWidgetAcc); | 236 pDocView->AddCalculateWidgetAcc(pWidgetAcc); |
237 pDocView->AddValidateWidget(pWidgetAcc); | 237 pDocView->AddValidateWidget(pWidgetAcc); |
238 } | 238 } |
239 CXFA_FFDoc* CXFA_FFNotify::GetHDOC() { | 239 CXFA_FFDoc* CXFA_FFNotify::GetHDOC() { |
240 return m_pDoc; | 240 return m_pDoc; |
241 } | 241 } |
242 IXFA_DocProvider* CXFA_FFNotify::GetDocProvider() { | 242 IXFA_DocProvider* CXFA_FFNotify::GetDocProvider() { |
243 return m_pDoc->GetDocProvider(); | 243 return m_pDoc->GetDocProvider(); |
244 } | 244 } |
245 IXFA_AppProvider* CXFA_FFNotify::GetAppProvider() { | 245 IXFA_AppProvider* CXFA_FFNotify::GetAppProvider() { |
246 return m_pDoc->GetApp()->GetAppProvider(); | 246 return m_pDoc->GetApp()->GetAppProvider(); |
247 } | 247 } |
248 CXFA_FFWidgetHandler* CXFA_FFNotify::GetWidgetHandler() { | 248 CXFA_FFWidgetHandler* CXFA_FFNotify::GetWidgetHandler() { |
249 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 249 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
250 return pDocView ? pDocView->GetWidgetHandler() : NULL; | 250 return pDocView ? pDocView->GetWidgetHandler() : nullptr; |
251 } | 251 } |
252 CXFA_FFWidget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem) { | 252 CXFA_FFWidget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem) { |
253 return XFA_GetWidgetFromLayoutItem(pLayoutItem); | 253 return XFA_GetWidgetFromLayoutItem(pLayoutItem); |
254 } | 254 } |
255 void CXFA_FFNotify::OpenDropDownList(CXFA_FFWidget* hWidget) { | 255 void CXFA_FFNotify::OpenDropDownList(CXFA_FFWidget* hWidget) { |
256 if (hWidget->GetDataAcc()->GetUIType() != XFA_Element::ChoiceList) { | 256 if (hWidget->GetDataAcc()->GetUIType() != XFA_Element::ChoiceList) { |
257 return; | 257 return; |
258 } | 258 } |
259 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 259 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
260 pDocView->LockUpdate(); | 260 pDocView->LockUpdate(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 void CXFA_FFNotify::RunSubformIndexChange(CXFA_Node* pSubformNode) { | 292 void CXFA_FFNotify::RunSubformIndexChange(CXFA_Node* pSubformNode) { |
293 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 293 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
294 if (!pDocView) { | 294 if (!pDocView) { |
295 return; | 295 return; |
296 } | 296 } |
297 pDocView->AddIndexChangedSubform(pSubformNode); | 297 pDocView->AddIndexChangedSubform(pSubformNode); |
298 } | 298 } |
299 CXFA_Node* CXFA_FFNotify::GetFocusWidgetNode() { | 299 CXFA_Node* CXFA_FFNotify::GetFocusWidgetNode() { |
300 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 300 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
301 if (!pDocView) { | 301 if (!pDocView) { |
302 return NULL; | 302 return nullptr; |
303 } | 303 } |
304 CXFA_WidgetAcc* pAcc = pDocView->GetFocusWidgetAcc(); | 304 CXFA_WidgetAcc* pAcc = pDocView->GetFocusWidgetAcc(); |
305 return pAcc ? pAcc->GetNode() : NULL; | 305 return pAcc ? pAcc->GetNode() : nullptr; |
306 } | 306 } |
307 void CXFA_FFNotify::SetFocusWidgetNode(CXFA_Node* pNode) { | 307 void CXFA_FFNotify::SetFocusWidgetNode(CXFA_Node* pNode) { |
308 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 308 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
309 if (!pDocView) { | 309 if (!pDocView) { |
310 return; | 310 return; |
311 } | 311 } |
312 CXFA_WidgetAcc* pAcc = | 312 CXFA_WidgetAcc* pAcc = |
313 pNode ? static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()) : nullptr; | 313 pNode ? static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()) : nullptr; |
314 pDocView->SetFocusWidgetAcc(pAcc); | 314 pDocView->SetFocusWidgetAcc(pAcc); |
315 } | 315 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 return; | 505 return; |
506 | 506 |
507 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); | 507 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); |
508 if (!pWidget) | 508 if (!pWidget) |
509 return; | 509 return; |
510 | 510 |
511 pDocView->DeleteLayoutItem(pWidget); | 511 pDocView->DeleteLayoutItem(pWidget); |
512 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); | 512 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); |
513 pWidget->AddInvalidateRect(nullptr); | 513 pWidget->AddInvalidateRect(nullptr); |
514 } | 514 } |
OLD | NEW |