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 "fpdfsdk/include/formfiller/FFL_CheckBox.h" | 7 #include "fpdfsdk/include/formfiller/FFL_CheckBox.h" |
8 #include "fpdfsdk/include/formfiller/FFL_ComboBox.h" | 8 #include "fpdfsdk/include/formfiller/FFL_ComboBox.h" |
9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" | 9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
10 #include "fpdfsdk/include/formfiller/FFL_IFormFiller.h" | 10 #include "fpdfsdk/include/formfiller/FFL_IFormFiller.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 270 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
271 bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); | 271 bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); |
272 } | 272 } |
273 | 273 |
274 if (pDocument->GetFocusAnnot() == pAnnot) { | 274 if (pDocument->GetFocusAnnot() == pAnnot) { |
275 FX_BOOL bExit = FALSE; | 275 FX_BOOL bExit = FALSE; |
276 FX_BOOL bReset = FALSE; | 276 FX_BOOL bReset = FALSE; |
277 OnButtonUp(pWidget, pPageView, bReset, bExit, nFlags); | 277 OnButtonUp(pWidget, pPageView, bReset, bExit, nFlags); |
278 if (bExit) | 278 if (bExit) |
279 return TRUE; | 279 return TRUE; |
| 280 #ifdef PDF_ENABLE_XFA |
280 | 281 |
281 OnClick(pWidget, pPageView, bReset, bExit, nFlags); | 282 OnClick(pWidget, pPageView, bReset, bExit, nFlags); |
282 if (bExit) | 283 if (bExit) |
283 return TRUE; | 284 return TRUE; |
| 285 #endif |
284 } | 286 } |
285 return bRet; | 287 return bRet; |
286 } | 288 } |
287 | 289 |
288 void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, | 290 void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, |
289 CPDFSDK_PageView* pPageView, | 291 CPDFSDK_PageView* pPageView, |
290 FX_BOOL& bReset, | 292 FX_BOOL& bReset, |
291 FX_BOOL& bExit, | 293 FX_BOOL& bExit, |
292 FX_UINT nFlag) { | 294 FX_UINT nFlag) { |
293 ASSERT(pWidget != NULL); | 295 ASSERT(pWidget != NULL); |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 if (bFormated) { | 791 if (bFormated) { |
790 pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), | 792 pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), |
791 TRUE); | 793 TRUE); |
792 pInterForm->UpdateField(pWidget->GetFormField()); | 794 pInterForm->UpdateField(pWidget->GetFormField()); |
793 } | 795 } |
794 | 796 |
795 m_bNotifying = FALSE; | 797 m_bNotifying = FALSE; |
796 } | 798 } |
797 } | 799 } |
798 | 800 |
| 801 #ifdef PDF_ENABLE_XFA |
799 void CFFL_IFormFiller::OnClick(CPDFSDK_Widget* pWidget, | 802 void CFFL_IFormFiller::OnClick(CPDFSDK_Widget* pWidget, |
800 CPDFSDK_PageView* pPageView, | 803 CPDFSDK_PageView* pPageView, |
801 FX_BOOL& bReset, | 804 FX_BOOL& bReset, |
802 FX_BOOL& bExit, | 805 FX_BOOL& bExit, |
803 FX_UINT nFlag) { | 806 FX_UINT nFlag) { |
804 ASSERT(pWidget != NULL); | 807 ASSERT(pWidget != NULL); |
805 | 808 |
806 if (!m_bNotifying) { | 809 if (!m_bNotifying) { |
807 if (pWidget->HasXFAAAction(PDFSDK_XFA_Click)) { | 810 if (pWidget->HasXFAAAction(PDFSDK_XFA_Click)) { |
808 m_bNotifying = TRUE; | 811 m_bNotifying = TRUE; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 pFormFiller->ResetPDFWindow(pPageView, | 974 pFormFiller->ResetPDFWindow(pPageView, |
972 nValueAge == pWidget->GetValueAge()); | 975 nValueAge == pWidget->GetValueAge()); |
973 } | 976 } |
974 | 977 |
975 bReset = TRUE; | 978 bReset = TRUE; |
976 } | 979 } |
977 } | 980 } |
978 } | 981 } |
979 } | 982 } |
980 | 983 |
| 984 #endif |
981 FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, | 985 FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, |
982 CPDFSDK_Annot* pAnnot) { | 986 CPDFSDK_Annot* pAnnot) { |
983 if (pPageView) | 987 if (pPageView) |
984 return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot()); | 988 return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot()); |
985 | 989 |
986 return FALSE; | 990 return FALSE; |
987 } | 991 } |
988 | 992 |
989 void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData, | 993 void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData, |
990 CFX_WideString& strChange, | 994 CFX_WideString& strChange, |
991 const CFX_WideString& strChangeEx, | 995 const CFX_WideString& strChangeEx, |
992 int nSelStart, | 996 int nSelStart, |
993 int nSelEnd, | 997 int nSelEnd, |
994 FX_BOOL bKeyDown, | 998 FX_BOOL bKeyDown, |
995 FX_BOOL& bRC, | 999 FX_BOOL& bRC, |
996 FX_BOOL& bExit, | 1000 FX_BOOL& bExit, |
997 FX_DWORD nFlag) { | 1001 FX_DWORD nFlag) { |
998 ASSERT(pPrivateData != NULL); | 1002 ASSERT(pPrivateData != NULL); |
999 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; | 1003 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; |
1000 ASSERT(pData->pWidget != NULL); | 1004 ASSERT(pData->pWidget != NULL); |
1001 | 1005 |
1002 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); | 1006 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); |
1003 ASSERT(pFormFiller != NULL); | 1007 ASSERT(pFormFiller != NULL); |
1004 | 1008 |
| 1009 #ifdef PDF_ENABLE_XFA |
1005 if (pFormFiller->IsFieldFull(pData->pPageView)) { | 1010 if (pFormFiller->IsFieldFull(pData->pPageView)) { |
1006 FX_BOOL bFullExit = FALSE; | 1011 FX_BOOL bFullExit = FALSE; |
1007 FX_BOOL bFullReset = FALSE; | 1012 FX_BOOL bFullReset = FALSE; |
1008 OnFull(pData->pWidget, pData->pPageView, bFullReset, bFullExit, nFlag); | 1013 OnFull(pData->pWidget, pData->pPageView, bFullReset, bFullExit, nFlag); |
1009 | 1014 |
1010 if (bFullReset || bFullExit) { | 1015 if (bFullReset || bFullExit) { |
1011 bExit = TRUE; | 1016 bExit = TRUE; |
1012 return; | 1017 return; |
1013 } | 1018 } |
1014 } | 1019 } |
1015 | 1020 |
| 1021 #endif |
1016 if (!m_bNotifying) { | 1022 if (!m_bNotifying) { |
1017 if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke)) { | 1023 if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke)) { |
1018 m_bNotifying = TRUE; | 1024 m_bNotifying = TRUE; |
1019 int nAge = pData->pWidget->GetAppearanceAge(); | 1025 int nAge = pData->pWidget->GetAppearanceAge(); |
1020 int nValueAge = pData->pWidget->GetValueAge(); | 1026 int nValueAge = pData->pWidget->GetValueAge(); |
1021 | 1027 |
1022 ASSERT(pData->pPageView != NULL); | 1028 ASSERT(pData->pPageView != NULL); |
1023 CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument(); | 1029 CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument(); |
1024 | 1030 |
1025 PDFSDK_FieldAction fa; | 1031 PDFSDK_FieldAction fa; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 bExit = TRUE; | 1075 bExit = TRUE; |
1070 m_bNotifying = FALSE; | 1076 m_bNotifying = FALSE; |
1071 return; | 1077 return; |
1072 } | 1078 } |
1073 } | 1079 } |
1074 | 1080 |
1075 m_bNotifying = FALSE; | 1081 m_bNotifying = FALSE; |
1076 } | 1082 } |
1077 } | 1083 } |
1078 } | 1084 } |
OLD | NEW |