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

Side by Side Diff: fpdfsdk/cpdfsdk_annothandlermgr.cpp

Issue 2410893002: Merge CPDFSDK_Document into CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 months 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
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/cpdfsdk_annothandlermgr.h" 7 #include "fpdfsdk/cpdfsdk_annothandlermgr.h"
8 8
9 #include "core/fpdfdoc/cpdf_annot.h" 9 #include "core/fpdfdoc/cpdf_annot.h"
10 #include "fpdfsdk/cba_annotiterator.h" 10 #include "fpdfsdk/cba_annotiterator.h"
11 #include "fpdfsdk/cpdfsdk_annot.h" 11 #include "fpdfsdk/cpdfsdk_annot.h"
12 #include "fpdfsdk/cpdfsdk_baannot.h" 12 #include "fpdfsdk/cpdfsdk_baannot.h"
13 #include "fpdfsdk/cpdfsdk_baannothandler.h" 13 #include "fpdfsdk/cpdfsdk_baannothandler.h"
14 #include "fpdfsdk/cpdfsdk_datetime.h" 14 #include "fpdfsdk/cpdfsdk_datetime.h"
15 #include "fpdfsdk/cpdfsdk_document.h"
16 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" 15 #include "fpdfsdk/cpdfsdk_formfillenvironment.h"
17 #include "fpdfsdk/cpdfsdk_pageview.h" 16 #include "fpdfsdk/cpdfsdk_pageview.h"
18 #include "fpdfsdk/cpdfsdk_widgethandler.h" 17 #include "fpdfsdk/cpdfsdk_widgethandler.h"
19 18
20 #ifdef PDF_ENABLE_XFA 19 #ifdef PDF_ENABLE_XFA
21 #include "fpdfsdk/cpdfsdk_xfawidgethandler.h" 20 #include "fpdfsdk/cpdfsdk_xfawidgethandler.h"
22 #include "fpdfsdk/fpdfxfa/cpdfxfa_page.h" 21 #include "fpdfsdk/fpdfxfa/cpdfxfa_page.h"
23 #include "xfa/fxfa/xfa_ffpageview.h" 22 #include "xfa/fxfa/xfa_ffpageview.h"
24 #include "xfa/fxfa/xfa_ffwidget.h" 23 #include "xfa/fxfa/xfa_ffwidget.h"
25 #endif // PDF_ENABLE_XFA 24 #endif // PDF_ENABLE_XFA
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 int nFlag) { 200 int nFlag) {
202 if (m_pEnv->IsCTRLKeyDown(nFlag) || m_pEnv->IsALTKeyDown(nFlag)) 201 if (m_pEnv->IsCTRLKeyDown(nFlag) || m_pEnv->IsALTKeyDown(nFlag))
203 return GetAnnotHandler(pAnnot)->OnKeyDown(pAnnot, nKeyCode, nFlag); 202 return GetAnnotHandler(pAnnot)->OnKeyDown(pAnnot, nKeyCode, nFlag);
204 203
205 CPDFSDK_PageView* pPage = pAnnot->GetPageView(); 204 CPDFSDK_PageView* pPage = pAnnot->GetPageView();
206 CPDFSDK_Annot* pFocusAnnot = pPage->GetFocusAnnot(); 205 CPDFSDK_Annot* pFocusAnnot = pPage->GetFocusAnnot();
207 if (pFocusAnnot && (nKeyCode == FWL_VKEY_Tab)) { 206 if (pFocusAnnot && (nKeyCode == FWL_VKEY_Tab)) {
208 CPDFSDK_Annot::ObservedPtr pNext( 207 CPDFSDK_Annot::ObservedPtr pNext(
209 GetNextAnnot(pFocusAnnot, !m_pEnv->IsSHIFTKeyDown(nFlag))); 208 GetNextAnnot(pFocusAnnot, !m_pEnv->IsSHIFTKeyDown(nFlag)));
210 if (pNext && pNext.Get() != pFocusAnnot) { 209 if (pNext && pNext.Get() != pFocusAnnot) {
211 pPage->GetFormFillEnv()->GetSDKDocument()->SetFocusAnnot(&pNext); 210 pPage->GetFormFillEnv()->SetFocusAnnot(&pNext);
212 return TRUE; 211 return TRUE;
213 } 212 }
214 } 213 }
215 214
216 return FALSE; 215 return FALSE;
217 } 216 }
218 217
219 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, 218 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot,
220 int nKeyCode, 219 int nKeyCode,
221 int nFlag) { 220 int nFlag) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 bNext ? pWidgetIterator->MoveToNext() : pWidgetIterator->MoveToPrevious(); 298 bNext ? pWidgetIterator->MoveToNext() : pWidgetIterator->MoveToPrevious();
300 if (!hNextFocus && pSDKAnnot) 299 if (!hNextFocus && pSDKAnnot)
301 hNextFocus = pWidgetIterator->MoveToFirst(); 300 hNextFocus = pWidgetIterator->MoveToFirst();
302 301
303 return pPageView->GetAnnotByXFAWidget(hNextFocus); 302 return pPageView->GetAnnotByXFAWidget(hNextFocus);
304 #else // PDF_ENABLE_XFA 303 #else // PDF_ENABLE_XFA
305 CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), CPDF_Annot::Subtype::WIDGET); 304 CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), CPDF_Annot::Subtype::WIDGET);
306 return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot); 305 return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
307 #endif // PDF_ENABLE_XFA 306 #endif // PDF_ENABLE_XFA
308 } 307 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698