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 26 matching lines...) Expand all Loading... |
37 class CPDF_NumberTree; | 37 class CPDF_NumberTree; |
38 class CPDF_OCContext; | 38 class CPDF_OCContext; |
39 class CPDF_Page; | 39 class CPDF_Page; |
40 class CPDF_RenderOptions; | 40 class CPDF_RenderOptions; |
41 class CPDF_TextObject; | 41 class CPDF_TextObject; |
42 class CPDF_ViewerPreferences; | 42 class CPDF_ViewerPreferences; |
43 class CXML_Element; | 43 class CXML_Element; |
44 | 44 |
45 class CPDF_NameTree { | 45 class CPDF_NameTree { |
46 public: | 46 public: |
47 explicit CPDF_NameTree(CPDF_Dictionary* pRoot) { m_pRoot = pRoot; } | 47 explicit CPDF_NameTree(CPDF_Dictionary* pRoot) : m_pRoot(pRoot) {} |
48 | |
49 CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteStringC& category); | 48 CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteStringC& category); |
50 | 49 |
51 CPDF_Object* LookupValue(int nIndex, CFX_ByteString& csName) const; | 50 CPDF_Object* LookupValue(int nIndex, CFX_ByteString& csName) const; |
52 | |
53 CPDF_Object* LookupValue(const CFX_ByteString& csName) const; | 51 CPDF_Object* LookupValue(const CFX_ByteString& csName) const; |
54 | |
55 CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, | 52 CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, |
56 const CFX_ByteStringC& sName); | 53 const CFX_ByteStringC& sName); |
57 | |
58 int GetIndex(const CFX_ByteString& csName) const; | 54 int GetIndex(const CFX_ByteString& csName) const; |
59 | |
60 int GetCount() const; | 55 int GetCount() const; |
61 | |
62 CPDF_Dictionary* GetRoot() const { return m_pRoot; } | 56 CPDF_Dictionary* GetRoot() const { return m_pRoot; } |
63 | 57 |
64 protected: | 58 protected: |
65 CPDF_Dictionary* m_pRoot; | 59 CPDF_Dictionary* m_pRoot; |
66 }; | 60 }; |
| 61 |
67 class CPDF_BookmarkTree { | 62 class CPDF_BookmarkTree { |
68 public: | 63 public: |
69 explicit CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} | 64 explicit CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} |
70 | 65 |
71 CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const; | 66 CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const; |
72 | |
73 CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) const; | 67 CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) const; |
74 | |
75 CPDF_Document* GetDocument() const { return m_pDocument; } | 68 CPDF_Document* GetDocument() const { return m_pDocument; } |
76 | 69 |
77 protected: | 70 protected: |
78 CPDF_Document* m_pDocument; | 71 CPDF_Document* const m_pDocument; |
79 }; | 72 }; |
| 73 |
80 #define PDFBOOKMARK_ITALIC 1 | 74 #define PDFBOOKMARK_ITALIC 1 |
81 #define PDFBOOKMARK_BOLD 2 | 75 #define PDFBOOKMARK_BOLD 2 |
82 class CPDF_Bookmark { | 76 class CPDF_Bookmark { |
83 public: | 77 public: |
84 CPDF_Bookmark() : m_pDict(NULL) {} | 78 CPDF_Bookmark() : m_pDict(nullptr) {} |
85 | |
86 explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {} | 79 explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {} |
87 | 80 |
88 CPDF_Dictionary* GetDict() const { return m_pDict; } | 81 CPDF_Dictionary* GetDict() const { return m_pDict; } |
89 | |
90 operator bool() const { return m_pDict != NULL; } | |
91 | |
92 FX_DWORD GetColorRef() const; | 82 FX_DWORD GetColorRef() const; |
93 | |
94 FX_DWORD GetFontStyle() const; | 83 FX_DWORD GetFontStyle() const; |
95 | |
96 CFX_WideString GetTitle() const; | 84 CFX_WideString GetTitle() const; |
97 | |
98 CPDF_Dest GetDest(CPDF_Document* pDocument) const; | 85 CPDF_Dest GetDest(CPDF_Document* pDocument) const; |
99 | |
100 CPDF_Action GetAction() const; | 86 CPDF_Action GetAction() const; |
101 | 87 |
| 88 protected: |
102 CPDF_Dictionary* m_pDict; | 89 CPDF_Dictionary* m_pDict; |
103 }; | 90 }; |
| 91 |
104 #define PDFZOOM_XYZ 1 | 92 #define PDFZOOM_XYZ 1 |
105 #define PDFZOOM_FITPAGE 2 | 93 #define PDFZOOM_FITPAGE 2 |
106 #define PDFZOOM_FITHORZ 3 | 94 #define PDFZOOM_FITHORZ 3 |
107 #define PDFZOOM_FITVERT 4 | 95 #define PDFZOOM_FITVERT 4 |
108 #define PDFZOOM_FITRECT 5 | 96 #define PDFZOOM_FITRECT 5 |
109 #define PDFZOOM_FITBBOX 6 | 97 #define PDFZOOM_FITBBOX 6 |
110 #define PDFZOOM_FITBHORZ 7 | 98 #define PDFZOOM_FITBHORZ 7 |
111 #define PDFZOOM_FITBVERT 8 | 99 #define PDFZOOM_FITBVERT 8 |
112 class CPDF_Dest { | 100 class CPDF_Dest { |
113 public: | 101 public: |
114 CPDF_Dest() : m_pObj(nullptr) {} | 102 CPDF_Dest() : m_pObj(nullptr) {} |
115 explicit CPDF_Dest(CPDF_Object* pObj) : m_pObj(pObj) {} | 103 explicit CPDF_Dest(CPDF_Object* pObj) : m_pObj(pObj) {} |
116 | 104 |
117 operator bool() const { return m_pObj != NULL; } | |
118 CPDF_Object* GetObject() const { return m_pObj; } | 105 CPDF_Object* GetObject() const { return m_pObj; } |
119 | |
120 CFX_ByteString GetRemoteName(); | 106 CFX_ByteString GetRemoteName(); |
121 int GetPageIndex(CPDF_Document* pDoc); | 107 int GetPageIndex(CPDF_Document* pDoc); |
122 FX_DWORD GetPageObjNum(); | 108 FX_DWORD GetPageObjNum(); |
123 int GetZoomMode(); | 109 int GetZoomMode(); |
124 FX_FLOAT GetParam(int index); | 110 FX_FLOAT GetParam(int index); |
125 | 111 |
126 protected: | 112 protected: |
127 CPDF_Object* m_pObj; | 113 CPDF_Object* m_pObj; |
128 }; | 114 }; |
| 115 |
129 class CPDF_OCContext : public IPDF_OCContext { | 116 class CPDF_OCContext : public IPDF_OCContext { |
130 public: | 117 public: |
131 enum UsageType { View = 0, Design, Print, Export }; | 118 enum UsageType { View = 0, Design, Print, Export }; |
132 | 119 |
133 explicit CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View); | 120 explicit CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View); |
134 ~CPDF_OCContext() override; | 121 ~CPDF_OCContext() override; |
135 | 122 |
| 123 // IPDF_OCContext: |
| 124 FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict) override; |
| 125 |
136 CPDF_Document* GetDocument() const { return m_pDocument; } | 126 CPDF_Document* GetDocument() const { return m_pDocument; } |
137 | |
138 UsageType GetUsageType() const { return m_eUsageType; } | 127 UsageType GetUsageType() const { return m_eUsageType; } |
139 | 128 |
140 FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict) override; | |
141 | |
142 void ResetOCContext(); | 129 void ResetOCContext(); |
143 | 130 |
144 protected: | 131 protected: |
145 FX_BOOL LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, | 132 FX_BOOL LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, |
146 const CPDF_Dictionary* pOCGDict, | 133 const CPDF_Dictionary* pOCGDict, |
147 FX_BOOL& bValidConfig) const; | 134 FX_BOOL& bValidConfig) const; |
148 | |
149 FX_BOOL LoadOCGState(const CPDF_Dictionary* pOCGDict) const; | 135 FX_BOOL LoadOCGState(const CPDF_Dictionary* pOCGDict) const; |
150 | |
151 FX_BOOL GetOCGVisible(const CPDF_Dictionary* pOCGDict); | 136 FX_BOOL GetOCGVisible(const CPDF_Dictionary* pOCGDict); |
152 | |
153 FX_BOOL GetOCGVE(CPDF_Array* pExpression, | 137 FX_BOOL GetOCGVE(CPDF_Array* pExpression, |
154 FX_BOOL bFromConfig, | 138 FX_BOOL bFromConfig, |
155 int nLevel = 0); | 139 int nLevel = 0); |
156 | |
157 FX_BOOL LoadOCMDState(const CPDF_Dictionary* pOCMDDict, FX_BOOL bFromConfig); | 140 FX_BOOL LoadOCMDState(const CPDF_Dictionary* pOCMDDict, FX_BOOL bFromConfig); |
158 | 141 |
159 CPDF_Document* m_pDocument; | 142 CPDF_Document* m_pDocument; |
160 | |
161 UsageType m_eUsageType; | 143 UsageType m_eUsageType; |
162 | |
163 std::map<const CPDF_Dictionary*, FX_BOOL> m_OCGStates; | 144 std::map<const CPDF_Dictionary*, FX_BOOL> m_OCGStates; |
164 }; | 145 }; |
165 | 146 |
166 class CPDF_ActionFields { | 147 class CPDF_ActionFields { |
167 public: | 148 public: |
168 // TODO(thestig): Examine why this cannot be explicit. | 149 explicit CPDF_ActionFields(const CPDF_Action* pAction) : m_pAction(pAction) {} |
169 CPDF_ActionFields(const CPDF_Action* pAction) { | |
170 m_pAction = (CPDF_Action*)pAction; | |
171 } | |
172 | |
173 // TODO(thestig): Replace this. | |
174 operator CPDF_Action*() const { return m_pAction; } | |
175 | 150 |
176 FX_DWORD GetFieldsCount() const; | 151 FX_DWORD GetFieldsCount() const; |
177 | |
178 std::vector<CPDF_Object*> GetAllFields() const; | 152 std::vector<CPDF_Object*> GetAllFields() const; |
179 | |
180 CPDF_Object* GetField(FX_DWORD iIndex) const; | 153 CPDF_Object* GetField(FX_DWORD iIndex) const; |
181 | 154 |
182 CPDF_Action* m_pAction; | 155 protected: |
| 156 const CPDF_Action* const m_pAction; |
183 }; | 157 }; |
184 | 158 |
185 #define PDFNAMED_NEXTPAGE 1 | 159 #define PDFNAMED_NEXTPAGE 1 |
186 #define PDFNAMED_PREVPAGE 2 | 160 #define PDFNAMED_PREVPAGE 2 |
187 #define PDFNAMED_FIRSTPAGE 3 | 161 #define PDFNAMED_FIRSTPAGE 3 |
188 #define PDFNAMED_LASTPAGE 4 | 162 #define PDFNAMED_LASTPAGE 4 |
189 #define PDFJS_MAXLENGTH 64 | 163 #define PDFJS_MAXLENGTH 64 |
190 class CPDF_Action { | 164 class CPDF_Action { |
191 public: | 165 public: |
192 enum ActionType { | 166 enum ActionType { |
(...skipping 14 matching lines...) Expand all Loading... |
207 JavaScript, | 181 JavaScript, |
208 SetOCGState, | 182 SetOCGState, |
209 Rendition, | 183 Rendition, |
210 Trans, | 184 Trans, |
211 GoTo3DView | 185 GoTo3DView |
212 }; | 186 }; |
213 | 187 |
214 CPDF_Action() : m_pDict(nullptr) {} | 188 CPDF_Action() : m_pDict(nullptr) {} |
215 explicit CPDF_Action(CPDF_Dictionary* pDict) : m_pDict(pDict) {} | 189 explicit CPDF_Action(CPDF_Dictionary* pDict) : m_pDict(pDict) {} |
216 | 190 |
217 operator bool() const { return m_pDict != NULL; } | |
218 | |
219 CPDF_Dictionary* GetDict() const { return m_pDict; } | 191 CPDF_Dictionary* GetDict() const { return m_pDict; } |
220 | |
221 CFX_ByteString GetTypeName() const { return m_pDict->GetStringBy("S"); } | 192 CFX_ByteString GetTypeName() const { return m_pDict->GetStringBy("S"); } |
222 | |
223 ActionType GetType() const; | 193 ActionType GetType() const; |
224 | |
225 CPDF_Dest GetDest(CPDF_Document* pDoc) const; | 194 CPDF_Dest GetDest(CPDF_Document* pDoc) const; |
226 | |
227 CFX_WideString GetFilePath() const; | 195 CFX_WideString GetFilePath() const; |
228 | |
229 FX_BOOL GetNewWindow() const { return m_pDict->GetBooleanBy("NewWindow"); } | 196 FX_BOOL GetNewWindow() const { return m_pDict->GetBooleanBy("NewWindow"); } |
230 | |
231 CFX_ByteString GetURI(CPDF_Document* pDoc) const; | 197 CFX_ByteString GetURI(CPDF_Document* pDoc) const; |
232 | |
233 FX_BOOL GetMouseMap() const { return m_pDict->GetBooleanBy("IsMap"); } | 198 FX_BOOL GetMouseMap() const { return m_pDict->GetBooleanBy("IsMap"); } |
234 | |
235 CPDF_ActionFields GetWidgets() const { return this; } | |
236 | |
237 FX_BOOL GetHideStatus() const { return m_pDict->GetBooleanBy("H", TRUE); } | 199 FX_BOOL GetHideStatus() const { return m_pDict->GetBooleanBy("H", TRUE); } |
238 | |
239 CFX_ByteString GetNamedAction() const { return m_pDict->GetStringBy("N"); } | 200 CFX_ByteString GetNamedAction() const { return m_pDict->GetStringBy("N"); } |
240 | |
241 FX_DWORD GetFlags() const { return m_pDict->GetIntegerBy("Flags"); } | 201 FX_DWORD GetFlags() const { return m_pDict->GetIntegerBy("Flags"); } |
242 | |
243 CFX_WideString GetJavaScript() const; | 202 CFX_WideString GetJavaScript() const; |
244 | |
245 CPDF_Dictionary* GetAnnot() const; | 203 CPDF_Dictionary* GetAnnot() const; |
246 | |
247 int32_t GetOperationType() const; | 204 int32_t GetOperationType() const; |
248 | |
249 CPDF_Stream* GetSoundStream() const { return m_pDict->GetStreamBy("Sound"); } | 205 CPDF_Stream* GetSoundStream() const { return m_pDict->GetStreamBy("Sound"); } |
250 | |
251 FX_FLOAT GetVolume() const { return m_pDict->GetNumberBy("Volume"); } | 206 FX_FLOAT GetVolume() const { return m_pDict->GetNumberBy("Volume"); } |
252 | |
253 FX_BOOL IsSynchronous() const { return m_pDict->GetBooleanBy("Synchronous"); } | 207 FX_BOOL IsSynchronous() const { return m_pDict->GetBooleanBy("Synchronous"); } |
254 | |
255 FX_BOOL IsRepeat() const { return m_pDict->GetBooleanBy("Repeat"); } | 208 FX_BOOL IsRepeat() const { return m_pDict->GetBooleanBy("Repeat"); } |
256 | |
257 FX_BOOL IsMixPlay() const { return m_pDict->GetBooleanBy("Mix"); } | 209 FX_BOOL IsMixPlay() const { return m_pDict->GetBooleanBy("Mix"); } |
258 | |
259 FX_DWORD GetSubActionsCount() const; | 210 FX_DWORD GetSubActionsCount() const; |
260 | |
261 CPDF_Action GetSubAction(FX_DWORD iIndex) const; | 211 CPDF_Action GetSubAction(FX_DWORD iIndex) const; |
262 | 212 |
263 protected: | 213 protected: |
264 CPDF_Dictionary* m_pDict; | 214 CPDF_Dictionary* const m_pDict; |
265 }; | 215 }; |
| 216 |
266 class CPDF_AAction { | 217 class CPDF_AAction { |
267 public: | 218 public: |
268 // TODO(thestig): Examine why this cannot be explicit. | |
269 CPDF_AAction(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | |
270 | |
271 operator CPDF_Dictionary*() const { return m_pDict; } | |
272 | |
273 enum AActionType { | 219 enum AActionType { |
274 CursorEnter = 0, | 220 CursorEnter = 0, |
275 CursorExit, | 221 CursorExit, |
276 ButtonDown, | 222 ButtonDown, |
277 ButtonUp, | 223 ButtonUp, |
278 GetFocus, | 224 GetFocus, |
279 LoseFocus, | 225 LoseFocus, |
280 PageOpen, | 226 PageOpen, |
281 PageClose, | 227 PageClose, |
282 PageVisible, | 228 PageVisible, |
283 PageInvisible, | 229 PageInvisible, |
284 OpenPage, | 230 OpenPage, |
285 ClosePage, | 231 ClosePage, |
286 KeyStroke, | 232 KeyStroke, |
287 Format, | 233 Format, |
288 Validate, | 234 Validate, |
289 Calculate, | 235 Calculate, |
290 CloseDocument, | 236 CloseDocument, |
291 SaveDocument, | 237 SaveDocument, |
292 DocumentSaved, | 238 DocumentSaved, |
293 PrintDocument, | 239 PrintDocument, |
294 DocumentPrinted | 240 DocumentPrinted |
295 }; | 241 }; |
296 | 242 |
| 243 CPDF_AAction() : m_pDict(nullptr) {} |
| 244 explicit CPDF_AAction(CPDF_Dictionary* pDict) : m_pDict(pDict) {} |
| 245 |
297 FX_BOOL ActionExist(AActionType eType) const; | 246 FX_BOOL ActionExist(AActionType eType) const; |
| 247 CPDF_Action GetAction(AActionType eType) const; |
| 248 CPDF_Dictionary* GetDict() const { return m_pDict; } |
298 | 249 |
299 CPDF_Action GetAction(AActionType eType) const; | 250 protected: |
| 251 CPDF_Dictionary* const m_pDict; |
| 252 }; |
300 | 253 |
301 CPDF_Dictionary* m_pDict; | |
302 }; | |
303 class CPDF_DocJSActions { | 254 class CPDF_DocJSActions { |
304 public: | 255 public: |
305 explicit CPDF_DocJSActions(CPDF_Document* pDoc); | 256 explicit CPDF_DocJSActions(CPDF_Document* pDoc); |
306 | 257 |
307 int CountJSActions() const; | 258 int CountJSActions() const; |
308 | |
309 CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const; | 259 CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const; |
310 | |
311 CPDF_Action GetJSAction(const CFX_ByteString& csName) const; | 260 CPDF_Action GetJSAction(const CFX_ByteString& csName) const; |
312 | |
313 int FindJSAction(const CFX_ByteString& csName) const; | 261 int FindJSAction(const CFX_ByteString& csName) const; |
314 | |
315 CPDF_Document* GetDocument() const { return m_pDocument; } | 262 CPDF_Document* GetDocument() const { return m_pDocument; } |
316 | 263 |
317 protected: | 264 protected: |
318 CPDF_Document* const m_pDocument; | 265 CPDF_Document* const m_pDocument; |
319 }; | 266 }; |
320 | 267 |
321 class CPDF_FileSpec { | 268 class CPDF_FileSpec { |
322 public: | 269 public: |
323 CPDF_FileSpec(); | 270 CPDF_FileSpec(); |
324 explicit CPDF_FileSpec(CPDF_Object* pObj) { m_pObj = pObj; } | 271 explicit CPDF_FileSpec(CPDF_Object* pObj) : m_pObj(pObj) {} |
325 | 272 |
326 // Convert a platform dependent file name into pdf format. | 273 // Convert a platform dependent file name into pdf format. |
327 static CFX_WideString EncodeFileName(const CFX_WideStringC& filepath); | 274 static CFX_WideString EncodeFileName(const CFX_WideStringC& filepath); |
328 | 275 |
329 // Convert a pdf file name into platform dependent format. | 276 // Convert a pdf file name into platform dependent format. |
330 static CFX_WideString DecodeFileName(const CFX_WideStringC& filepath); | 277 static CFX_WideString DecodeFileName(const CFX_WideStringC& filepath); |
331 | 278 |
332 CPDF_Object* GetObj() const { return m_pObj; } | 279 CPDF_Object* GetObj() const { return m_pObj; } |
333 bool GetFileName(CFX_WideString* wsFileName) const; | 280 bool GetFileName(CFX_WideString* wsFileName) const; |
334 | 281 |
335 // Set this file spec to refer to a file name (not a url). | 282 // Set this file spec to refer to a file name (not a url). |
336 void SetFileName(const CFX_WideStringC& wsFileName); | 283 void SetFileName(const CFX_WideStringC& wsFileName); |
337 | 284 |
338 protected: | 285 protected: |
339 CPDF_Object* m_pObj; | 286 CPDF_Object* m_pObj; |
340 }; | 287 }; |
341 | 288 |
342 class CPDF_LinkList { | 289 class CPDF_LinkList { |
343 public: | 290 public: |
344 CPDF_LinkList(); | 291 CPDF_LinkList(); |
345 ~CPDF_LinkList(); | 292 ~CPDF_LinkList(); |
346 | 293 |
347 CPDF_Link GetLinkAtPoint(CPDF_Page* pPage, | 294 CPDF_Link GetLinkAtPoint(CPDF_Page* pPage, |
348 FX_FLOAT pdf_x, | 295 FX_FLOAT pdf_x, |
349 FX_FLOAT pdf_y, | 296 FX_FLOAT pdf_y, |
350 int* z_order); | 297 int* z_order); |
351 | 298 |
352 private: | 299 private: |
353 const std::vector<CPDF_Dictionary*>* GetPageLinks(CPDF_Page* pPage); | 300 const std::vector<CPDF_Dictionary*>* GetPageLinks(CPDF_Page* pPage); |
354 | |
355 void LoadPageLinks(CPDF_Page* pPage, std::vector<CPDF_Dictionary*>* pList); | 301 void LoadPageLinks(CPDF_Page* pPage, std::vector<CPDF_Dictionary*>* pList); |
356 | 302 |
357 std::map<FX_DWORD, std::vector<CPDF_Dictionary*>> m_PageMap; | 303 std::map<FX_DWORD, std::vector<CPDF_Dictionary*>> m_PageMap; |
358 }; | 304 }; |
359 | 305 |
360 class CPDF_Link { | 306 class CPDF_Link { |
361 public: | 307 public: |
362 CPDF_Link() : m_pDict(nullptr) {} | 308 CPDF_Link() : m_pDict(nullptr) {} |
363 explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {} | 309 explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {} |
364 | 310 |
(...skipping 18 matching lines...) Expand all Loading... |
383 #define ANNOTFLAG_TOGGLENOVIEW 0x0100 | 329 #define ANNOTFLAG_TOGGLENOVIEW 0x0100 |
384 | 330 |
385 class CPDF_Annot : public CFX_PrivateData { | 331 class CPDF_Annot : public CFX_PrivateData { |
386 public: | 332 public: |
387 enum AppearanceMode { Normal, Rollover, Down }; | 333 enum AppearanceMode { Normal, Rollover, Down }; |
388 | 334 |
389 CPDF_Annot(CPDF_Dictionary* pDict, CPDF_AnnotList* pList); | 335 CPDF_Annot(CPDF_Dictionary* pDict, CPDF_AnnotList* pList); |
390 ~CPDF_Annot(); | 336 ~CPDF_Annot(); |
391 | 337 |
392 CFX_ByteString GetSubType() const; | 338 CFX_ByteString GetSubType() const; |
393 | |
394 FX_DWORD GetFlags() const; | 339 FX_DWORD GetFlags() const; |
395 | |
396 void GetRect(CFX_FloatRect& rect) const; | 340 void GetRect(CFX_FloatRect& rect) const; |
397 | |
398 const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; } | 341 const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; } |
399 CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; } | 342 CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; } |
400 | |
401 FX_BOOL DrawAppearance(CPDF_Page* pPage, | 343 FX_BOOL DrawAppearance(CPDF_Page* pPage, |
402 CFX_RenderDevice* pDevice, | 344 CFX_RenderDevice* pDevice, |
403 const CFX_Matrix* pUser2Device, | 345 const CFX_Matrix* pUser2Device, |
404 AppearanceMode mode, | 346 AppearanceMode mode, |
405 const CPDF_RenderOptions* pOptions); | 347 const CPDF_RenderOptions* pOptions); |
406 | |
407 FX_BOOL DrawInContext(const CPDF_Page* pPage, | 348 FX_BOOL DrawInContext(const CPDF_Page* pPage, |
408 CPDF_RenderContext* pContext, | 349 CPDF_RenderContext* pContext, |
409 const CFX_Matrix* pUser2Device, | 350 const CFX_Matrix* pUser2Device, |
410 AppearanceMode mode); | 351 AppearanceMode mode); |
411 | |
412 void ClearCachedAP(); | 352 void ClearCachedAP(); |
413 | |
414 void DrawBorder(CFX_RenderDevice* pDevice, | 353 void DrawBorder(CFX_RenderDevice* pDevice, |
415 const CFX_Matrix* pUser2Device, | 354 const CFX_Matrix* pUser2Device, |
416 const CPDF_RenderOptions* pOptions); | 355 const CPDF_RenderOptions* pOptions); |
417 | |
418 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); | 356 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); |
419 | 357 |
420 private: | 358 private: |
421 CPDF_Dictionary* const m_pAnnotDict; | 359 CPDF_Dictionary* const m_pAnnotDict; |
422 CPDF_AnnotList* const m_pList; | 360 CPDF_AnnotList* const m_pList; |
423 const CFX_ByteString m_sSubtype; | 361 const CFX_ByteString m_sSubtype; |
424 std::map<CPDF_Stream*, CPDF_Form*> m_APMap; | 362 std::map<CPDF_Stream*, CPDF_Form*> m_APMap; |
425 }; | 363 }; |
426 | 364 |
427 class CPDF_AnnotList { | 365 class CPDF_AnnotList { |
428 public: | 366 public: |
429 explicit CPDF_AnnotList(CPDF_Page* pPage); | 367 explicit CPDF_AnnotList(CPDF_Page* pPage); |
430 ~CPDF_AnnotList(); | 368 ~CPDF_AnnotList(); |
431 | 369 |
432 void DisplayAnnots(CPDF_Page* pPage, | 370 void DisplayAnnots(CPDF_Page* pPage, |
433 CPDF_RenderContext* pContext, | 371 CPDF_RenderContext* pContext, |
434 FX_BOOL bPrinting, | 372 FX_BOOL bPrinting, |
435 CFX_Matrix* pMatrix, | 373 CFX_Matrix* pMatrix, |
436 FX_BOOL bShowWidget, | 374 FX_BOOL bShowWidget, |
437 CPDF_RenderOptions* pOptions) { | 375 CPDF_RenderOptions* pOptions) { |
438 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, | 376 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, |
439 bShowWidget ? 3 : 1, pOptions, nullptr); | 377 bShowWidget ? 3 : 1, pOptions, nullptr); |
440 } | 378 } |
| 379 |
441 void DisplayAnnots(CPDF_Page* pPage, | 380 void DisplayAnnots(CPDF_Page* pPage, |
442 CFX_RenderDevice* pDevice, | 381 CFX_RenderDevice* pDevice, |
443 CPDF_RenderContext* pContext, | 382 CPDF_RenderContext* pContext, |
444 FX_BOOL bPrinting, | 383 FX_BOOL bPrinting, |
445 CFX_Matrix* pMatrix, | 384 CFX_Matrix* pMatrix, |
446 FX_DWORD dwAnnotFlags, | 385 FX_DWORD dwAnnotFlags, |
447 CPDF_RenderOptions* pOptions, | 386 CPDF_RenderOptions* pOptions, |
448 FX_RECT* pClipRect); | 387 FX_RECT* pClipRect); |
449 size_t Count() const { return m_AnnotList.size(); } | 388 size_t Count() const { return m_AnnotList.size(); } |
450 CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index]; } | 389 CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index]; } |
(...skipping 13 matching lines...) Expand all Loading... |
464 CPDF_Document* const m_pDocument; | 403 CPDF_Document* const m_pDocument; |
465 std::vector<CPDF_Annot*> m_AnnotList; | 404 std::vector<CPDF_Annot*> m_AnnotList; |
466 }; | 405 }; |
467 | 406 |
468 #define COLORTYPE_TRANSPARENT 0 | 407 #define COLORTYPE_TRANSPARENT 0 |
469 #define COLORTYPE_GRAY 1 | 408 #define COLORTYPE_GRAY 1 |
470 #define COLORTYPE_RGB 2 | 409 #define COLORTYPE_RGB 2 |
471 #define COLORTYPE_CMYK 3 | 410 #define COLORTYPE_CMYK 3 |
472 class CPDF_DefaultAppearance { | 411 class CPDF_DefaultAppearance { |
473 public: | 412 public: |
474 // TODO(thestig): Examine why this cannot be explicit. | 413 CPDF_DefaultAppearance() {} |
475 CPDF_DefaultAppearance(const CFX_ByteString& csDA = "") { m_csDA = csDA; } | 414 explicit CPDF_DefaultAppearance(const CFX_ByteString& csDA) : m_csDA(csDA) {} |
476 | 415 |
477 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { | 416 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { |
478 m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA; | 417 m_csDA = cDA.GetStr(); |
479 } | 418 } |
480 | 419 |
481 operator CFX_ByteString() const { return m_csDA; } | 420 CFX_ByteString GetStr() const { return m_csDA; } |
482 | |
483 const CPDF_DefaultAppearance& operator=(const CFX_ByteString& csDA) { | |
484 m_csDA = csDA; | |
485 return *this; | |
486 } | |
487 | |
488 const CPDF_DefaultAppearance& operator=(const CPDF_DefaultAppearance& cDA) { | |
489 m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA; | |
490 return *this; | |
491 } | |
492 | |
493 FX_BOOL HasFont(); | 421 FX_BOOL HasFont(); |
494 | |
495 CFX_ByteString GetFontString(); | 422 CFX_ByteString GetFontString(); |
496 | |
497 void GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize); | 423 void GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize); |
498 | |
499 FX_BOOL HasColor(FX_BOOL bStrokingOperation = FALSE); | 424 FX_BOOL HasColor(FX_BOOL bStrokingOperation = FALSE); |
500 | |
501 CFX_ByteString GetColorString(FX_BOOL bStrokingOperation = FALSE); | 425 CFX_ByteString GetColorString(FX_BOOL bStrokingOperation = FALSE); |
502 | |
503 void GetColor(int& iColorType, | 426 void GetColor(int& iColorType, |
504 FX_FLOAT fc[4], | 427 FX_FLOAT fc[4], |
505 FX_BOOL bStrokingOperation = FALSE); | 428 FX_BOOL bStrokingOperation = FALSE); |
506 | |
507 void GetColor(FX_ARGB& color, | 429 void GetColor(FX_ARGB& color, |
508 int& iColorType, | 430 int& iColorType, |
509 FX_BOOL bStrokingOperation = FALSE); | 431 FX_BOOL bStrokingOperation = FALSE); |
510 | |
511 FX_BOOL HasTextMatrix(); | 432 FX_BOOL HasTextMatrix(); |
512 | |
513 CFX_ByteString GetTextMatrixString(); | 433 CFX_ByteString GetTextMatrixString(); |
514 | |
515 CFX_Matrix GetTextMatrix(); | 434 CFX_Matrix GetTextMatrix(); |
516 | 435 |
517 protected: | 436 protected: |
518 CFX_ByteString m_csDA; | 437 CFX_ByteString m_csDA; |
519 }; | 438 }; |
| 439 |
520 #define FIELDTYPE_UNKNOWN 0 | 440 #define FIELDTYPE_UNKNOWN 0 |
521 #define FIELDTYPE_PUSHBUTTON 1 | 441 #define FIELDTYPE_PUSHBUTTON 1 |
522 #define FIELDTYPE_CHECKBOX 2 | 442 #define FIELDTYPE_CHECKBOX 2 |
523 #define FIELDTYPE_RADIOBUTTON 3 | 443 #define FIELDTYPE_RADIOBUTTON 3 |
524 #define FIELDTYPE_COMBOBOX 4 | 444 #define FIELDTYPE_COMBOBOX 4 |
525 #define FIELDTYPE_LISTBOX 5 | 445 #define FIELDTYPE_LISTBOX 5 |
526 #define FIELDTYPE_TEXTFIELD 6 | 446 #define FIELDTYPE_TEXTFIELD 6 |
527 #define FIELDTYPE_SIGNATURE 7 | 447 #define FIELDTYPE_SIGNATURE 7 |
528 class CPDF_InterForm : public CFX_PrivateData { | 448 class CPDF_InterForm : public CFX_PrivateData { |
529 public: | 449 public: |
530 CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bUpdateAP); | 450 CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bUpdateAP); |
531 ~CPDF_InterForm(); | 451 ~CPDF_InterForm(); |
532 | 452 |
533 static void EnableUpdateAP(FX_BOOL bUpdateAP); | 453 static void EnableUpdateAP(FX_BOOL bUpdateAP); |
534 | 454 |
535 static FX_BOOL UpdatingAPEnabled(); | 455 static FX_BOOL UpdatingAPEnabled(); |
536 | 456 |
537 static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, | 457 static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, |
538 const FX_CHAR* csType, | 458 const FX_CHAR* csType, |
539 int iMinLen = 2, | 459 int iMinLen = 2, |
540 const FX_CHAR* csPrefix = ""); | 460 const FX_CHAR* csPrefix = ""); |
541 | 461 |
542 static CPDF_Font* AddStandardFont(CPDF_Document* pDocument, | 462 static CPDF_Font* AddStandardFont(CPDF_Document* pDocument, |
543 CFX_ByteString csFontName); | 463 CFX_ByteString csFontName); |
544 | 464 |
545 static CFX_ByteString GetNativeFont(uint8_t iCharSet, void* pLogFont = NULL); | 465 static CFX_ByteString GetNativeFont(uint8_t iCharSet, |
| 466 void* pLogFont = nullptr); |
546 | 467 |
547 static CFX_ByteString GetNativeFont(void* pLogFont = NULL); | 468 static CFX_ByteString GetNativeFont(void* pLogFont = nullptr); |
548 | 469 |
549 static uint8_t GetNativeCharSet(); | 470 static uint8_t GetNativeCharSet(); |
550 | 471 |
551 static CPDF_Font* AddNativeFont(uint8_t iCharSet, CPDF_Document* pDocument); | 472 static CPDF_Font* AddNativeFont(uint8_t iCharSet, CPDF_Document* pDocument); |
552 | 473 |
553 static CPDF_Font* AddNativeFont(CPDF_Document* pDocument); | 474 static CPDF_Font* AddNativeFont(CPDF_Document* pDocument); |
554 | 475 |
555 FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType); | 476 FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType); |
556 | 477 |
557 FX_BOOL ValidateFieldName(const CPDF_FormField* pField, | 478 FX_BOOL ValidateFieldName(const CPDF_FormField* pField, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 std::unique_ptr<CFieldTree> m_pFieldTree; | 620 std::unique_ptr<CFieldTree> m_pFieldTree; |
700 | 621 |
701 CFX_ByteString m_bsEncoding; | 622 CFX_ByteString m_bsEncoding; |
702 | 623 |
703 CPDF_FormNotify* m_pFormNotify; | 624 CPDF_FormNotify* m_pFormNotify; |
704 | 625 |
705 FX_BOOL m_bUpdated; | 626 FX_BOOL m_bUpdated; |
706 friend class CPDF_FormControl; | 627 friend class CPDF_FormControl; |
707 friend class CPDF_FormField; | 628 friend class CPDF_FormField; |
708 }; | 629 }; |
| 630 |
709 #define FORMFIELD_READONLY 0x01 | 631 #define FORMFIELD_READONLY 0x01 |
710 #define FORMFIELD_REQUIRED 0x02 | 632 #define FORMFIELD_REQUIRED 0x02 |
711 #define FORMFIELD_NOEXPORT 0x04 | 633 #define FORMFIELD_NOEXPORT 0x04 |
712 #define FORMRADIO_NOTOGGLEOFF 0x100 | 634 #define FORMRADIO_NOTOGGLEOFF 0x100 |
713 #define FORMRADIO_UNISON 0x200 | 635 #define FORMRADIO_UNISON 0x200 |
714 #define FORMTEXT_MULTILINE 0x100 | 636 #define FORMTEXT_MULTILINE 0x100 |
715 #define FORMTEXT_PASSWORD 0x200 | 637 #define FORMTEXT_PASSWORD 0x200 |
716 #define FORMTEXT_NOSCROLL 0x400 | 638 #define FORMTEXT_NOSCROLL 0x400 |
717 #define FORMTEXT_COMB 0x800 | 639 #define FORMTEXT_COMB 0x800 |
718 #define FORMCOMBO_EDIT 0x100 | 640 #define FORMCOMBO_EDIT 0x100 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 FX_DWORD m_Flags; | 778 FX_DWORD m_Flags; |
857 CPDF_InterForm* m_pForm; | 779 CPDF_InterForm* m_pForm; |
858 CPDF_Dictionary* m_pDict; | 780 CPDF_Dictionary* m_pDict; |
859 CFX_ArrayTemplate<CPDF_FormControl*> m_ControlList; | 781 CFX_ArrayTemplate<CPDF_FormControl*> m_ControlList; |
860 FX_FLOAT m_FontSize; | 782 FX_FLOAT m_FontSize; |
861 CPDF_Font* m_pFont; | 783 CPDF_Font* m_pFont; |
862 | 784 |
863 friend class CPDF_InterForm; | 785 friend class CPDF_InterForm; |
864 friend class CPDF_FormControl; | 786 friend class CPDF_FormControl; |
865 }; | 787 }; |
| 788 |
866 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, | 789 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, |
867 const FX_CHAR* name, | 790 const FX_CHAR* name, |
868 int nLevel = 0); | 791 int nLevel = 0); |
869 class CPDF_IconFit { | 792 class CPDF_IconFit { |
870 public: | 793 public: |
871 // TODO(thestig): Examine why this cannot be explicit. | |
872 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | |
873 | |
874 operator CPDF_Dictionary*() const { return m_pDict; } | |
875 | |
876 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; | 794 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; |
877 | 795 |
| 796 explicit CPDF_IconFit(const CPDF_Dictionary* pDict) : m_pDict(pDict) {} |
| 797 |
878 ScaleMethod GetScaleMethod(); | 798 ScaleMethod GetScaleMethod(); |
| 799 FX_BOOL IsProportionalScale(); |
| 800 void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom); |
| 801 FX_BOOL GetFittingBounds(); |
| 802 const CPDF_Dictionary* GetDict() const { return m_pDict; } |
879 | 803 |
880 FX_BOOL IsProportionalScale(); | 804 protected: |
881 | 805 const CPDF_Dictionary* const m_pDict; |
882 void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom); | |
883 | |
884 FX_BOOL GetFittingBounds(); | |
885 | |
886 CPDF_Dictionary* m_pDict; | |
887 }; | 806 }; |
888 | 807 |
889 #define TEXTPOS_CAPTION 0 | 808 #define TEXTPOS_CAPTION 0 |
890 #define TEXTPOS_ICON 1 | 809 #define TEXTPOS_ICON 1 |
891 #define TEXTPOS_BELOW 2 | 810 #define TEXTPOS_BELOW 2 |
892 #define TEXTPOS_ABOVE 3 | 811 #define TEXTPOS_ABOVE 3 |
893 #define TEXTPOS_RIGHT 4 | 812 #define TEXTPOS_RIGHT 4 |
894 #define TEXTPOS_LEFT 5 | 813 #define TEXTPOS_LEFT 5 |
895 #define TEXTPOS_OVERLAID 6 | 814 #define TEXTPOS_OVERLAID 6 |
896 | 815 |
897 class CPDF_FormControl { | 816 class CPDF_FormControl { |
898 public: | 817 public: |
899 enum HighlightingMode { None = 0, Invert, Outline, Push, Toggle }; | 818 enum HighlightingMode { None = 0, Invert, Outline, Push, Toggle }; |
900 | 819 |
901 CPDF_FormField::Type GetType() const { return m_pField->GetType(); } | 820 CPDF_FormField::Type GetType() const { return m_pField->GetType(); } |
902 CPDF_InterForm* GetInterForm() const { return m_pForm; } | 821 CPDF_InterForm* GetInterForm() const { return m_pForm; } |
903 CPDF_FormField* GetField() const { return m_pField; } | 822 CPDF_FormField* GetField() const { return m_pField; } |
904 CPDF_Dictionary* GetWidget() const { return m_pWidgetDict; } | 823 CPDF_Dictionary* GetWidget() const { return m_pWidgetDict; } |
905 CFX_FloatRect GetRect() const; | 824 CFX_FloatRect GetRect() const; |
906 | 825 |
907 void DrawControl(CFX_RenderDevice* pDevice, | 826 void DrawControl(CFX_RenderDevice* pDevice, |
908 CFX_Matrix* pMatrix, | 827 CFX_Matrix* pMatrix, |
909 CPDF_Page* pPage, | 828 CPDF_Page* pPage, |
910 CPDF_Annot::AppearanceMode mode, | 829 CPDF_Annot::AppearanceMode mode, |
911 const CPDF_RenderOptions* pOptions = NULL); | 830 const CPDF_RenderOptions* pOptions = nullptr); |
912 | 831 |
913 CFX_ByteString GetCheckedAPState(); | 832 CFX_ByteString GetCheckedAPState(); |
914 CFX_WideString GetExportValue(); | 833 CFX_WideString GetExportValue(); |
915 | 834 |
916 bool IsChecked() const; | 835 bool IsChecked() const; |
917 bool IsDefaultChecked() const; | 836 bool IsDefaultChecked() const; |
918 | 837 |
919 HighlightingMode GetHighlightingMode(); | 838 HighlightingMode GetHighlightingMode(); |
920 bool HasMKEntry(CFX_ByteString csEntry) const; | 839 bool HasMKEntry(CFX_ByteString csEntry) const; |
921 int GetRotation(); | 840 int GetRotation(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 } | 935 } |
1017 virtual void AfterSelectionChange(CPDF_FormField* pField) {} | 936 virtual void AfterSelectionChange(CPDF_FormField* pField) {} |
1018 virtual void AfterCheckedStatusChange(CPDF_FormField* pField) {} | 937 virtual void AfterCheckedStatusChange(CPDF_FormField* pField) {} |
1019 virtual int BeforeFormReset(CPDF_InterForm* pForm) { return 0; } | 938 virtual int BeforeFormReset(CPDF_InterForm* pForm) { return 0; } |
1020 virtual void AfterFormReset(CPDF_InterForm* pForm) {} | 939 virtual void AfterFormReset(CPDF_InterForm* pForm) {} |
1021 virtual int BeforeFormImportData(CPDF_InterForm* pForm) { return 0; } | 940 virtual int BeforeFormImportData(CPDF_InterForm* pForm) { return 0; } |
1022 virtual void AfterFormImportData(CPDF_InterForm* pForm) {} | 941 virtual void AfterFormImportData(CPDF_InterForm* pForm) {} |
1023 }; | 942 }; |
1024 | 943 |
1025 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); | 944 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); |
| 945 |
1026 class CPDF_PageLabel { | 946 class CPDF_PageLabel { |
1027 public: | 947 public: |
1028 explicit CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } | 948 explicit CPDF_PageLabel(CPDF_Document* pDocument) : m_pDocument(pDocument) {} |
1029 | 949 |
1030 CFX_WideString GetLabel(int nPage) const; | 950 CFX_WideString GetLabel(int nPage) const; |
1031 | |
1032 int32_t GetPageByLabel(const CFX_ByteStringC& bsLabel) const; | 951 int32_t GetPageByLabel(const CFX_ByteStringC& bsLabel) const; |
1033 | |
1034 int32_t GetPageByLabel(const CFX_WideStringC& wsLabel) const; | 952 int32_t GetPageByLabel(const CFX_WideStringC& wsLabel) const; |
1035 | 953 |
1036 protected: | 954 protected: |
1037 CPDF_Document* m_pDocument; | 955 CPDF_Document* const m_pDocument; |
1038 }; | 956 }; |
1039 | 957 |
1040 class CPDF_Metadata { | 958 class CPDF_Metadata { |
1041 public: | 959 public: |
1042 explicit CPDF_Metadata(CPDF_Document* pDoc); | 960 explicit CPDF_Metadata(CPDF_Document* pDoc); |
1043 ~CPDF_Metadata(); | 961 ~CPDF_Metadata(); |
1044 | 962 |
1045 const CXML_Element* GetRoot() const; | 963 const CXML_Element* GetRoot() const; |
1046 | 964 |
1047 private: | 965 private: |
1048 std::unique_ptr<CXML_Element> m_pXmlElement; | 966 std::unique_ptr<CXML_Element> m_pXmlElement; |
1049 }; | 967 }; |
1050 | 968 |
1051 class CPDF_ViewerPreferences { | 969 class CPDF_ViewerPreferences { |
1052 public: | 970 public: |
1053 explicit CPDF_ViewerPreferences(CPDF_Document* pDoc); | 971 explicit CPDF_ViewerPreferences(CPDF_Document* pDoc); |
1054 | |
1055 ~CPDF_ViewerPreferences(); | 972 ~CPDF_ViewerPreferences(); |
1056 | 973 |
1057 FX_BOOL IsDirectionR2L() const; | 974 FX_BOOL IsDirectionR2L() const; |
1058 | |
1059 FX_BOOL PrintScaling() const; | 975 FX_BOOL PrintScaling() const; |
1060 | |
1061 int32_t NumCopies() const; | 976 int32_t NumCopies() const; |
1062 | |
1063 CPDF_Array* PrintPageRange() const; | 977 CPDF_Array* PrintPageRange() const; |
1064 | |
1065 CFX_ByteString Duplex() const; | 978 CFX_ByteString Duplex() const; |
1066 | 979 |
1067 protected: | 980 protected: |
1068 CPDF_Document* const m_pDoc; | 981 CPDF_Document* const m_pDoc; |
1069 }; | 982 }; |
1070 | 983 |
1071 class CPDF_ApSettings { | 984 class CPDF_ApSettings { |
1072 public: | 985 public: |
1073 explicit CPDF_ApSettings(CPDF_Dictionary* pDict); | 986 explicit CPDF_ApSettings(CPDF_Dictionary* pDict); |
1074 | 987 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry) const; | 1042 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry) const; |
1130 | 1043 |
1131 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry) const; | 1044 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry) const; |
1132 | 1045 |
1133 CPDF_Dictionary* const m_pDict; | 1046 CPDF_Dictionary* const m_pDict; |
1134 }; | 1047 }; |
1135 | 1048 |
1136 CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath); | 1049 CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath); |
1137 | 1050 |
1138 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 1051 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
OLD | NEW |