summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_formfield.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-04-19 17:38:54 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-20 00:35:01 +0000
commit03f0fb0e650f134f31991b62e39c4d9a9d577560 (patch)
tree83235fd1bfba082f92f4648bbe16e8f120c1f574 /core/fpdfdoc/cpdf_formfield.h
parent7a68198438f41e19f21e06e0f3447e525d0b253b (diff)
downloadpdfium-03f0fb0e650f134f31991b62e39c4d9a9d577560.tar.xz
Remove the friends of CPDF_FormField
Added some public methods so that CPDF_FormField has no friends. Change-Id: I179537e3c6ea64cedaca5365010c34c1ad702c40 Reviewed-on: https://pdfium-review.googlesource.com/4370 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.h')
-rw-r--r--core/fpdfdoc/cpdf_formfield.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h
index 951d31c792..6ec7a5b414 100644
--- a/core/fpdfdoc/cpdf_formfield.h
+++ b/core/fpdfdoc/cpdf_formfield.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFDOC_CPDF_FORMFIELD_H_
#define CORE_FPDFDOC_CPDF_FORMFIELD_H_
+#include <memory>
+#include <utility>
#include <vector>
#include "core/fpdfdoc/cpdf_aaction.h"
@@ -35,7 +37,7 @@ class CPDF_FormControl;
class CPDF_InterForm;
class CPDF_String;
-CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict,
+CPDF_Object* FPDF_GetFieldAttr(const CPDF_Dictionary* pFieldDict,
const char* name,
int nLevel = 0);
CFX_WideString FPDF_GetFullName(CPDF_Dictionary* pFieldDict);
@@ -131,10 +133,20 @@ class CPDF_FormField {
float GetFontSize() const { return m_FontSize; }
CPDF_Font* GetFont() const { return m_pFont; }
- private:
- friend class CPDF_InterForm;
- friend class CPDF_FormControl;
+ const CPDF_Dictionary* GetDict() const { return m_pDict; }
+ const CPDF_InterForm* GetForm() const { return m_pForm; }
+
+ CFX_WideString GetCheckValue(bool bDefault) const;
+
+ void AddFormControl(CPDF_FormControl* pFormControl) {
+ m_ControlList.push_back(pFormControl);
+ }
+ void SetOpt(std::unique_ptr<CPDF_Object> pOpt) {
+ m_pDict->SetFor("Opt", std::move(pOpt));
+ }
+
+ private:
CFX_WideString GetValue(bool bDefault) const;
bool SetValue(const CFX_WideString& value, bool bDefault, bool bNotify);
@@ -143,7 +155,6 @@ class CPDF_FormField {
CFX_WideString GetOptionText(int index, int sub_index) const;
void LoadDA();
- CFX_WideString GetCheckValue(bool bDefault) const;
bool SetCheckValue(const CFX_WideString& value, bool bDefault, bool bNotify);
bool NotifyBeforeSelectionChange(const CFX_WideString& value);