#include "core/fpdfdoc/cpdf_formfield.h"
#include <map>
#include <set>
#include <utility>
#include "constants/form_fields.h"
#include "constants/form_flags.h"
#include "core/fpdfapi/font/cpdf_font.h"
#include "core/fpdfapi/page/cpdf_docpagedata.h"
#include "core/fpdfapi/parser/cfdf_document.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fpdfapi/parser/fpdf_parser_utility.h"
#include "core/fpdfdoc/cpdf_defaultappearance.h"
#include "core/fpdfdoc/cpdf_formcontrol.h"
#include "core/fpdfdoc/cpdf_generateap.h"
#include "core/fpdfdoc/cpdf_interactiveform.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/containers/contains.h"
#include "core/fxcrt/stl_util.h"
namespace {
RetainPtr<const CPDF_Object> GetFieldAttrRecursive(
const CPDF_Dictionary* pFieldDict,
const ByteString& name,
int nLevel) { … }
bool IsComboOrListField(CPDF_FormField::Type type) { … }
bool HasOptField(CPDF_FormField::Type type) { … }
}
std::optional<FormFieldType> CPDF_FormField::IntToFormFieldType(int value) { … }
RetainPtr<const CPDF_Object> CPDF_FormField::GetFieldAttrForDict(
const CPDF_Dictionary* pFieldDict,
const ByteString& name) { … }
RetainPtr<CPDF_Object> CPDF_FormField::GetMutableFieldAttrForDict(
CPDF_Dictionary* pFieldDict,
const ByteString& name) { … }
WideString CPDF_FormField::GetFullNameForDict(
const CPDF_Dictionary* pFieldDict) { … }
CPDF_FormField::CPDF_FormField(CPDF_InteractiveForm* pForm,
RetainPtr<CPDF_Dictionary> pDict)
: … { … }
CPDF_FormField::~CPDF_FormField() = default;
void CPDF_FormField::InitFieldFlags() { … }
WideString CPDF_FormField::GetFullName() const { … }
RetainPtr<const CPDF_Object> CPDF_FormField::GetFieldAttr(
const ByteString& name) const { … }
RetainPtr<const CPDF_Dictionary> CPDF_FormField::GetFieldDict() const { … }
bool CPDF_FormField::ResetField() { … }
int CPDF_FormField::CountControls() const { … }
CPDF_FormControl* CPDF_FormField::GetControl(int index) const { … }
int CPDF_FormField::GetControlIndex(const CPDF_FormControl* pControl) const { … }
FormFieldType CPDF_FormField::GetFieldType() const { … }
CPDF_AAction CPDF_FormField::GetAdditionalAction() const { … }
WideString CPDF_FormField::GetAlternateName() const { … }
WideString CPDF_FormField::GetMappingName() const { … }
uint32_t CPDF_FormField::GetFieldFlags() const { … }
void CPDF_FormField::SetFieldFlags(uint32_t dwFlags) { … }
WideString CPDF_FormField::GetValue(bool bDefault) const { … }
WideString CPDF_FormField::GetValue() const { … }
WideString CPDF_FormField::GetDefaultValue() const { … }
bool CPDF_FormField::SetValue(const WideString& value,
bool bDefault,
NotificationOption notify) { … }
bool CPDF_FormField::SetValue(const WideString& value,
NotificationOption notify) { … }
int CPDF_FormField::GetMaxLen() const { … }
int CPDF_FormField::CountSelectedItems() const { … }
int CPDF_FormField::GetSelectedIndex(int index) const { … }
bool CPDF_FormField::ClearSelection(NotificationOption notify) { … }
bool CPDF_FormField::IsItemSelected(int index) const { … }
bool CPDF_FormField::SetItemSelection(int index, NotificationOption notify) { … }
void CPDF_FormField::SetItemSelectionSelected(int index,
const WideString& opt_value) { … }
int CPDF_FormField::GetDefaultSelectedItem() const { … }
int CPDF_FormField::CountOptions() const { … }
WideString CPDF_FormField::GetOptionText(int index, int sub_index) const { … }
WideString CPDF_FormField::GetOptionLabel(int index) const { … }
WideString CPDF_FormField::GetOptionValue(int index) const { … }
int CPDF_FormField::FindOption(const WideString& csOptValue) const { … }
bool CPDF_FormField::CheckControl(int iControlIndex,
bool bChecked,
NotificationOption notify) { … }
WideString CPDF_FormField::GetCheckValue(bool bDefault) const { … }
bool CPDF_FormField::SetCheckValue(const WideString& value,
bool bDefault,
NotificationOption notify) { … }
int CPDF_FormField::GetTopVisibleIndex() const { … }
int CPDF_FormField::CountSelectedOptions() const { … }
int CPDF_FormField::GetSelectedOptionIndex(int index) const { … }
bool CPDF_FormField::IsSelectedOption(const WideString& wsOptValue) const { … }
bool CPDF_FormField::IsSelectedIndex(int iOptIndex) const { … }
void CPDF_FormField::SelectOption(int iOptIndex) { … }
bool CPDF_FormField::UseSelectedIndicesObject() const { … }
bool CPDF_FormField::NotifyListOrComboBoxBeforeChange(const WideString& value) { … }
void CPDF_FormField::NotifyListOrComboBoxAfterChange() { … }
RetainPtr<const CPDF_Object> CPDF_FormField::GetFieldAttrInternal(
const ByteString& name) const { … }
const CPDF_Dictionary* CPDF_FormField::GetFieldDictInternal() const { … }
RetainPtr<const CPDF_Object> CPDF_FormField::GetDefaultValueObject() const { … }
RetainPtr<const CPDF_Object> CPDF_FormField::GetValueObject() const { … }
RetainPtr<const CPDF_Object> CPDF_FormField::GetSelectedIndicesObject() const { … }
RetainPtr<const CPDF_Object> CPDF_FormField::GetValueOrSelectedIndicesObject()
const { … }
const std::vector<UnownedPtr<CPDF_FormControl>>& CPDF_FormField::GetControls()
const { … }