Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: core/include/fpdfdoc/fpdf_doc.h

Issue 1436843003: Merge to XFA: Cleanup CPDF_ApSettings and CJS_Parameters. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 CFX_WideString GetExportValue(); 942 CFX_WideString GetExportValue();
943 943
944 FX_BOOL IsChecked(); 944 FX_BOOL IsChecked();
945 945
946 FX_BOOL IsDefaultChecked(); 946 FX_BOOL IsDefaultChecked();
947 947
948 enum HighlightingMode { None = 0, Invert, Outline, Push, Toggle }; 948 enum HighlightingMode { None = 0, Invert, Outline, Push, Toggle };
949 949
950 HighlightingMode GetHighlightingMode(); 950 HighlightingMode GetHighlightingMode();
951 951
952 FX_BOOL HasMKEntry(CFX_ByteString csEntry); 952 bool HasMKEntry(CFX_ByteString csEntry) const;
953 953
954 int GetRotation(); 954 int GetRotation();
955 955
956 inline FX_ARGB GetBorderColor(int& iColorType) { 956 inline FX_ARGB GetBorderColor(int& iColorType) {
957 return GetColor(iColorType, "BC"); 957 return GetColor(iColorType, "BC");
958 } 958 }
959 959
960 inline FX_FLOAT GetOriginalBorderColor(int index) { 960 FX_FLOAT GetOriginalBorderColor(int index) {
961 return GetOriginalColor(index, "BC"); 961 return GetOriginalColor(index, "BC");
962 } 962 }
963 963
964 inline void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) { 964 void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) {
965 GetOriginalColor(iColorType, fc, "BC"); 965 GetOriginalColor(iColorType, fc, "BC");
966 } 966 }
967 967
968 inline FX_ARGB GetBackgroundColor(int& iColorType) { 968 FX_ARGB GetBackgroundColor(int& iColorType) {
969 return GetColor(iColorType, "BG"); 969 return GetColor(iColorType, "BG");
970 } 970 }
971 971
972 inline FX_FLOAT GetOriginalBackgroundColor(int index) { 972 FX_FLOAT GetOriginalBackgroundColor(int index) {
973 return GetOriginalColor(index, "BG"); 973 return GetOriginalColor(index, "BG");
974 } 974 }
975 975
976 inline void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) { 976 void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) {
977 GetOriginalColor(iColorType, fc, "BG"); 977 GetOriginalColor(iColorType, fc, "BG");
978 } 978 }
979 979
980 inline CFX_WideString GetNormalCaption() { return GetCaption("CA"); } 980 CFX_WideString GetNormalCaption() { return GetCaption("CA"); }
981 981
982 inline CFX_WideString GetRolloverCaption() { return GetCaption("RC"); } 982 CFX_WideString GetRolloverCaption() { return GetCaption("RC"); }
983 983
984 inline CFX_WideString GetDownCaption() { return GetCaption("AC"); } 984 CFX_WideString GetDownCaption() { return GetCaption("AC"); }
985 985
986 inline CPDF_Stream* GetNormalIcon() { return GetIcon("I"); } 986 CPDF_Stream* GetNormalIcon() { return GetIcon("I"); }
987 987
988 inline CPDF_Stream* GetRolloverIcon() { return GetIcon("RI"); } 988 CPDF_Stream* GetRolloverIcon() { return GetIcon("RI"); }
989 989
990 inline CPDF_Stream* GetDownIcon() { return GetIcon("IX"); } 990 CPDF_Stream* GetDownIcon() { return GetIcon("IX"); }
991 991
992 CPDF_IconFit GetIconFit(); 992 CPDF_IconFit GetIconFit();
993 993
994 int GetTextPosition(); 994 int GetTextPosition();
995 995
996 CPDF_Action GetAction(); 996 CPDF_Action GetAction();
997 997
998 CPDF_AAction GetAdditionalAction(); 998 CPDF_AAction GetAdditionalAction();
999 999
1000 CPDF_DefaultAppearance GetDefaultAppearance(); 1000 CPDF_DefaultAppearance GetDefaultAppearance();
(...skipping 16 matching lines...) Expand all
1017 FX_FLOAT GetOriginalColor(int index, CFX_ByteString csEntry); 1017 FX_FLOAT GetOriginalColor(int index, CFX_ByteString csEntry);
1018 1018
1019 void GetOriginalColor(int& iColorType, 1019 void GetOriginalColor(int& iColorType,
1020 FX_FLOAT fc[4], 1020 FX_FLOAT fc[4],
1021 CFX_ByteString csEntry); 1021 CFX_ByteString csEntry);
1022 1022
1023 CFX_WideString GetCaption(CFX_ByteString csEntry); 1023 CFX_WideString GetCaption(CFX_ByteString csEntry);
1024 1024
1025 CPDF_Stream* GetIcon(CFX_ByteString csEntry); 1025 CPDF_Stream* GetIcon(CFX_ByteString csEntry);
1026 1026
1027 CPDF_ApSettings GetMK(FX_BOOL bCreate); 1027 CPDF_ApSettings GetMK() const;
1028 1028
1029 CPDF_InterForm* m_pForm; 1029 CPDF_InterForm* m_pForm;
1030 1030
1031 CPDF_FormField* m_pField; 1031 CPDF_FormField* m_pField;
1032 1032
1033 CPDF_Dictionary* m_pWidgetDict; 1033 CPDF_Dictionary* m_pWidgetDict;
1034 friend class CPDF_InterForm; 1034 friend class CPDF_InterForm;
1035 friend class CPDF_FormField; 1035 friend class CPDF_FormField;
1036 }; 1036 };
1037 class CPDF_FormNotify { 1037 class CPDF_FormNotify {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 CPDF_Array* PrintPageRange() const; 1106 CPDF_Array* PrintPageRange() const;
1107 1107
1108 CFX_ByteString Duplex() const; 1108 CFX_ByteString Duplex() const;
1109 1109
1110 protected: 1110 protected:
1111 CPDF_Document* const m_pDoc; 1111 CPDF_Document* const m_pDoc;
1112 }; 1112 };
1113 1113
1114 class CPDF_ApSettings { 1114 class CPDF_ApSettings {
1115 public: 1115 public:
1116 // TODO(thestig): Examine why this cannot be explicit. 1116 explicit CPDF_ApSettings(CPDF_Dictionary* pDict);
1117 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; }
1118 1117
1119 operator CPDF_Dictionary*() const { return m_pDict; } 1118 bool HasMKEntry(const CFX_ByteStringC& csEntry) const;
1119 int GetRotation() const;
1120 1120
1121 FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry); 1121 FX_ARGB GetBorderColor(int& iColorType) const {
1122
1123 int GetRotation();
1124
1125 inline FX_ARGB GetBorderColor(int& iColorType) {
1126 return GetColor(iColorType, FX_BSTRC("BC")); 1122 return GetColor(iColorType, FX_BSTRC("BC"));
1127 } 1123 }
1128 1124
1129 inline FX_FLOAT GetOriginalBorderColor(int index) { 1125 FX_FLOAT GetOriginalBorderColor(int index) const {
1130 return GetOriginalColor(index, FX_BSTRC("BC")); 1126 return GetOriginalColor(index, FX_BSTRC("BC"));
1131 } 1127 }
1132 1128
1133 inline void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) { 1129 void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) const {
1134 GetOriginalColor(iColorType, fc, FX_BSTRC("BC")); 1130 GetOriginalColor(iColorType, fc, FX_BSTRC("BC"));
1135 } 1131 }
1136 1132
1137 inline FX_ARGB GetBackgroundColor(int& iColorType) { 1133 FX_ARGB GetBackgroundColor(int& iColorType) const {
1138 return GetColor(iColorType, FX_BSTRC("BG")); 1134 return GetColor(iColorType, FX_BSTRC("BG"));
1139 } 1135 }
1140 1136
1141 inline FX_FLOAT GetOriginalBackgroundColor(int index) { 1137 FX_FLOAT GetOriginalBackgroundColor(int index) const {
1142 return GetOriginalColor(index, FX_BSTRC("BG")); 1138 return GetOriginalColor(index, FX_BSTRC("BG"));
1143 } 1139 }
1144 1140
1145 inline void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) { 1141 void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) const {
1146 GetOriginalColor(iColorType, fc, FX_BSTRC("BG")); 1142 GetOriginalColor(iColorType, fc, FX_BSTRC("BG"));
1147 } 1143 }
1148 1144
1149 inline CFX_WideString GetNormalCaption() { 1145 CFX_WideString GetNormalCaption() const { return GetCaption(FX_BSTRC("CA")); }
1150 return GetCaption(FX_BSTRC("CA"));
1151 }
1152 1146
1153 inline CFX_WideString GetRolloverCaption() { 1147 CFX_WideString GetRolloverCaption() const {
1154 return GetCaption(FX_BSTRC("RC")); 1148 return GetCaption(FX_BSTRC("RC"));
1155 } 1149 }
1156 1150
1157 inline CFX_WideString GetDownCaption() { return GetCaption(FX_BSTRC("AC")); } 1151 CFX_WideString GetDownCaption() const { return GetCaption(FX_BSTRC("AC")); }
1158 1152
1159 inline CPDF_Stream* GetNormalIcon() { return GetIcon(FX_BSTRC("I")); } 1153 CPDF_Stream* GetNormalIcon() const { return GetIcon(FX_BSTRC("I")); }
1160 1154
1161 inline CPDF_Stream* GetRolloverIcon() { return GetIcon(FX_BSTRC("RI")); } 1155 CPDF_Stream* GetRolloverIcon() const { return GetIcon(FX_BSTRC("RI")); }
1162 1156
1163 inline CPDF_Stream* GetDownIcon() { return GetIcon(FX_BSTRC("IX")); } 1157 CPDF_Stream* GetDownIcon() const { return GetIcon(FX_BSTRC("IX")); }
1164 1158
1165 CPDF_IconFit GetIconFit(); 1159 CPDF_IconFit GetIconFit() const;
1166 1160
1167 int GetTextPosition(); 1161 int GetTextPosition() const;
1168
1169 CPDF_Dictionary* m_pDict;
1170 1162
1171 protected: 1163 protected:
1172 FX_ARGB GetColor(int& iColorType, const CFX_ByteStringC& csEntry); 1164 friend class CPDF_FormControl;
1173 1165
1174 FX_FLOAT GetOriginalColor(int index, const CFX_ByteStringC& csEntry); 1166 FX_ARGB GetColor(int& iColorType, const CFX_ByteStringC& csEntry) const;
1167
1168 FX_FLOAT GetOriginalColor(int index, const CFX_ByteStringC& csEntry) const;
1175 1169
1176 void GetOriginalColor(int& iColorType, 1170 void GetOriginalColor(int& iColorType,
1177 FX_FLOAT fc[4], 1171 FX_FLOAT fc[4],
1178 const CFX_ByteStringC& csEntry); 1172 const CFX_ByteStringC& csEntry) const;
1179 1173
1180 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry); 1174 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry) const;
1181 1175
1182 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry); 1176 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry) const;
1183 friend class CPDF_FormControl; 1177
1178 CPDF_Dictionary* const m_pDict;
1184 }; 1179 };
1185 1180
1181 CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath);
1182
1186 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ 1183 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698