Handle null annot case outside of CPDFSDK_AnnotHandlerMgr.

The work done by CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown() when the
annot argument is null is better handled by the pageview itself before
calling into the CPDFSDK_AnnotHandlerMgr. This makes the annot handler
manager simpler because it doesn't have to call back into the page view
to find an annot. Instead, it performs a single purpose: dispatching
based on the kind of annot it sees.

-- Remove some stray includes.
-- Use incomplete types in .cpp where sufficient.
-- Consistent naming of NewAnnotForXFA() (vs NewXFAAnnot()).
-- Make XFAPageIfNotBackedByPDFPage() a method of the page view.
-- Remove some specific subclass information from handler mgr, and use
   the virtual interface to ensure uniformity among handler calls,
   despite introducing some notreached stubs.

Change-Id: I4d68cba6035cbb25d003fda96afe3dd91ed2b6fc
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/85190
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_pageview.h b/fpdfsdk/cpdfsdk_pageview.h
index 10df234..da074aa 100644
--- a/fpdfsdk/cpdfsdk_pageview.h
+++ b/fpdfsdk/cpdfsdk_pageview.h
@@ -25,6 +25,11 @@
 class CPDFSDK_FormFillEnvironment;
 class CPDFSDK_InteractiveForm;
 
+#ifdef PDF_ENABLE_XFA
+class CPDFXFA_Page;
+class CXFA_FFWidget;
+#endif  // PDF_ENABLE_XFA
+
 class CPDFSDK_PageView final : public CPDF_Page::View {
  public:
   CPDFSDK_PageView(CPDFSDK_FormFillEnvironment* pFormFillEnv, IPDF_Page* page);
@@ -37,6 +42,10 @@
 
   void LoadFXAnnots();
   CPDFSDK_Annot* GetFocusAnnot();
+  CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot);
+  CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot);
+  CPDFSDK_Annot* GetFirstFocusableAnnot();
+  CPDFSDK_Annot* GetLastFocusableAnnot();
   bool IsValidAnnot(const CPDF_Annot* p) const;
   bool IsValidSDKAnnot(const CPDFSDK_Annot* p) const;
 
@@ -100,6 +109,10 @@
   void TakePageOwnership() { m_pOwnsPage.Reset(ToPDFPage(m_page)); }
 
  private:
+#ifdef PDF_ENABLE_XFA
+  CPDFXFA_Page* XFAPageIfNotBackedByPDFPage();
+#endif
+
   CPDFSDK_Annot* GetFXAnnotAtPoint(const CFX_PointF& point);
   CPDFSDK_Annot* GetFXWidgetAtPoint(const CFX_PointF& point);