Split XFA_FFWidgetType into its own header file.

So cxfa_node.h does not need to include cxfa_ffwidget.h, which then
drags in many other headers. Fix up code that are missing includes.

Change-Id: If4f0c72311f17cca3597c07451aa9851117acd62
Reviewed-on: https://pdfium-review.googlesource.com/c/49390
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/xfa/cjx_hostpseudomodel.cpp b/fxjs/xfa/cjx_hostpseudomodel.cpp
index ab132b5..bf88583 100644
--- a/fxjs/xfa/cjx_hostpseudomodel.cpp
+++ b/fxjs/xfa/cjx_hostpseudomodel.cpp
@@ -14,6 +14,7 @@
 #include "fxjs/xfa/cfxjse_value.h"
 #include "xfa/fxfa/cxfa_ffdoc.h"
 #include "xfa/fxfa/cxfa_ffnotify.h"
+#include "xfa/fxfa/cxfa_ffwidget.h"
 #include "xfa/fxfa/parser/cscript_hostpseudomodel.h"
 #include "xfa/fxfa/parser/cxfa_layoutprocessor.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
diff --git a/fxjs/xfa/cjx_layoutpseudomodel.cpp b/fxjs/xfa/cjx_layoutpseudomodel.cpp
index 7ade3b4..3957117 100644
--- a/fxjs/xfa/cjx_layoutpseudomodel.cpp
+++ b/fxjs/xfa/cjx_layoutpseudomodel.cpp
@@ -20,6 +20,7 @@
 #include "xfa/fxfa/parser/cscript_layoutpseudomodel.h"
 #include "xfa/fxfa/parser/cxfa_arraynodelist.h"
 #include "xfa/fxfa/parser/cxfa_containerlayoutitem.h"
+#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_form.h"
 #include "xfa/fxfa/parser/cxfa_layoutitem.h"
diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h
index ecb8acd..7ed3d88 100644
--- a/xfa/fxfa/cxfa_ffwidget.h
+++ b/xfa/fxfa/cxfa_ffwidget.h
@@ -61,27 +61,6 @@
   int32_t m_iRefCount;
 };
 
-enum class XFA_FFWidgetType {
-  kNone = 0,
-  kBarcode,
-  kButton,
-  kCheckButton,
-  kChoiceList,
-  kDateTimeEdit,
-  kImageEdit,
-  kNumericEdit,
-  kPasswordEdit,
-  kSignature,
-  kTextEdit,
-  kArc,
-  kLine,
-  kRectangle,
-  kText,
-  kImage,
-  kSubform,
-  kExclGroup
-};
-
 class CXFA_FFWidget : public CXFA_ContentLayoutItem {
  public:
   enum FocusOption { kDoNotDrawFocus = 0, kDrawFocus };
diff --git a/xfa/fxfa/cxfa_ffwidget_type.h b/xfa/fxfa/cxfa_ffwidget_type.h
new file mode 100644
index 0000000..69fbcd2
--- /dev/null
+++ b/xfa/fxfa/cxfa_ffwidget_type.h
@@ -0,0 +1,31 @@
+// Copyright 2019 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_FXFA_CXFA_FFWIDGET_TYPE_H_
+#define XFA_FXFA_CXFA_FFWIDGET_TYPE_H_
+
+enum class XFA_FFWidgetType {
+  kNone = 0,
+  kBarcode,
+  kButton,
+  kCheckButton,
+  kChoiceList,
+  kDateTimeEdit,
+  kImageEdit,
+  kNumericEdit,
+  kPasswordEdit,
+  kSignature,
+  kTextEdit,
+  kArc,
+  kLine,
+  kRectangle,
+  kText,
+  kImage,
+  kSubform,
+  kExclGroup
+};
+
+#endif  // XFA_FXFA_CXFA_FFWIDGET_TYPE_H_
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index 405a5d5..a89a69f 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -15,7 +15,7 @@
 #include "core/fxge/fx_dib.h"
 #include "third_party/base/optional.h"
 #include "third_party/base/span.h"
-#include "xfa/fxfa/cxfa_ffwidget.h"
+#include "xfa/fxfa/cxfa_ffwidget_type.h"
 #include "xfa/fxfa/parser/cxfa_object.h"
 
 class CFGAS_GEFont;
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index c63a8e2..052680a 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -6,6 +6,7 @@
 
 #include "xfa/fxfa/parser/xfa_document_datamerger_imp.h"
 
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 
 bool XFA_DataMerge_NeedGenerateForm(CXFA_Node* pTemplateChild,