summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_formfield.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-16 20:53:58 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-16 20:53:58 +0000
commitb2e6b4c44a38ea2ca9e021df31cd27eb67a45e35 (patch)
tree8e9392c73c3905d38d9e9e636adf8df9c7af072e /core/fpdfdoc/cpdf_formfield.h
parentaa987a9a895d42749c0f5e4092618fe7ded6667e (diff)
downloadpdfium-b2e6b4c44a38ea2ca9e021df31cd27eb67a45e35.tar.xz
Replace optional bool bNotify with enum type.
Adds clarity to the call sites. Change-Id: Id4deed9adda2ad79f0847d618792429044d4f7d6 Reviewed-on: https://pdfium-review.googlesource.com/40351 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.h')
-rw-r--r--core/fpdfdoc/cpdf_formfield.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h
index 6f0006506f..7dc95e5809 100644
--- a/core/fpdfdoc/cpdf_formfield.h
+++ b/core/fpdfdoc/cpdf_formfield.h
@@ -12,12 +12,13 @@
#include <vector>
#include "core/fpdfdoc/cpdf_aaction.h"
-#include "core/fpdfdoc/cpdf_formfield.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/unowned_ptr.h"
#include "third_party/base/stl_util.h"
+enum class NotificationOption { kDoNotNotify = 0, kNotify };
+
enum class FormFieldType : uint8_t {
kUnknown = 0,
kPushButton = 1,
@@ -111,7 +112,7 @@ class CPDF_FormField {
CPDF_Dictionary* GetFieldDict() const { return m_pDict.Get(); }
void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; }
- bool ResetField(bool bNotify);
+ bool ResetField(NotificationOption notify);
int CountControls() const {
return pdfium::CollectionSize<int>(m_ControlList);
@@ -133,15 +134,15 @@ class CPDF_FormField {
WideString GetValue() const;
WideString GetDefaultValue() const;
- bool SetValue(const WideString& value, bool bNotify = false);
+ bool SetValue(const WideString& value, NotificationOption notify);
int GetMaxLen() const;
int CountSelectedItems() const;
int GetSelectedIndex(int index) const;
- bool ClearSelection(bool bNotify = false);
+ bool ClearSelection(NotificationOption notify);
bool IsItemSelected(int index) const;
- bool SetItemSelection(int index, bool bSelected, bool bNotify = false);
+ bool SetItemSelection(int index, bool bSelected, NotificationOption notify);
bool IsItemDefaultSelected(int index) const;
@@ -154,15 +155,17 @@ class CPDF_FormField {
int FindOption(WideString csOptLabel) const;
int FindOptionValue(const WideString& csOptValue) const;
- bool CheckControl(int iControlIndex, bool bChecked, bool bNotify = false);
+ bool CheckControl(int iControlIndex,
+ bool bChecked,
+ NotificationOption notify);
int GetTopVisibleIndex() const;
int CountSelectedOptions() const;
int GetSelectedOptionIndex(int index) const;
bool IsOptionSelected(int iOptIndex) const;
- bool SelectOption(int iOptIndex, bool bSelected, bool bNotify = false);
- bool ClearSelectedOptions(bool bNotify);
+ bool SelectOption(int iOptIndex, bool bSelected, NotificationOption notify);
+ bool ClearSelectedOptions(NotificationOption notify);
float GetFontSize() const { return m_FontSize; }
CPDF_Font* GetFont() const { return m_pFont.Get(); }
@@ -182,21 +185,20 @@ class CPDF_FormField {
private:
WideString GetValue(bool bDefault) const;
- bool SetValue(const WideString& value, bool bDefault, bool bNotify);
-
+ bool SetValue(const WideString& value,
+ bool bDefault,
+ NotificationOption notify);
void SyncFieldFlags();
int FindListSel(CPDF_String* str);
WideString GetOptionText(int index, int sub_index) const;
-
void LoadDA();
- bool SetCheckValue(const WideString& value, bool bDefault, bool bNotify);
-
+ bool SetCheckValue(const WideString& value,
+ bool bDefault,
+ NotificationOption notify);
bool NotifyBeforeSelectionChange(const WideString& value);
void NotifyAfterSelectionChange();
-
bool NotifyBeforeValueChange(const WideString& value);
void NotifyAfterValueChange();
-
bool NotifyListOrComboBoxBeforeChange(const WideString& value);
void NotifyListOrComboBoxAfterChange();