| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 | 887 |
| 885 FX_FLOAT m_FontSize; | 888 FX_FLOAT m_FontSize; |
| 886 | 889 |
| 887 CPDF_Font* m_pFont; | 890 CPDF_Font* m_pFont; |
| 888 }; | 891 }; |
| 889 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, | 892 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, |
| 890 const FX_CHAR* name, | 893 const FX_CHAR* name, |
| 891 int nLevel = 0); | 894 int nLevel = 0); |
| 892 class CPDF_IconFit { | 895 class CPDF_IconFit { |
| 893 public: | 896 public: |
| 897 // TODO(thestig): Examine why this cannot be explicit. |
| 894 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 898 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
| 895 | 899 |
| 896 operator CPDF_Dictionary*() const { return m_pDict; } | 900 operator CPDF_Dictionary*() const { return m_pDict; } |
| 897 | 901 |
| 898 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; | 902 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; |
| 899 | 903 |
| 900 ScaleMethod GetScaleMethod(); | 904 ScaleMethod GetScaleMethod(); |
| 901 | 905 |
| 902 FX_BOOL IsProportionalScale(); | 906 FX_BOOL IsProportionalScale(); |
| 903 | 907 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 | 1061 |
| 1058 virtual int AfterFormReset(const CPDF_InterForm* pForm) { return 0; } | 1062 virtual int AfterFormReset(const CPDF_InterForm* pForm) { return 0; } |
| 1059 | 1063 |
| 1060 virtual int BeforeFormImportData(const CPDF_InterForm* pForm) { return 0; } | 1064 virtual int BeforeFormImportData(const CPDF_InterForm* pForm) { return 0; } |
| 1061 | 1065 |
| 1062 virtual int AfterFormImportData(const CPDF_InterForm* pForm) { return 0; } | 1066 virtual int AfterFormImportData(const CPDF_InterForm* pForm) { return 0; } |
| 1063 }; | 1067 }; |
| 1064 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); | 1068 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); |
| 1065 class CPDF_PageLabel { | 1069 class CPDF_PageLabel { |
| 1066 public: | 1070 public: |
| 1067 CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } | 1071 explicit CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } |
| 1068 | 1072 |
| 1069 CFX_WideString GetLabel(int nPage) const; | 1073 CFX_WideString GetLabel(int nPage) const; |
| 1070 | 1074 |
| 1071 int32_t GetPageByLabel(const CFX_ByteStringC& bsLabel) const; | 1075 int32_t GetPageByLabel(const CFX_ByteStringC& bsLabel) const; |
| 1072 | 1076 |
| 1073 int32_t GetPageByLabel(const CFX_WideStringC& wsLabel) const; | 1077 int32_t GetPageByLabel(const CFX_WideStringC& wsLabel) const; |
| 1074 | 1078 |
| 1075 protected: | 1079 protected: |
| 1076 CPDF_Document* m_pDocument; | 1080 CPDF_Document* m_pDocument; |
| 1077 }; | 1081 }; |
| 1078 | 1082 |
| 1079 class CPDF_Metadata { | 1083 class CPDF_Metadata { |
| 1080 public: | 1084 public: |
| 1081 explicit CPDF_Metadata(CPDF_Document* pDoc); | 1085 explicit CPDF_Metadata(CPDF_Document* pDoc); |
| 1082 ~CPDF_Metadata(); | 1086 ~CPDF_Metadata(); |
| 1083 | 1087 |
| 1084 const CXML_Element* GetRoot() const; | 1088 const CXML_Element* GetRoot() const; |
| 1085 | 1089 |
| 1086 private: | 1090 private: |
| 1087 nonstd::unique_ptr<CXML_Element> m_pXmlElement; | 1091 nonstd::unique_ptr<CXML_Element> m_pXmlElement; |
| 1088 }; | 1092 }; |
| 1089 | 1093 |
| 1090 class CPDF_ViewerPreferences { | 1094 class CPDF_ViewerPreferences { |
| 1091 public: | 1095 public: |
| 1092 CPDF_ViewerPreferences(CPDF_Document* pDoc); | 1096 explicit CPDF_ViewerPreferences(CPDF_Document* pDoc); |
| 1093 | 1097 |
| 1094 ~CPDF_ViewerPreferences(); | 1098 ~CPDF_ViewerPreferences(); |
| 1095 | 1099 |
| 1096 FX_BOOL IsDirectionR2L() const; | 1100 FX_BOOL IsDirectionR2L() const; |
| 1097 | 1101 |
| 1098 FX_BOOL PrintScaling() const; | 1102 FX_BOOL PrintScaling() const; |
| 1099 | 1103 |
| 1100 int32_t NumCopies() const; | 1104 int32_t NumCopies() const; |
| 1101 | 1105 |
| 1102 CPDF_Array* PrintPageRange() const; | 1106 CPDF_Array* PrintPageRange() const; |
| 1103 | 1107 |
| 1104 CFX_ByteString Duplex() const; | 1108 CFX_ByteString Duplex() const; |
| 1105 | 1109 |
| 1106 protected: | 1110 protected: |
| 1107 CPDF_Document* m_pDoc; | 1111 CPDF_Document* const m_pDoc; |
| 1108 }; | 1112 }; |
| 1113 |
| 1109 class CPDF_ApSettings { | 1114 class CPDF_ApSettings { |
| 1110 public: | 1115 public: |
| 1116 // TODO(thestig): Examine why this cannot be explicit. |
| 1111 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 1117 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
| 1112 | 1118 |
| 1113 operator CPDF_Dictionary*() const { return m_pDict; } | 1119 operator CPDF_Dictionary*() const { return m_pDict; } |
| 1114 | 1120 |
| 1115 FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry); | 1121 FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry); |
| 1116 | 1122 |
| 1117 int GetRotation(); | 1123 int GetRotation(); |
| 1118 | 1124 |
| 1119 inline FX_ARGB GetBorderColor(int& iColorType) { | 1125 inline FX_ARGB GetBorderColor(int& iColorType) { |
| 1120 return GetColor(iColorType, FX_BSTRC("BC")); | 1126 return GetColor(iColorType, FX_BSTRC("BC")); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 FX_FLOAT fc[4], | 1177 FX_FLOAT fc[4], |
| 1172 const CFX_ByteStringC& csEntry); | 1178 const CFX_ByteStringC& csEntry); |
| 1173 | 1179 |
| 1174 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry); | 1180 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry); |
| 1175 | 1181 |
| 1176 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry); | 1182 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry); |
| 1177 friend class CPDF_FormControl; | 1183 friend class CPDF_FormControl; |
| 1178 }; | 1184 }; |
| 1179 | 1185 |
| 1180 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 1186 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| OLD | NEW |