| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 FX_BOOL bNotify = FALSE); | 822 FX_BOOL bNotify = FALSE); |
| 825 | 823 |
| 826 FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE); | 824 FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE); |
| 827 | 825 |
| 828 FX_FLOAT GetFontSize() { return m_FontSize; } | 826 FX_FLOAT GetFontSize() { return m_FontSize; } |
| 829 | 827 |
| 830 CPDF_Font* GetFont() { return m_pFont; } | 828 CPDF_Font* GetFont() { return m_pFont; } |
| 831 | 829 |
| 832 protected: | 830 protected: |
| 833 CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict); | 831 CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict); |
| 834 | |
| 835 ~CPDF_FormField(); | 832 ~CPDF_FormField(); |
| 836 | 833 |
| 837 CPDF_FormField::Type m_Type; | |
| 838 | |
| 839 FX_DWORD m_Flags; | |
| 840 | |
| 841 CPDF_InterForm* m_pForm; | |
| 842 | |
| 843 CPDF_Dictionary* m_pDict; | |
| 844 | |
| 845 CFX_PtrArray m_ControlList; | |
| 846 friend class CPDF_InterForm; | |
| 847 friend class CPDF_FormControl; | |
| 848 | |
| 849 CFX_WideString GetValue(FX_BOOL bDefault); | 834 CFX_WideString GetValue(FX_BOOL bDefault); |
| 850 | 835 |
| 851 FX_BOOL SetValue(const CFX_WideString& value, | 836 FX_BOOL SetValue(const CFX_WideString& value, |
| 852 FX_BOOL bDefault, | 837 FX_BOOL bDefault, |
| 853 FX_BOOL bNotify); | 838 FX_BOOL bNotify); |
| 854 | 839 |
| 855 void SyncFieldFlags(); | 840 void SyncFieldFlags(); |
| 856 | 841 |
| 857 int FindListSel(CPDF_String* str); | 842 int FindListSel(CPDF_String* str); |
| 858 | 843 |
| 859 CFX_WideString GetOptionText(int index, int sub_index); | 844 CFX_WideString GetOptionText(int index, int sub_index); |
| 860 | 845 |
| 861 void LoadDA(); | 846 void LoadDA(); |
| 862 | 847 |
| 863 void UpdateAP(CPDF_FormControl* pControl); | 848 void UpdateAP(CPDF_FormControl* pControl); |
| 864 | 849 |
| 865 CFX_WideString GetCheckValue(FX_BOOL bDefault); | 850 CFX_WideString GetCheckValue(FX_BOOL bDefault); |
| 866 | 851 |
| 867 FX_BOOL SetCheckValue(const CFX_WideString& value, | 852 FX_BOOL SetCheckValue(const CFX_WideString& value, |
| 868 FX_BOOL bDefault, | 853 FX_BOOL bDefault, |
| 869 FX_BOOL bNotify); | 854 FX_BOOL bNotify); |
| 870 | 855 |
| 856 CPDF_FormField::Type m_Type; |
| 857 FX_DWORD m_Flags; |
| 858 CPDF_InterForm* m_pForm; |
| 859 CPDF_Dictionary* m_pDict; |
| 860 CFX_ArrayTemplate<CPDF_FormControl*> m_ControlList; |
| 871 FX_FLOAT m_FontSize; | 861 FX_FLOAT m_FontSize; |
| 862 CPDF_Font* m_pFont; |
| 872 | 863 |
| 873 CPDF_Font* m_pFont; | 864 friend class CPDF_InterForm; |
| 865 friend class CPDF_FormControl; |
| 874 }; | 866 }; |
| 875 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, | 867 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, |
| 876 const FX_CHAR* name, | 868 const FX_CHAR* name, |
| 877 int nLevel = 0); | 869 int nLevel = 0); |
| 878 class CPDF_IconFit { | 870 class CPDF_IconFit { |
| 879 public: | 871 public: |
| 880 // TODO(thestig): Examine why this cannot be explicit. | 872 // TODO(thestig): Examine why this cannot be explicit. |
| 881 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 873 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
| 882 | 874 |
| 883 operator CPDF_Dictionary*() const { return m_pDict; } | 875 operator CPDF_Dictionary*() const { return m_pDict; } |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry) const; | 1149 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry) const; |
| 1158 | 1150 |
| 1159 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry) const; | 1151 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry) const; |
| 1160 | 1152 |
| 1161 CPDF_Dictionary* const m_pDict; | 1153 CPDF_Dictionary* const m_pDict; |
| 1162 }; | 1154 }; |
| 1163 | 1155 |
| 1164 CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath); | 1156 CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath); |
| 1165 | 1157 |
| 1166 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 1158 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| OLD | NEW |