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_FPDFDOC_INCLUDE_FPDF_DOC_H_ | 7 #ifndef CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ |
8 #define CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ | 8 #define CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 CPDF_Annot::AppearanceMode mode, | 833 CPDF_Annot::AppearanceMode mode, |
834 const CPDF_RenderOptions* pOptions = nullptr); | 834 const CPDF_RenderOptions* pOptions = nullptr); |
835 | 835 |
836 CFX_ByteString GetCheckedAPState(); | 836 CFX_ByteString GetCheckedAPState(); |
837 CFX_WideString GetExportValue(); | 837 CFX_WideString GetExportValue(); |
838 | 838 |
839 bool IsChecked() const; | 839 bool IsChecked() const; |
840 bool IsDefaultChecked() const; | 840 bool IsDefaultChecked() const; |
841 | 841 |
842 HighlightingMode GetHighlightingMode(); | 842 HighlightingMode GetHighlightingMode(); |
843 bool HasMKEntry(CFX_ByteString csEntry) const; | 843 bool HasMKEntry(const CFX_ByteString& csEntry) const; |
844 int GetRotation(); | 844 int GetRotation(); |
845 | 845 |
846 inline FX_ARGB GetBorderColor(int& iColorType) { | 846 inline FX_ARGB GetBorderColor(int& iColorType) { |
847 return GetColor(iColorType, "BC"); | 847 return GetColor(iColorType, "BC"); |
848 } | 848 } |
849 | 849 |
850 FX_FLOAT GetOriginalBorderColor(int index) { | 850 FX_FLOAT GetOriginalBorderColor(int index) { |
851 return GetOriginalColor(index, "BC"); | 851 return GetOriginalColor(index, "BC"); |
852 } | 852 } |
853 | 853 |
854 void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) { | 854 void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) { |
855 GetOriginalColor(iColorType, fc, "BC"); | 855 GetOriginalColor(iColorType, fc, "BC"); |
856 } | 856 } |
857 | 857 |
858 FX_ARGB GetBackgroundColor(int& iColorType) { | 858 FX_ARGB GetBackgroundColor(int& iColorType) { |
859 return GetColor(iColorType, "BG"); | 859 return GetColor(iColorType, "BG"); |
860 } | 860 } |
861 | 861 |
862 FX_FLOAT GetOriginalBackgroundColor(int index) { | 862 FX_FLOAT GetOriginalBackgroundColor(int index) { |
863 return GetOriginalColor(index, "BG"); | 863 return GetOriginalColor(index, "BG"); |
864 } | 864 } |
865 | 865 |
866 void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) { | 866 void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) { |
867 GetOriginalColor(iColorType, fc, "BG"); | 867 GetOriginalColor(iColorType, fc, "BG"); |
868 } | 868 } |
869 | 869 |
870 CFX_WideString GetNormalCaption() { return GetCaption("CA"); } | 870 CFX_WideString GetNormalCaption() { return GetCaption("CA"); } |
871 | |
872 CFX_WideString GetRolloverCaption() { return GetCaption("RC"); } | 871 CFX_WideString GetRolloverCaption() { return GetCaption("RC"); } |
873 | |
874 CFX_WideString GetDownCaption() { return GetCaption("AC"); } | 872 CFX_WideString GetDownCaption() { return GetCaption("AC"); } |
875 | 873 |
876 CPDF_Stream* GetNormalIcon() { return GetIcon("I"); } | 874 CPDF_Stream* GetNormalIcon() { return GetIcon("I"); } |
877 | |
878 CPDF_Stream* GetRolloverIcon() { return GetIcon("RI"); } | 875 CPDF_Stream* GetRolloverIcon() { return GetIcon("RI"); } |
879 | |
880 CPDF_Stream* GetDownIcon() { return GetIcon("IX"); } | 876 CPDF_Stream* GetDownIcon() { return GetIcon("IX"); } |
881 | |
882 CPDF_IconFit GetIconFit(); | 877 CPDF_IconFit GetIconFit(); |
883 | 878 |
884 int GetTextPosition(); | 879 int GetTextPosition(); |
885 | |
886 CPDF_Action GetAction(); | 880 CPDF_Action GetAction(); |
887 | |
888 CPDF_AAction GetAdditionalAction(); | 881 CPDF_AAction GetAdditionalAction(); |
889 | |
890 CPDF_DefaultAppearance GetDefaultAppearance(); | 882 CPDF_DefaultAppearance GetDefaultAppearance(); |
891 | 883 |
892 CPDF_Font* GetDefaultControlFont(); | 884 CPDF_Font* GetDefaultControlFont(); |
893 | |
894 int GetControlAlignment(); | 885 int GetControlAlignment(); |
895 | 886 |
896 protected: | 887 protected: |
897 CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict); | 888 CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict); |
898 | 889 |
899 CFX_ByteString GetOnStateName() const; | 890 CFX_ByteString GetOnStateName() const; |
900 void SetOnStateName(const CFX_ByteString& csOn); | 891 void SetOnStateName(const CFX_ByteString& csOn); |
901 | |
902 void CheckControl(FX_BOOL bChecked); | 892 void CheckControl(FX_BOOL bChecked); |
903 | 893 FX_ARGB GetColor(int& iColorType, const CFX_ByteString& csEntry); |
904 FX_ARGB GetColor(int& iColorType, CFX_ByteString csEntry); | 894 FX_FLOAT GetOriginalColor(int index, const CFX_ByteString& csEntry); |
905 | |
906 FX_FLOAT GetOriginalColor(int index, CFX_ByteString csEntry); | |
907 | |
908 void GetOriginalColor(int& iColorType, | 895 void GetOriginalColor(int& iColorType, |
909 FX_FLOAT fc[4], | 896 FX_FLOAT fc[4], |
910 CFX_ByteString csEntry); | 897 const CFX_ByteString& csEntry); |
911 | 898 |
912 CFX_WideString GetCaption(CFX_ByteString csEntry); | 899 CFX_WideString GetCaption(const CFX_ByteString& csEntry); |
913 | 900 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry); |
914 CPDF_Stream* GetIcon(CFX_ByteString csEntry); | |
915 | |
916 CPDF_ApSettings GetMK() const; | 901 CPDF_ApSettings GetMK() const; |
917 | 902 |
918 CPDF_InterForm* m_pForm; | 903 CPDF_InterForm* m_pForm; |
| 904 CPDF_FormField* m_pField; |
| 905 CPDF_Dictionary* m_pWidgetDict; |
919 | 906 |
920 CPDF_FormField* m_pField; | |
921 | |
922 CPDF_Dictionary* m_pWidgetDict; | |
923 friend class CPDF_InterForm; | 907 friend class CPDF_InterForm; |
924 friend class CPDF_FormField; | 908 friend class CPDF_FormField; |
925 }; | 909 }; |
926 | 910 |
927 class CPDF_FormNotify { | 911 class CPDF_FormNotify { |
928 public: | 912 public: |
929 virtual ~CPDF_FormNotify() {} | 913 virtual ~CPDF_FormNotify() {} |
930 | 914 |
931 virtual int BeforeValueChange(CPDF_FormField* pField, | 915 virtual int BeforeValueChange(CPDF_FormField* pField, |
932 const CFX_WideString& csValue) { | 916 const CFX_WideString& csValue) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 CFX_ByteString Duplex() const; | 964 CFX_ByteString Duplex() const; |
981 | 965 |
982 protected: | 966 protected: |
983 CPDF_Document* const m_pDoc; | 967 CPDF_Document* const m_pDoc; |
984 }; | 968 }; |
985 | 969 |
986 class CPDF_ApSettings { | 970 class CPDF_ApSettings { |
987 public: | 971 public: |
988 explicit CPDF_ApSettings(CPDF_Dictionary* pDict); | 972 explicit CPDF_ApSettings(CPDF_Dictionary* pDict); |
989 | 973 |
990 bool HasMKEntry(const CFX_ByteStringC& csEntry) const; | 974 bool HasMKEntry(const CFX_ByteString& csEntry) const; |
991 int GetRotation() const; | 975 int GetRotation() const; |
992 | 976 |
993 FX_ARGB GetBorderColor(int& iColorType) const { | 977 FX_ARGB GetBorderColor(int& iColorType) const { |
994 return GetColor(iColorType, "BC"); | 978 return GetColor(iColorType, "BC"); |
995 } | 979 } |
996 | 980 |
997 FX_FLOAT GetOriginalBorderColor(int index) const { | 981 FX_FLOAT GetOriginalBorderColor(int index) const { |
998 return GetOriginalColor(index, "BC"); | 982 return GetOriginalColor(index, "BC"); |
999 } | 983 } |
1000 | 984 |
1001 void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) const { | 985 void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) const { |
1002 GetOriginalColor(iColorType, fc, "BC"); | 986 GetOriginalColor(iColorType, fc, "BC"); |
1003 } | 987 } |
1004 | 988 |
1005 FX_ARGB GetBackgroundColor(int& iColorType) const { | 989 FX_ARGB GetBackgroundColor(int& iColorType) const { |
1006 return GetColor(iColorType, "BG"); | 990 return GetColor(iColorType, "BG"); |
1007 } | 991 } |
1008 | 992 |
1009 FX_FLOAT GetOriginalBackgroundColor(int index) const { | 993 FX_FLOAT GetOriginalBackgroundColor(int index) const { |
1010 return GetOriginalColor(index, "BG"); | 994 return GetOriginalColor(index, "BG"); |
1011 } | 995 } |
1012 | 996 |
1013 void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) const { | 997 void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) const { |
1014 GetOriginalColor(iColorType, fc, "BG"); | 998 GetOriginalColor(iColorType, fc, "BG"); |
1015 } | 999 } |
1016 | 1000 |
1017 CFX_WideString GetNormalCaption() const { return GetCaption("CA"); } | 1001 CFX_WideString GetNormalCaption() const { return GetCaption("CA"); } |
1018 | |
1019 CFX_WideString GetRolloverCaption() const { return GetCaption("RC"); } | 1002 CFX_WideString GetRolloverCaption() const { return GetCaption("RC"); } |
1020 | |
1021 CFX_WideString GetDownCaption() const { return GetCaption("AC"); } | 1003 CFX_WideString GetDownCaption() const { return GetCaption("AC"); } |
1022 | |
1023 CPDF_Stream* GetNormalIcon() const { return GetIcon("I"); } | 1004 CPDF_Stream* GetNormalIcon() const { return GetIcon("I"); } |
1024 | |
1025 CPDF_Stream* GetRolloverIcon() const { return GetIcon("RI"); } | 1005 CPDF_Stream* GetRolloverIcon() const { return GetIcon("RI"); } |
1026 | |
1027 CPDF_Stream* GetDownIcon() const { return GetIcon("IX"); } | 1006 CPDF_Stream* GetDownIcon() const { return GetIcon("IX"); } |
1028 | |
1029 CPDF_IconFit GetIconFit() const; | 1007 CPDF_IconFit GetIconFit() const; |
1030 | |
1031 int GetTextPosition() const; | 1008 int GetTextPosition() const; |
1032 | 1009 |
1033 protected: | 1010 protected: |
1034 friend class CPDF_FormControl; | 1011 friend class CPDF_FormControl; |
1035 | 1012 |
1036 FX_ARGB GetColor(int& iColorType, const CFX_ByteStringC& csEntry) const; | 1013 FX_ARGB GetColor(int& iColorType, const CFX_ByteString& csEntry) const; |
1037 | 1014 FX_FLOAT GetOriginalColor(int index, const CFX_ByteString& csEntry) const; |
1038 FX_FLOAT GetOriginalColor(int index, const CFX_ByteStringC& csEntry) const; | |
1039 | |
1040 void GetOriginalColor(int& iColorType, | 1015 void GetOriginalColor(int& iColorType, |
1041 FX_FLOAT fc[4], | 1016 FX_FLOAT fc[4], |
1042 const CFX_ByteStringC& csEntry) const; | 1017 const CFX_ByteString& csEntry) const; |
1043 | 1018 |
1044 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry) const; | 1019 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const; |
1045 | 1020 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const; |
1046 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry) const; | |
1047 | 1021 |
1048 CPDF_Dictionary* const m_pDict; | 1022 CPDF_Dictionary* const m_pDict; |
1049 }; | 1023 }; |
1050 | 1024 |
1051 CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath); | |
1052 | |
1053 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ | 1025 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ |
OLD | NEW |