blob: 2b089e51854edb7f24fdb7e9cc9b5e0f0c1dc646 [file] [log] [blame]
jaepark98e10192016-08-15 10:51:11 -07001// 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
dsinclair114e46a2016-09-29 17:18:21 -07007#include "fpdfsdk/cpdfsdk_annothandlermgr.h"
jaepark98e10192016-08-15 10:51:11 -07008
tsepez0e606b52016-11-18 16:22:41 -08009#include "core/fpdfapi/parser/cpdf_number.h"
10#include "core/fpdfapi/parser/cpdf_string.h"
dsinclair1727aee2016-09-29 13:12:56 -070011#include "core/fpdfdoc/cpdf_annot.h"
dsinclair114e46a2016-09-29 17:18:21 -070012#include "fpdfsdk/cba_annotiterator.h"
13#include "fpdfsdk/cpdfsdk_annot.h"
14#include "fpdfsdk/cpdfsdk_baannot.h"
15#include "fpdfsdk/cpdfsdk_baannothandler.h"
16#include "fpdfsdk/cpdfsdk_datetime.h"
dsinclair735606d2016-10-05 15:47:02 -070017#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
dsinclair114e46a2016-09-29 17:18:21 -070018#include "fpdfsdk/cpdfsdk_pageview.h"
19#include "fpdfsdk/cpdfsdk_widgethandler.h"
Tom Sepezfe91c6c2017-05-16 15:33:20 -070020#include "third_party/base/ptr_util.h"
jaepark98e10192016-08-15 10:51:11 -070021
22#ifdef PDF_ENABLE_XFA
dsinclair114e46a2016-09-29 17:18:21 -070023#include "fpdfsdk/cpdfsdk_xfawidgethandler.h"
dsinclair4d29e782016-10-04 14:02:47 -070024#include "fpdfsdk/fpdfxfa/cpdfxfa_page.h"
Dan Sinclair80c48782017-03-23 12:11:20 -040025#include "xfa/fxfa/cxfa_ffpageview.h"
26#include "xfa/fxfa/cxfa_ffwidget.h"
jaepark98e10192016-08-15 10:51:11 -070027#endif // PDF_ENABLE_XFA
28
dsinclair735606d2016-10-05 15:47:02 -070029CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr(
dsinclair8779fa82016-10-12 12:05:44 -070030 CPDFSDK_FormFillEnvironment* pFormFillEnv)
Tom Sepezfe91c6c2017-05-16 15:33:20 -070031 : m_pBAAnnotHandler(pdfium::MakeUnique<CPDFSDK_BAAnnotHandler>()),
32 m_pWidgetHandler(pdfium::MakeUnique<CPDFSDK_WidgetHandler>(pFormFillEnv)),
jaepark98e10192016-08-15 10:51:11 -070033#ifdef PDF_ENABLE_XFA
Tom Sepezfe91c6c2017-05-16 15:33:20 -070034 m_pXFAWidgetHandler(
35 pdfium::MakeUnique<CPDFSDK_XFAWidgetHandler>(pFormFillEnv)),
jaepark98e10192016-08-15 10:51:11 -070036#endif // PDF_ENABLE_XFA
dsinclair8779fa82016-10-12 12:05:44 -070037 m_pFormFillEnv(pFormFillEnv) {
38 m_pWidgetHandler->SetFormFiller(m_pFormFillEnv->GetInteractiveFormFiller());
jaepark98e10192016-08-15 10:51:11 -070039}
40
41CPDFSDK_AnnotHandlerMgr::~CPDFSDK_AnnotHandlerMgr() {}
42
jaepark98e10192016-08-15 10:51:11 -070043CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot* pAnnot,
44 CPDFSDK_PageView* pPageView) {
45 ASSERT(pPageView);
jaepark35512aa2016-08-29 17:15:08 -070046 return GetAnnotHandler(pAnnot->GetSubtype())->NewAnnot(pAnnot, pPageView);
jaepark98e10192016-08-15 10:51:11 -070047}
48
49#ifdef PDF_ENABLE_XFA
50CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CXFA_FFWidget* pAnnot,
51 CPDFSDK_PageView* pPageView) {
52 ASSERT(pAnnot);
53 ASSERT(pPageView);
54
jaepark956553e2016-08-31 06:49:27 -070055 return GetAnnotHandler(CPDF_Annot::Subtype::XFAWIDGET)
56 ->NewAnnot(pAnnot, pPageView);
jaepark98e10192016-08-15 10:51:11 -070057}
58#endif // PDF_ENABLE_XFA
59
60void CPDFSDK_AnnotHandlerMgr::ReleaseAnnot(CPDFSDK_Annot* pAnnot) {
jaepark35512aa2016-08-29 17:15:08 -070061 IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot);
jaepark35512aa2016-08-29 17:15:08 -070062 pAnnotHandler->ReleaseAnnot(pAnnot);
jaepark98e10192016-08-15 10:51:11 -070063}
64
65void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) {
66 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
67
68 CPDFSDK_DateTime curTime;
tsepez0e606b52016-11-18 16:22:41 -080069 pPDFAnnot->GetAnnotDict()->SetNewFor<CPDF_String>(
70 "M", curTime.ToPDFDateTimeString(), false);
71 pPDFAnnot->GetAnnotDict()->SetNewFor<CPDF_Number>("F", 0);
jaepark98e10192016-08-15 10:51:11 -070072}
73
74void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) {
75 ASSERT(pAnnot);
jaepark35512aa2016-08-29 17:15:08 -070076 GetAnnotHandler(pAnnot)->OnLoad(pAnnot);
jaepark98e10192016-08-15 10:51:11 -070077}
78
Diana Gagedce2d722017-06-20 11:17:11 -070079CFX_WideString CPDFSDK_AnnotHandlerMgr::Annot_GetSelectedText(
80 CPDFSDK_Annot* pAnnot) {
81 return GetAnnotHandler(pAnnot)->GetSelectedText(pAnnot);
82}
83
jaepark98e10192016-08-15 10:51:11 -070084IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(
85 CPDFSDK_Annot* pAnnot) const {
jaepark35512aa2016-08-29 17:15:08 -070086 return GetAnnotHandler(pAnnot->GetAnnotSubtype());
jaepark98e10192016-08-15 10:51:11 -070087}
88
89IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(
jaepark956553e2016-08-31 06:49:27 -070090 CPDF_Annot::Subtype nAnnotSubtype) const {
91 if (nAnnotSubtype == CPDF_Annot::Subtype::WIDGET)
jaepark8c541822016-08-30 13:43:05 -070092 return m_pWidgetHandler.get();
jaepark35512aa2016-08-29 17:15:08 -070093
94#ifdef PDF_ENABLE_XFA
jaepark956553e2016-08-31 06:49:27 -070095 if (nAnnotSubtype == CPDF_Annot::Subtype::XFAWIDGET)
jaepark8c541822016-08-30 13:43:05 -070096 return m_pXFAWidgetHandler.get();
jaepark35512aa2016-08-29 17:15:08 -070097#endif // PDF_ENABLE_XFA
98
99 return m_pBAAnnotHandler.get();
jaepark98e10192016-08-15 10:51:11 -0700100}
101
102void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView,
103 CPDFSDK_Annot* pAnnot,
104 CFX_RenderDevice* pDevice,
jaepark75f84a52016-09-09 15:39:09 -0700105 CFX_Matrix* pUser2Device,
106 bool bDrawAnnots) {
jaepark98e10192016-08-15 10:51:11 -0700107 ASSERT(pAnnot);
jaepark75f84a52016-09-09 15:39:09 -0700108 GetAnnotHandler(pAnnot)->OnDraw(pPageView, pAnnot, pDevice, pUser2Device,
109 bDrawAnnots);
jaepark98e10192016-08-15 10:51:11 -0700110}
111
tsepez4cf55152016-11-02 14:37:54 -0700112bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(
jaepark98e10192016-08-15 10:51:11 -0700113 CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -0700114 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark98e10192016-08-15 10:51:11 -0700115 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500116 const CFX_PointF& point) {
tsepezf8074ce2016-09-27 14:29:57 -0700117 ASSERT(*pAnnot);
118 return GetAnnotHandler(pAnnot->Get())
119 ->OnLButtonDown(pPageView, pAnnot, nFlags, point);
jaepark98e10192016-08-15 10:51:11 -0700120}
121
tsepez4cf55152016-11-02 14:37:54 -0700122bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(
jaepark98e10192016-08-15 10:51:11 -0700123 CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -0700124 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark98e10192016-08-15 10:51:11 -0700125 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500126 const CFX_PointF& point) {
tsepezf8074ce2016-09-27 14:29:57 -0700127 ASSERT(*pAnnot);
128 return GetAnnotHandler(pAnnot->Get())
129 ->OnLButtonUp(pPageView, pAnnot, nFlags, point);
jaepark98e10192016-08-15 10:51:11 -0700130}
131
tsepez4cf55152016-11-02 14:37:54 -0700132bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(
jaepark98e10192016-08-15 10:51:11 -0700133 CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -0700134 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark98e10192016-08-15 10:51:11 -0700135 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500136 const CFX_PointF& point) {
tsepezf8074ce2016-09-27 14:29:57 -0700137 ASSERT(*pAnnot);
138 return GetAnnotHandler(pAnnot->Get())
139 ->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
jaepark98e10192016-08-15 10:51:11 -0700140}
141
tsepez4cf55152016-11-02 14:37:54 -0700142bool CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(
jaepark98e10192016-08-15 10:51:11 -0700143 CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -0700144 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark98e10192016-08-15 10:51:11 -0700145 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500146 const CFX_PointF& point) {
tsepezf8074ce2016-09-27 14:29:57 -0700147 ASSERT(*pAnnot);
148 return GetAnnotHandler(pAnnot->Get())
149 ->OnMouseMove(pPageView, pAnnot, nFlags, point);
jaepark98e10192016-08-15 10:51:11 -0700150}
151
tsepez4cf55152016-11-02 14:37:54 -0700152bool CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(
jaepark98e10192016-08-15 10:51:11 -0700153 CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -0700154 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark98e10192016-08-15 10:51:11 -0700155 uint32_t nFlags,
156 short zDelta,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500157 const CFX_PointF& point) {
tsepezf8074ce2016-09-27 14:29:57 -0700158 ASSERT(*pAnnot);
159 return GetAnnotHandler(pAnnot->Get())
160 ->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, point);
jaepark98e10192016-08-15 10:51:11 -0700161}
162
tsepez4cf55152016-11-02 14:37:54 -0700163bool CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(
jaepark98e10192016-08-15 10:51:11 -0700164 CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -0700165 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark98e10192016-08-15 10:51:11 -0700166 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500167 const CFX_PointF& point) {
tsepezf8074ce2016-09-27 14:29:57 -0700168 ASSERT(*pAnnot);
169 return GetAnnotHandler(pAnnot->Get())
170 ->OnRButtonDown(pPageView, pAnnot, nFlags, point);
jaepark98e10192016-08-15 10:51:11 -0700171}
172
tsepez4cf55152016-11-02 14:37:54 -0700173bool CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(
jaepark98e10192016-08-15 10:51:11 -0700174 CPDFSDK_PageView* pPageView,
tsepezf8074ce2016-09-27 14:29:57 -0700175 CPDFSDK_Annot::ObservedPtr* pAnnot,
jaepark98e10192016-08-15 10:51:11 -0700176 uint32_t nFlags,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500177 const CFX_PointF& point) {
tsepezf8074ce2016-09-27 14:29:57 -0700178 ASSERT(*pAnnot);
179 return GetAnnotHandler(pAnnot->Get())
180 ->OnRButtonUp(pPageView, pAnnot, nFlags, point);
jaepark98e10192016-08-15 10:51:11 -0700181}
182
tsepezf8074ce2016-09-27 14:29:57 -0700183void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(
184 CPDFSDK_PageView* pPageView,
185 CPDFSDK_Annot::ObservedPtr* pAnnot,
186 uint32_t nFlag) {
187 ASSERT(*pAnnot);
188 GetAnnotHandler(pAnnot->Get())->OnMouseEnter(pPageView, pAnnot, nFlag);
jaepark98e10192016-08-15 10:51:11 -0700189}
190
tsepezf8074ce2016-09-27 14:29:57 -0700191void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(
192 CPDFSDK_PageView* pPageView,
193 CPDFSDK_Annot::ObservedPtr* pAnnot,
194 uint32_t nFlag) {
195 ASSERT(*pAnnot);
196 GetAnnotHandler(pAnnot->Get())->OnMouseExit(pPageView, pAnnot, nFlag);
jaepark98e10192016-08-15 10:51:11 -0700197}
198
tsepez4cf55152016-11-02 14:37:54 -0700199bool CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot,
200 uint32_t nChar,
201 uint32_t nFlags) {
jaepark35512aa2016-08-29 17:15:08 -0700202 return GetAnnotHandler(pAnnot)->OnChar(pAnnot, nChar, nFlags);
jaepark98e10192016-08-15 10:51:11 -0700203}
204
tsepez4cf55152016-11-02 14:37:54 -0700205bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot,
206 int nKeyCode,
207 int nFlag) {
dsinclair8779fa82016-10-12 12:05:44 -0700208 if (m_pFormFillEnv->IsCTRLKeyDown(nFlag) ||
thestig7b3252f2016-11-08 21:30:11 -0800209 m_pFormFillEnv->IsALTKeyDown(nFlag)) {
jaepark35512aa2016-08-29 17:15:08 -0700210 return GetAnnotHandler(pAnnot)->OnKeyDown(pAnnot, nKeyCode, nFlag);
thestig7b3252f2016-11-08 21:30:11 -0800211 }
jaepark98e10192016-08-15 10:51:11 -0700212
jaepark35512aa2016-08-29 17:15:08 -0700213 CPDFSDK_PageView* pPage = pAnnot->GetPageView();
214 CPDFSDK_Annot* pFocusAnnot = pPage->GetFocusAnnot();
215 if (pFocusAnnot && (nKeyCode == FWL_VKEY_Tab)) {
tsepezf8074ce2016-09-27 14:29:57 -0700216 CPDFSDK_Annot::ObservedPtr pNext(
dsinclair8779fa82016-10-12 12:05:44 -0700217 GetNextAnnot(pFocusAnnot, !m_pFormFillEnv->IsSHIFTKeyDown(nFlag)));
tsepezf8074ce2016-09-27 14:29:57 -0700218 if (pNext && pNext.Get() != pFocusAnnot) {
dsinclair7cbe68e2016-10-12 11:56:23 -0700219 pPage->GetFormFillEnv()->SetFocusAnnot(&pNext);
tsepez4cf55152016-11-02 14:37:54 -0700220 return true;
jaepark98e10192016-08-15 10:51:11 -0700221 }
222 }
223
thestig7b3252f2016-11-08 21:30:11 -0800224 return GetAnnotHandler(pAnnot)->OnKeyDown(pAnnot, nKeyCode, nFlag);
jaepark98e10192016-08-15 10:51:11 -0700225}
226
tsepez4cf55152016-11-02 14:37:54 -0700227bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot,
228 int nKeyCode,
229 int nFlag) {
230 return false;
jaepark98e10192016-08-15 10:51:11 -0700231}
232
tsepez4cf55152016-11-02 14:37:54 -0700233bool CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(
tsepezf8074ce2016-09-27 14:29:57 -0700234 CPDFSDK_Annot::ObservedPtr* pAnnot,
235 uint32_t nFlag) {
236 ASSERT(*pAnnot);
dsinclairb402b172016-10-11 09:26:32 -0700237 return GetAnnotHandler(pAnnot->Get())->OnSetFocus(pAnnot, nFlag);
jaepark98e10192016-08-15 10:51:11 -0700238}
239
tsepez4cf55152016-11-02 14:37:54 -0700240bool CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(
tsepezf8074ce2016-09-27 14:29:57 -0700241 CPDFSDK_Annot::ObservedPtr* pAnnot,
242 uint32_t nFlag) {
243 ASSERT(*pAnnot);
244 return GetAnnotHandler(pAnnot->Get())->OnKillFocus(pAnnot, nFlag);
jaepark98e10192016-08-15 10:51:11 -0700245}
246
247#ifdef PDF_ENABLE_XFA
tsepez4cf55152016-11-02 14:37:54 -0700248bool CPDFSDK_AnnotHandlerMgr::Annot_OnChangeFocus(
tsepezf8074ce2016-09-27 14:29:57 -0700249 CPDFSDK_Annot::ObservedPtr* pSetAnnot,
250 CPDFSDK_Annot::ObservedPtr* pKillAnnot) {
tsepez4cf55152016-11-02 14:37:54 -0700251 bool bXFA = (*pSetAnnot && (*pSetAnnot)->GetXFAWidget()) ||
252 (*pKillAnnot && (*pKillAnnot)->GetXFAWidget());
jaepark98e10192016-08-15 10:51:11 -0700253
254 if (bXFA) {
255 if (IPDFSDK_AnnotHandler* pXFAAnnotHandler =
jaepark956553e2016-08-31 06:49:27 -0700256 GetAnnotHandler(CPDF_Annot::Subtype::XFAWIDGET))
jaepark98e10192016-08-15 10:51:11 -0700257 return pXFAAnnotHandler->OnXFAChangedFocus(pKillAnnot, pSetAnnot);
258 }
259
tsepez4cf55152016-11-02 14:37:54 -0700260 return true;
jaepark98e10192016-08-15 10:51:11 -0700261}
262#endif // PDF_ENABLE_XFA
263
264CFX_FloatRect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox(
265 CPDFSDK_PageView* pPageView,
266 CPDFSDK_Annot* pAnnot) {
267 ASSERT(pAnnot);
jaepark35512aa2016-08-29 17:15:08 -0700268 return GetAnnotHandler(pAnnot)->GetViewBBox(pPageView, pAnnot);
jaepark98e10192016-08-15 10:51:11 -0700269}
270
tsepez4cf55152016-11-02 14:37:54 -0700271bool CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView* pPageView,
272 CPDFSDK_Annot* pAnnot,
Dan Sinclairf528eee2017-02-14 11:52:07 -0500273 const CFX_PointF& point) {
jaepark98e10192016-08-15 10:51:11 -0700274 ASSERT(pAnnot);
jaepark35512aa2016-08-29 17:15:08 -0700275 IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot);
276 if (pAnnotHandler->CanAnswer(pAnnot))
277 return pAnnotHandler->HitTest(pPageView, pAnnot, point);
278
tsepez4cf55152016-11-02 14:37:54 -0700279 return false;
jaepark98e10192016-08-15 10:51:11 -0700280}
281
282CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
tsepez4cf55152016-11-02 14:37:54 -0700283 bool bNext) {
jaepark98e10192016-08-15 10:51:11 -0700284#ifdef PDF_ENABLE_XFA
285 CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView();
286 CPDFXFA_Page* pPage = pPageView->GetPDFXFAPage();
287 if (!pPage)
288 return nullptr;
289 if (pPage->GetPDFPage()) { // for pdf annots.
jaepark9ed91372016-08-26 16:16:10 -0700290 CBA_AnnotIterator ai(pSDKAnnot->GetPageView(),
291 pSDKAnnot->GetAnnotSubtype());
jaepark98e10192016-08-15 10:51:11 -0700292 CPDFSDK_Annot* pNext =
293 bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
294 return pNext;
295 }
296 // for xfa annots
297 std::unique_ptr<IXFA_WidgetIterator> pWidgetIterator(
298 pPage->GetXFAPageView()->CreateWidgetIterator(
299 XFA_TRAVERSEWAY_Tranvalse, XFA_WidgetStatus_Visible |
300 XFA_WidgetStatus_Viewable |
301 XFA_WidgetStatus_Focused));
302 if (!pWidgetIterator)
303 return nullptr;
304 if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget())
305 pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget());
306 CXFA_FFWidget* hNextFocus =
307 bNext ? pWidgetIterator->MoveToNext() : pWidgetIterator->MoveToPrevious();
308 if (!hNextFocus && pSDKAnnot)
309 hNextFocus = pWidgetIterator->MoveToFirst();
310
311 return pPageView->GetAnnotByXFAWidget(hNextFocus);
312#else // PDF_ENABLE_XFA
jaepark956553e2016-08-31 06:49:27 -0700313 CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), CPDF_Annot::Subtype::WIDGET);
jaepark98e10192016-08-15 10:51:11 -0700314 return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
315#endif // PDF_ENABLE_XFA
316}