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 CPDF_NameTree(CPDF_Dictionary* pRoot) { m_pRoot = pRoot; } | 47 explicit CPDF_NameTree(CPDF_Dictionary* pRoot) { m_pRoot = pRoot; } |
48 | 48 |
49 CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteStringC& category); | 49 CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteStringC& category); |
50 | 50 |
51 CPDF_Object* LookupValue(int nIndex, CFX_ByteString& csName) const; | 51 CPDF_Object* LookupValue(int nIndex, CFX_ByteString& csName) const; |
52 | 52 |
53 CPDF_Object* LookupValue(const CFX_ByteString& csName) const; | 53 CPDF_Object* LookupValue(const CFX_ByteString& csName) const; |
54 | 54 |
55 CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, | 55 CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, |
56 const CFX_ByteStringC& sName); | 56 const CFX_ByteStringC& sName); |
57 | 57 |
58 int GetIndex(const CFX_ByteString& csName) const; | 58 int GetIndex(const CFX_ByteString& csName) const; |
59 | 59 |
60 int GetCount() const; | 60 int GetCount() const; |
61 | 61 |
62 CPDF_Dictionary* GetRoot() const { return m_pRoot; } | 62 CPDF_Dictionary* GetRoot() const { return m_pRoot; } |
63 | 63 |
64 protected: | 64 protected: |
65 CPDF_Dictionary* m_pRoot; | 65 CPDF_Dictionary* m_pRoot; |
66 }; | 66 }; |
67 class CPDF_BookmarkTree { | 67 class CPDF_BookmarkTree { |
68 public: | 68 public: |
69 CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} | 69 explicit CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} |
70 | 70 |
71 CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const; | 71 CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const; |
72 | 72 |
73 CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) const; | 73 CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) const; |
74 | 74 |
75 CPDF_Document* GetDocument() const { return m_pDocument; } | 75 CPDF_Document* GetDocument() const { return m_pDocument; } |
76 | 76 |
77 protected: | 77 protected: |
78 CPDF_Document* m_pDocument; | 78 CPDF_Document* m_pDocument; |
79 }; | 79 }; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 int GetZoomMode(); | 123 int GetZoomMode(); |
124 FX_FLOAT GetParam(int index); | 124 FX_FLOAT GetParam(int index); |
125 | 125 |
126 protected: | 126 protected: |
127 CPDF_Object* m_pObj; | 127 CPDF_Object* m_pObj; |
128 }; | 128 }; |
129 class CPDF_OCContext : public IPDF_OCContext { | 129 class CPDF_OCContext : public IPDF_OCContext { |
130 public: | 130 public: |
131 enum UsageType { View = 0, Design, Print, Export }; | 131 enum UsageType { View = 0, Design, Print, Export }; |
132 | 132 |
133 CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View); | 133 explicit CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType = View); |
134 ~CPDF_OCContext() override; | 134 ~CPDF_OCContext() override; |
135 | 135 |
136 CPDF_Document* GetDocument() const { return m_pDocument; } | 136 CPDF_Document* GetDocument() const { return m_pDocument; } |
137 | 137 |
138 UsageType GetUsageType() const { return m_eUsageType; } | 138 UsageType GetUsageType() const { return m_eUsageType; } |
139 | 139 |
140 FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict) override; | 140 FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCGDict) override; |
141 | 141 |
142 void ResetOCContext(); | 142 void ResetOCContext(); |
143 | 143 |
(...skipping 14 matching lines...) Expand all Loading... |
158 | 158 |
159 CPDF_Document* m_pDocument; | 159 CPDF_Document* m_pDocument; |
160 | 160 |
161 UsageType m_eUsageType; | 161 UsageType m_eUsageType; |
162 | 162 |
163 std::map<const CPDF_Dictionary*, FX_BOOL> m_OCGStates; | 163 std::map<const CPDF_Dictionary*, FX_BOOL> m_OCGStates; |
164 }; | 164 }; |
165 | 165 |
166 class CPDF_ActionFields { | 166 class CPDF_ActionFields { |
167 public: | 167 public: |
| 168 // TODO(thestig): Examine why this cannot be explicit. |
168 CPDF_ActionFields(const CPDF_Action* pAction) { | 169 CPDF_ActionFields(const CPDF_Action* pAction) { |
169 m_pAction = (CPDF_Action*)pAction; | 170 m_pAction = (CPDF_Action*)pAction; |
170 } | 171 } |
171 | 172 |
| 173 // TODO(thestig): Replace this. |
172 operator CPDF_Action*() const { return m_pAction; } | 174 operator CPDF_Action*() const { return m_pAction; } |
173 | 175 |
174 FX_DWORD GetFieldsCount() const; | 176 FX_DWORD GetFieldsCount() const; |
175 | 177 |
176 void GetAllFields(CFX_PtrArray& fieldObjects) const; | 178 std::vector<CPDF_Object*> GetAllFields() const; |
177 | 179 |
178 CPDF_Object* GetField(FX_DWORD iIndex) const; | 180 CPDF_Object* GetField(FX_DWORD iIndex) const; |
179 | 181 |
180 CPDF_Action* m_pAction; | 182 CPDF_Action* m_pAction; |
181 }; | 183 }; |
182 | 184 |
183 #define PDFNAMED_NEXTPAGE 1 | 185 #define PDFNAMED_NEXTPAGE 1 |
184 #define PDFNAMED_PREVPAGE 2 | 186 #define PDFNAMED_PREVPAGE 2 |
185 #define PDFNAMED_FIRSTPAGE 3 | 187 #define PDFNAMED_FIRSTPAGE 3 |
186 #define PDFNAMED_LASTPAGE 4 | 188 #define PDFNAMED_LASTPAGE 4 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 258 |
257 FX_DWORD GetSubActionsCount() const; | 259 FX_DWORD GetSubActionsCount() const; |
258 | 260 |
259 CPDF_Action GetSubAction(FX_DWORD iIndex) const; | 261 CPDF_Action GetSubAction(FX_DWORD iIndex) const; |
260 | 262 |
261 protected: | 263 protected: |
262 CPDF_Dictionary* m_pDict; | 264 CPDF_Dictionary* m_pDict; |
263 }; | 265 }; |
264 class CPDF_AAction { | 266 class CPDF_AAction { |
265 public: | 267 public: |
| 268 // TODO(thestig): Examine why this cannot be explicit. |
266 CPDF_AAction(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 269 CPDF_AAction(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
267 | 270 |
268 operator CPDF_Dictionary*() const { return m_pDict; } | 271 operator CPDF_Dictionary*() const { return m_pDict; } |
269 | 272 |
270 enum AActionType { | 273 enum AActionType { |
271 CursorEnter = 0, | 274 CursorEnter = 0, |
272 CursorExit, | 275 CursorExit, |
273 ButtonDown, | 276 ButtonDown, |
274 ButtonUp, | 277 ButtonUp, |
275 GetFocus, | 278 GetFocus, |
(...skipping 20 matching lines...) Expand all Loading... |
296 CPDF_Action GetAction(AActionType eType) const; | 299 CPDF_Action GetAction(AActionType eType) const; |
297 | 300 |
298 FX_POSITION GetStartPos() const; | 301 FX_POSITION GetStartPos() const; |
299 | 302 |
300 CPDF_Action GetNextAction(FX_POSITION& pos, AActionType& eType) const; | 303 CPDF_Action GetNextAction(FX_POSITION& pos, AActionType& eType) const; |
301 | 304 |
302 CPDF_Dictionary* m_pDict; | 305 CPDF_Dictionary* m_pDict; |
303 }; | 306 }; |
304 class CPDF_DocJSActions { | 307 class CPDF_DocJSActions { |
305 public: | 308 public: |
306 CPDF_DocJSActions(CPDF_Document* pDoc); | 309 explicit CPDF_DocJSActions(CPDF_Document* pDoc); |
307 | 310 |
308 int CountJSActions() const; | 311 int CountJSActions() const; |
309 | 312 |
310 CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const; | 313 CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const; |
311 | 314 |
312 CPDF_Action GetJSAction(const CFX_ByteString& csName) const; | 315 CPDF_Action GetJSAction(const CFX_ByteString& csName) const; |
313 | 316 |
314 int FindJSAction(const CFX_ByteString& csName) const; | 317 int FindJSAction(const CFX_ByteString& csName) const; |
315 | 318 |
316 CPDF_Document* GetDocument() const { return m_pDocument; } | 319 CPDF_Document* GetDocument() const { return m_pDocument; } |
317 | 320 |
318 protected: | 321 protected: |
319 CPDF_Document* m_pDocument; | 322 CPDF_Document* const m_pDocument; |
320 }; | 323 }; |
321 class CPDF_FileSpec { | 324 class CPDF_FileSpec { |
322 public: | 325 public: |
323 CPDF_FileSpec(); | 326 CPDF_FileSpec(); |
324 | 327 |
325 CPDF_FileSpec(CPDF_Object* pObj) { m_pObj = pObj; } | 328 explicit CPDF_FileSpec(CPDF_Object* pObj) { m_pObj = pObj; } |
326 | 329 |
327 operator CPDF_Object*() const { return m_pObj; } | 330 operator CPDF_Object*() const { return m_pObj; } |
328 | 331 |
329 FX_BOOL IsURL() const; | 332 FX_BOOL IsURL() const; |
330 | 333 |
331 FX_BOOL GetFileName(CFX_WideString& wsFileName) const; | 334 FX_BOOL GetFileName(CFX_WideString& wsFileName) const; |
332 | 335 |
333 CPDF_Stream* GetFileStream() const; | 336 CPDF_Stream* GetFileStream() const; |
334 | 337 |
335 void SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL = FALSE); | 338 void SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL = FALSE); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 CPDF_Document* const m_pDocument; | 469 CPDF_Document* const m_pDocument; |
467 std::vector<CPDF_Annot*> m_AnnotList; | 470 std::vector<CPDF_Annot*> m_AnnotList; |
468 }; | 471 }; |
469 | 472 |
470 #define COLORTYPE_TRANSPARENT 0 | 473 #define COLORTYPE_TRANSPARENT 0 |
471 #define COLORTYPE_GRAY 1 | 474 #define COLORTYPE_GRAY 1 |
472 #define COLORTYPE_RGB 2 | 475 #define COLORTYPE_RGB 2 |
473 #define COLORTYPE_CMYK 3 | 476 #define COLORTYPE_CMYK 3 |
474 class CPDF_DefaultAppearance { | 477 class CPDF_DefaultAppearance { |
475 public: | 478 public: |
| 479 // TODO(thestig): Examine why this cannot be explicit. |
476 CPDF_DefaultAppearance(const CFX_ByteString& csDA = "") { m_csDA = csDA; } | 480 CPDF_DefaultAppearance(const CFX_ByteString& csDA = "") { m_csDA = csDA; } |
477 | 481 |
478 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { | 482 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { |
479 m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA; | 483 m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA; |
480 } | 484 } |
481 | 485 |
482 operator CFX_ByteString() const { return m_csDA; } | 486 operator CFX_ByteString() const { return m_csDA; } |
483 | 487 |
484 const CPDF_DefaultAppearance& operator=(const CFX_ByteString& csDA) { | 488 const CPDF_DefaultAppearance& operator=(const CFX_ByteString& csDA) { |
485 m_csDA = csDA; | 489 m_csDA = csDA; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl, | 576 FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl, |
573 CFX_WideString& csNewFieldName); | 577 CFX_WideString& csNewFieldName); |
574 | 578 |
575 FX_DWORD CountFields(const CFX_WideString& csFieldName = L""); | 579 FX_DWORD CountFields(const CFX_WideString& csFieldName = L""); |
576 | 580 |
577 CPDF_FormField* GetField(FX_DWORD index, | 581 CPDF_FormField* GetField(FX_DWORD index, |
578 const CFX_WideString& csFieldName = L""); | 582 const CFX_WideString& csFieldName = L""); |
579 | 583 |
580 void GetAllFieldNames(CFX_WideStringArray& allFieldNames); | 584 void GetAllFieldNames(CFX_WideStringArray& allFieldNames); |
581 | 585 |
582 FX_BOOL IsValidFormField(const void* pField); | |
583 | |
584 CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; | 586 CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; |
585 | 587 |
586 CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, | 588 CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, |
587 FX_FLOAT pdf_x, | 589 FX_FLOAT pdf_x, |
588 FX_FLOAT pdf_y, | 590 FX_FLOAT pdf_y, |
589 int* z_order) const; | 591 int* z_order) const; |
590 | 592 |
591 CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const; | 593 CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const; |
592 | 594 |
593 CPDF_Document* GetDocument() const { return m_pDocument; } | 595 CPDF_Document* GetDocument() const { return m_pDocument; } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 void RemoveFormFont(const CPDF_Font* pFont); | 639 void RemoveFormFont(const CPDF_Font* pFont); |
638 | 640 |
639 void RemoveFormFont(CFX_ByteString csNameTag); | 641 void RemoveFormFont(CFX_ByteString csNameTag); |
640 | 642 |
641 CPDF_DefaultAppearance GetDefaultAppearance(); | 643 CPDF_DefaultAppearance GetDefaultAppearance(); |
642 | 644 |
643 CPDF_Font* GetDefaultFormFont(); | 645 CPDF_Font* GetDefaultFormFont(); |
644 | 646 |
645 int GetFormAlignment(); | 647 int GetFormAlignment(); |
646 | 648 |
647 CPDF_FormField* CheckRequiredFields(const CFX_PtrArray* fields = NULL, | 649 CPDF_FormField* CheckRequiredFields( |
648 FX_BOOL bIncludeOrExclude = TRUE) const; | 650 const std::vector<CPDF_FormField*>* fields, |
| 651 bool bIncludeOrExclude) const; |
649 | 652 |
650 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, | 653 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, |
651 FX_BOOL bSimpleFileSpec = FALSE) const; | 654 bool bSimpleFileSpec = false) const; |
652 | 655 |
653 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, | 656 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, |
654 CFX_PtrArray& fields, | 657 const std::vector<CPDF_FormField*>& fields, |
655 FX_BOOL bIncludeOrExclude = TRUE, | 658 bool bIncludeOrExclude = true, |
656 FX_BOOL bSimpleFileSpec = FALSE) const; | 659 bool bSimpleFileSpec = false) const; |
657 | 660 |
658 FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE); | 661 FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE); |
659 | 662 |
660 FX_BOOL ResetForm(const CFX_PtrArray& fields, | 663 bool ResetForm(const std::vector<CPDF_FormField*>& fields, |
661 FX_BOOL bIncludeOrExclude = TRUE, | 664 bool bIncludeOrExclude = true, |
662 FX_BOOL bNotify = FALSE); | 665 bool bNotify = false); |
663 | 666 |
664 FX_BOOL ResetForm(FX_BOOL bNotify = FALSE); | 667 bool ResetForm(bool bNotify = false); |
665 | 668 |
666 CPDF_FormNotify* GetFormNotify() const { return m_pFormNotify; } | 669 CPDF_FormNotify* GetFormNotify() const { return m_pFormNotify; } |
667 | 670 |
668 void SetFormNotify(const CPDF_FormNotify* pNotify); | 671 void SetFormNotify(const CPDF_FormNotify* pNotify); |
669 | 672 |
670 FX_BOOL IsUpdated() { return m_bUpdated; } | 673 FX_BOOL IsUpdated() { return m_bUpdated; } |
671 | 674 |
672 void ClearUpdatedFlag() { m_bUpdated = FALSE; } | 675 void ClearUpdatedFlag() { m_bUpdated = FALSE; } |
673 | 676 |
674 FX_BOOL HasXFAForm() const; | 677 FX_BOOL HasXFAForm() const; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 | 881 |
879 FX_FLOAT m_FontSize; | 882 FX_FLOAT m_FontSize; |
880 | 883 |
881 CPDF_Font* m_pFont; | 884 CPDF_Font* m_pFont; |
882 }; | 885 }; |
883 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, | 886 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, |
884 const FX_CHAR* name, | 887 const FX_CHAR* name, |
885 int nLevel = 0); | 888 int nLevel = 0); |
886 class CPDF_IconFit { | 889 class CPDF_IconFit { |
887 public: | 890 public: |
| 891 // TODO(thestig): Examine why this cannot be explicit. |
888 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 892 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
889 | 893 |
890 operator CPDF_Dictionary*() const { return m_pDict; } | 894 operator CPDF_Dictionary*() const { return m_pDict; } |
891 | 895 |
892 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; | 896 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; |
893 | 897 |
894 ScaleMethod GetScaleMethod(); | 898 ScaleMethod GetScaleMethod(); |
895 | 899 |
896 FX_BOOL IsProportionalScale(); | 900 FX_BOOL IsProportionalScale(); |
897 | 901 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 | 1055 |
1052 virtual int AfterFormReset(const CPDF_InterForm* pForm) { return 0; } | 1056 virtual int AfterFormReset(const CPDF_InterForm* pForm) { return 0; } |
1053 | 1057 |
1054 virtual int BeforeFormImportData(const CPDF_InterForm* pForm) { return 0; } | 1058 virtual int BeforeFormImportData(const CPDF_InterForm* pForm) { return 0; } |
1055 | 1059 |
1056 virtual int AfterFormImportData(const CPDF_InterForm* pForm) { return 0; } | 1060 virtual int AfterFormImportData(const CPDF_InterForm* pForm) { return 0; } |
1057 }; | 1061 }; |
1058 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); | 1062 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); |
1059 class CPDF_PageLabel { | 1063 class CPDF_PageLabel { |
1060 public: | 1064 public: |
1061 CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } | 1065 explicit CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } |
1062 | 1066 |
1063 CFX_WideString GetLabel(int nPage) const; | 1067 CFX_WideString GetLabel(int nPage) const; |
1064 | 1068 |
1065 int32_t GetPageByLabel(const CFX_ByteStringC& bsLabel) const; | 1069 int32_t GetPageByLabel(const CFX_ByteStringC& bsLabel) const; |
1066 | 1070 |
1067 int32_t GetPageByLabel(const CFX_WideStringC& wsLabel) const; | 1071 int32_t GetPageByLabel(const CFX_WideStringC& wsLabel) const; |
1068 | 1072 |
1069 protected: | 1073 protected: |
1070 CPDF_Document* m_pDocument; | 1074 CPDF_Document* m_pDocument; |
1071 }; | 1075 }; |
1072 | 1076 |
1073 class CPDF_Metadata { | 1077 class CPDF_Metadata { |
1074 public: | 1078 public: |
1075 explicit CPDF_Metadata(CPDF_Document* pDoc); | 1079 explicit CPDF_Metadata(CPDF_Document* pDoc); |
1076 ~CPDF_Metadata(); | 1080 ~CPDF_Metadata(); |
1077 | 1081 |
1078 const CXML_Element* GetRoot() const; | 1082 const CXML_Element* GetRoot() const; |
1079 | 1083 |
1080 private: | 1084 private: |
1081 nonstd::unique_ptr<CXML_Element> m_pXmlElement; | 1085 nonstd::unique_ptr<CXML_Element> m_pXmlElement; |
1082 }; | 1086 }; |
1083 | 1087 |
1084 class CPDF_ViewerPreferences { | 1088 class CPDF_ViewerPreferences { |
1085 public: | 1089 public: |
1086 CPDF_ViewerPreferences(CPDF_Document* pDoc); | 1090 explicit CPDF_ViewerPreferences(CPDF_Document* pDoc); |
1087 | 1091 |
1088 ~CPDF_ViewerPreferences(); | 1092 ~CPDF_ViewerPreferences(); |
1089 | 1093 |
1090 FX_BOOL IsDirectionR2L() const; | 1094 FX_BOOL IsDirectionR2L() const; |
1091 | 1095 |
1092 FX_BOOL PrintScaling() const; | 1096 FX_BOOL PrintScaling() const; |
1093 | 1097 |
1094 int32_t NumCopies() const; | 1098 int32_t NumCopies() const; |
1095 | 1099 |
1096 CPDF_Array* PrintPageRange() const; | 1100 CPDF_Array* PrintPageRange() const; |
1097 | 1101 |
1098 CFX_ByteString Duplex() const; | 1102 CFX_ByteString Duplex() const; |
1099 | 1103 |
1100 protected: | 1104 protected: |
1101 CPDF_Document* m_pDoc; | 1105 CPDF_Document* const m_pDoc; |
1102 }; | 1106 }; |
| 1107 |
1103 class CPDF_ApSettings { | 1108 class CPDF_ApSettings { |
1104 public: | 1109 public: |
| 1110 // TODO(thestig): Examine why this cannot be explicit. |
1105 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 1111 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
1106 | 1112 |
1107 operator CPDF_Dictionary*() const { return m_pDict; } | 1113 operator CPDF_Dictionary*() const { return m_pDict; } |
1108 | 1114 |
1109 FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry); | 1115 FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry); |
1110 | 1116 |
1111 int GetRotation(); | 1117 int GetRotation(); |
1112 | 1118 |
1113 inline FX_ARGB GetBorderColor(int& iColorType) { | 1119 inline FX_ARGB GetBorderColor(int& iColorType) { |
1114 return GetColor(iColorType, FX_BSTRC("BC")); | 1120 return GetColor(iColorType, FX_BSTRC("BC")); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 FX_FLOAT fc[4], | 1171 FX_FLOAT fc[4], |
1166 const CFX_ByteStringC& csEntry); | 1172 const CFX_ByteStringC& csEntry); |
1167 | 1173 |
1168 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry); | 1174 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry); |
1169 | 1175 |
1170 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry); | 1176 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry); |
1171 friend class CPDF_FormControl; | 1177 friend class CPDF_FormControl; |
1172 }; | 1178 }; |
1173 | 1179 |
1174 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 1180 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
OLD | NEW |