| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 7 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| 8 #define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 8 #define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 FX_DWORD GetFlags() { return m_Flags; } | 746 FX_DWORD GetFlags() { return m_Flags; } |
| 747 | 747 |
| 748 CPDF_Dictionary* GetFieldDict() const { return m_pDict; } | 748 CPDF_Dictionary* GetFieldDict() const { return m_pDict; } |
| 749 | 749 |
| 750 void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; } | 750 void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; } |
| 751 | 751 |
| 752 FX_BOOL ResetField(FX_BOOL bNotify = FALSE); | 752 FX_BOOL ResetField(FX_BOOL bNotify = FALSE); |
| 753 | 753 |
| 754 int CountControls() { return m_ControlList.GetSize(); } | 754 int CountControls() { return m_ControlList.GetSize(); } |
| 755 | 755 |
| 756 CPDF_FormControl* GetControl(int index) { | 756 CPDF_FormControl* GetControl(int index) { return m_ControlList.GetAt(index); } |
| 757 return (CPDF_FormControl*)m_ControlList.GetAt(index); | |
| 758 } | |
| 759 | 757 |
| 760 int GetControlIndex(const CPDF_FormControl* pControl); | 758 int GetControlIndex(const CPDF_FormControl* pControl); |
| 761 | 759 |
| 762 int GetFieldType(); | 760 int GetFieldType(); |
| 763 | 761 |
| 764 CPDF_AAction GetAdditionalAction(); | 762 CPDF_AAction GetAdditionalAction(); |
| 765 | 763 |
| 766 CFX_WideString GetAlternateName(); | 764 CFX_WideString GetAlternateName(); |
| 767 | 765 |
| 768 CFX_WideString GetMappingName(); | 766 CFX_WideString GetMappingName(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 int index = -1, | 830 int index = -1, |
| 833 FX_BOOL bNotify = FALSE); | 831 FX_BOOL bNotify = FALSE); |
| 834 #endif // PDF_ENABLE_XFA | 832 #endif // PDF_ENABLE_XFA |
| 835 | 833 |
| 836 FX_FLOAT GetFontSize() { return m_FontSize; } | 834 FX_FLOAT GetFontSize() { return m_FontSize; } |
| 837 | 835 |
| 838 CPDF_Font* GetFont() { return m_pFont; } | 836 CPDF_Font* GetFont() { return m_pFont; } |
| 839 | 837 |
| 840 protected: | 838 protected: |
| 841 CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict); | 839 CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict); |
| 842 | |
| 843 ~CPDF_FormField(); | 840 ~CPDF_FormField(); |
| 844 | 841 |
| 845 CPDF_FormField::Type m_Type; | |
| 846 | |
| 847 FX_DWORD m_Flags; | |
| 848 | |
| 849 CPDF_InterForm* m_pForm; | |
| 850 | |
| 851 CPDF_Dictionary* m_pDict; | |
| 852 | |
| 853 CFX_PtrArray m_ControlList; | |
| 854 friend class CPDF_InterForm; | |
| 855 friend class CPDF_FormControl; | |
| 856 | |
| 857 CFX_WideString GetValue(FX_BOOL bDefault); | 842 CFX_WideString GetValue(FX_BOOL bDefault); |
| 858 | 843 |
| 859 FX_BOOL SetValue(const CFX_WideString& value, | 844 FX_BOOL SetValue(const CFX_WideString& value, |
| 860 FX_BOOL bDefault, | 845 FX_BOOL bDefault, |
| 861 FX_BOOL bNotify); | 846 FX_BOOL bNotify); |
| 862 | 847 |
| 863 void SyncFieldFlags(); | 848 void SyncFieldFlags(); |
| 864 | 849 |
| 865 int FindListSel(CPDF_String* str); | 850 int FindListSel(CPDF_String* str); |
| 866 | 851 |
| 867 CFX_WideString GetOptionText(int index, int sub_index); | 852 CFX_WideString GetOptionText(int index, int sub_index); |
| 868 | 853 |
| 869 void LoadDA(); | 854 void LoadDA(); |
| 870 | 855 |
| 871 void UpdateAP(CPDF_FormControl* pControl); | 856 void UpdateAP(CPDF_FormControl* pControl); |
| 872 | 857 |
| 873 CFX_WideString GetCheckValue(FX_BOOL bDefault); | 858 CFX_WideString GetCheckValue(FX_BOOL bDefault); |
| 874 | 859 |
| 875 FX_BOOL SetCheckValue(const CFX_WideString& value, | 860 FX_BOOL SetCheckValue(const CFX_WideString& value, |
| 876 FX_BOOL bDefault, | 861 FX_BOOL bDefault, |
| 877 FX_BOOL bNotify); | 862 FX_BOOL bNotify); |
| 878 | 863 |
| 864 CPDF_FormField::Type m_Type; |
| 865 FX_DWORD m_Flags; |
| 866 CPDF_InterForm* m_pForm; |
| 867 CPDF_Dictionary* m_pDict; |
| 868 CFX_ArrayTemplate<CPDF_FormControl*> m_ControlList; |
| 879 FX_FLOAT m_FontSize; | 869 FX_FLOAT m_FontSize; |
| 870 CPDF_Font* m_pFont; |
| 880 | 871 |
| 881 CPDF_Font* m_pFont; | 872 friend class CPDF_InterForm; |
| 873 friend class CPDF_FormControl; |
| 882 }; | 874 }; |
| 883 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, | 875 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, |
| 884 const FX_CHAR* name, | 876 const FX_CHAR* name, |
| 885 int nLevel = 0); | 877 int nLevel = 0); |
| 886 class CPDF_IconFit { | 878 class CPDF_IconFit { |
| 887 public: | 879 public: |
| 888 // TODO(thestig): Examine why this cannot be explicit. | 880 // TODO(thestig): Examine why this cannot be explicit. |
| 889 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 881 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
| 890 | 882 |
| 891 operator CPDF_Dictionary*() const { return m_pDict; } | 883 operator CPDF_Dictionary*() const { return m_pDict; } |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry) const; | 1157 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry) const; |
| 1166 | 1158 |
| 1167 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry) const; | 1159 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry) const; |
| 1168 | 1160 |
| 1169 CPDF_Dictionary* const m_pDict; | 1161 CPDF_Dictionary* const m_pDict; |
| 1170 }; | 1162 }; |
| 1171 | 1163 |
| 1172 CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath); | 1164 CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath); |
| 1173 | 1165 |
| 1174 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 1166 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| OLD | NEW |