Use pdfium::Optional in CPDFSDK_Widget.

Also make some methods const.

Change-Id: Ie2d0f7e691ad9448b4e77227ce3c0b2b065e0da0
Reviewed-on: https://pdfium-review.googlesource.com/c/43602
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h
index 6ccfdfd..fb83ceb 100644
--- a/fpdfsdk/cpdfsdk_widget.h
+++ b/fpdfsdk/cpdfsdk_widget.h
@@ -17,6 +17,7 @@
 #include "core/fxge/cfx_color.h"
 #include "fpdfsdk/cpdfsdk_baannot.h"
 #include "fpdfsdk/cpdfsdk_fieldaction.h"
+#include "third_party/base/optional.h"
 
 class CFX_RenderDevice;
 class CPDF_Annot;
@@ -39,7 +40,7 @@
   CXFA_FFWidget* GetMixXFAWidget() const;
   CXFA_FFWidgetHandler* GetXFAWidgetHandler() const;
 
-  bool HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT);
+  bool HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT) const;
   bool OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
                     CPDFSDK_FieldAction* data,
                     CPDFSDK_PageView* pPageView);
@@ -62,9 +63,9 @@
   int GetFieldFlags() const;
   int GetRotate() const;
 
-  bool GetFillColor(FX_COLORREF& color) const;
-  bool GetBorderColor(FX_COLORREF& color) const;
-  bool GetTextColor(FX_COLORREF& color) const;
+  Optional<FX_COLORREF> GetFillColor() const;
+  Optional<FX_COLORREF> GetBorderColor() const;
+  Optional<FX_COLORREF> GetTextColor() const;
   float GetFontSize() const;
 
   int GetSelectedIndex(int nIndex) const;
@@ -127,7 +128,7 @@
 
  private:
 #ifdef PDF_ENABLE_XFA
-  CXFA_FFWidget* GetGroupMixXFAWidget();
+  CXFA_FFWidget* GetGroupMixXFAWidget() const;
   WideString GetName() const;
 #endif  // PDF_ENABLE_XFA