Chromium Code Reviews| 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; } |
|
Tom Sepez
2015/11/09 21:25:31
nit: prefer initialization list, can m_pRoot be co
Lei Zhang
2015/11/09 22:45:27
Noted, but this CL is plenty big as is. I'll make
| |
| 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) {} |
|
Tom Sepez
2015/11/09 21:25:30
nitto for m_pDocument.
Lei Zhang
2015/11/09 22:45:28
Acknowledged.
| |
| 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) { |
|
Tom Sepez
2015/11/09 21:25:31
nit: init list, const m_pAction member?
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
| |
| 169 m_pAction = (CPDF_Action*)pAction; | 170 m_pAction = (CPDF_Action*)pAction; |
| 170 } | 171 } |
| 171 | 172 |
| 172 operator CPDF_Action*() const { return m_pAction; } | 173 operator CPDF_Action*() const { return m_pAction; } |
|
Tom Sepez
2015/11/09 21:25:31
nit: also todo, replace with an explicit GetAction
Lei Zhang
2015/11/09 22:45:27
Done.
| |
| 173 | 174 |
| 174 FX_DWORD GetFieldsCount() const; | 175 FX_DWORD GetFieldsCount() const; |
| 175 | 176 |
| 176 void GetAllFields(CFX_PtrArray& fieldObjects) const; | 177 std::vector<CPDF_Object*> GetAllFields() const; |
| 177 | 178 |
| 178 CPDF_Object* GetField(FX_DWORD iIndex) const; | 179 CPDF_Object* GetField(FX_DWORD iIndex) const; |
| 179 | 180 |
| 180 CPDF_Action* m_pAction; | 181 CPDF_Action* m_pAction; |
| 181 }; | 182 }; |
| 182 | 183 |
| 183 #define PDFNAMED_NEXTPAGE 1 | 184 #define PDFNAMED_NEXTPAGE 1 |
| 184 #define PDFNAMED_PREVPAGE 2 | 185 #define PDFNAMED_PREVPAGE 2 |
| 185 #define PDFNAMED_FIRSTPAGE 3 | 186 #define PDFNAMED_FIRSTPAGE 3 |
| 186 #define PDFNAMED_LASTPAGE 4 | 187 #define PDFNAMED_LASTPAGE 4 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 | 257 |
| 257 FX_DWORD GetSubActionsCount() const; | 258 FX_DWORD GetSubActionsCount() const; |
| 258 | 259 |
| 259 CPDF_Action GetSubAction(FX_DWORD iIndex) const; | 260 CPDF_Action GetSubAction(FX_DWORD iIndex) const; |
| 260 | 261 |
| 261 protected: | 262 protected: |
| 262 CPDF_Dictionary* m_pDict; | 263 CPDF_Dictionary* m_pDict; |
| 263 }; | 264 }; |
| 264 class CPDF_AAction { | 265 class CPDF_AAction { |
| 265 public: | 266 public: |
| 267 // TODO(thestig): Examine why this cannot be explicit. | |
| 266 CPDF_AAction(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 268 CPDF_AAction(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
|
Tom Sepez
2015/11/09 21:25:31
nit: prefer two methods and no default param, also
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
| |
| 267 | 269 |
| 268 operator CPDF_Dictionary*() const { return m_pDict; } | 270 operator CPDF_Dictionary*() const { return m_pDict; } |
| 269 | 271 |
| 270 enum AActionType { | 272 enum AActionType { |
| 271 CursorEnter = 0, | 273 CursorEnter = 0, |
| 272 CursorExit, | 274 CursorExit, |
| 273 ButtonDown, | 275 ButtonDown, |
| 274 ButtonUp, | 276 ButtonUp, |
| 275 GetFocus, | 277 GetFocus, |
| 276 LoseFocus, | 278 LoseFocus, |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 296 CPDF_Action GetAction(AActionType eType) const; | 298 CPDF_Action GetAction(AActionType eType) const; |
| 297 | 299 |
| 298 FX_POSITION GetStartPos() const; | 300 FX_POSITION GetStartPos() const; |
| 299 | 301 |
| 300 CPDF_Action GetNextAction(FX_POSITION& pos, AActionType& eType) const; | 302 CPDF_Action GetNextAction(FX_POSITION& pos, AActionType& eType) const; |
| 301 | 303 |
| 302 CPDF_Dictionary* m_pDict; | 304 CPDF_Dictionary* m_pDict; |
| 303 }; | 305 }; |
| 304 class CPDF_DocJSActions { | 306 class CPDF_DocJSActions { |
| 305 public: | 307 public: |
| 306 CPDF_DocJSActions(CPDF_Document* pDoc); | 308 explicit CPDF_DocJSActions(CPDF_Document* pDoc); |
| 307 | 309 |
| 308 int CountJSActions() const; | 310 int CountJSActions() const; |
| 309 | 311 |
| 310 CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const; | 312 CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const; |
| 311 | 313 |
| 312 CPDF_Action GetJSAction(const CFX_ByteString& csName) const; | 314 CPDF_Action GetJSAction(const CFX_ByteString& csName) const; |
| 313 | 315 |
| 314 int FindJSAction(const CFX_ByteString& csName) const; | 316 int FindJSAction(const CFX_ByteString& csName) const; |
| 315 | 317 |
| 316 CPDF_Document* GetDocument() const { return m_pDocument; } | 318 CPDF_Document* GetDocument() const { return m_pDocument; } |
| 317 | 319 |
| 318 protected: | 320 protected: |
| 319 CPDF_Document* m_pDocument; | 321 CPDF_Document* m_pDocument; |
|
Tom Sepez
2015/11/09 21:25:31
nit: maybe const?
Lei Zhang
2015/11/09 22:45:27
Done.
| |
| 320 }; | 322 }; |
| 321 class CPDF_FileSpec { | 323 class CPDF_FileSpec { |
| 322 public: | 324 public: |
| 323 CPDF_FileSpec(); | 325 CPDF_FileSpec(); |
| 324 | 326 |
| 325 CPDF_FileSpec(CPDF_Object* pObj) { m_pObj = pObj; } | 327 explicit CPDF_FileSpec(CPDF_Object* pObj) { m_pObj = pObj; } |
|
Tom Sepez
2015/11/09 21:25:31
nitto.
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
| |
| 326 | 328 |
| 327 operator CPDF_Object*() const { return m_pObj; } | 329 operator CPDF_Object*() const { return m_pObj; } |
| 328 | 330 |
| 329 FX_BOOL IsURL() const; | 331 FX_BOOL IsURL() const; |
| 330 | 332 |
| 331 FX_BOOL GetFileName(CFX_WideString& wsFileName) const; | 333 FX_BOOL GetFileName(CFX_WideString& wsFileName) const; |
| 332 | 334 |
| 333 CPDF_Stream* GetFileStream() const; | 335 CPDF_Stream* GetFileStream() const; |
| 334 | 336 |
| 335 void SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL = FALSE); | 337 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; | 468 CPDF_Document* const m_pDocument; |
| 467 std::vector<CPDF_Annot*> m_AnnotList; | 469 std::vector<CPDF_Annot*> m_AnnotList; |
| 468 }; | 470 }; |
| 469 | 471 |
| 470 #define COLORTYPE_TRANSPARENT 0 | 472 #define COLORTYPE_TRANSPARENT 0 |
| 471 #define COLORTYPE_GRAY 1 | 473 #define COLORTYPE_GRAY 1 |
| 472 #define COLORTYPE_RGB 2 | 474 #define COLORTYPE_RGB 2 |
| 473 #define COLORTYPE_CMYK 3 | 475 #define COLORTYPE_CMYK 3 |
| 474 class CPDF_DefaultAppearance { | 476 class CPDF_DefaultAppearance { |
| 475 public: | 477 public: |
| 478 // TODO(thestig): Examine why this cannot be explicit. | |
| 476 CPDF_DefaultAppearance(const CFX_ByteString& csDA = "") { m_csDA = csDA; } | 479 CPDF_DefaultAppearance(const CFX_ByteString& csDA = "") { m_csDA = csDA; } |
|
Tom Sepez
2015/11/09 21:25:31
nit: two methods, no default args.
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
| |
| 477 | 480 |
| 478 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { | 481 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) { |
| 479 m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA; | 482 m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA; |
| 480 } | 483 } |
| 481 | 484 |
| 482 operator CFX_ByteString() const { return m_csDA; } | 485 operator CFX_ByteString() const { return m_csDA; } |
| 483 | 486 |
| 484 const CPDF_DefaultAppearance& operator=(const CFX_ByteString& csDA) { | 487 const CPDF_DefaultAppearance& operator=(const CFX_ByteString& csDA) { |
| 485 m_csDA = csDA; | 488 m_csDA = csDA; |
| 486 return *this; | 489 return *this; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl, | 575 FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl, |
| 573 CFX_WideString& csNewFieldName); | 576 CFX_WideString& csNewFieldName); |
| 574 | 577 |
| 575 FX_DWORD CountFields(const CFX_WideString& csFieldName = L""); | 578 FX_DWORD CountFields(const CFX_WideString& csFieldName = L""); |
| 576 | 579 |
| 577 CPDF_FormField* GetField(FX_DWORD index, | 580 CPDF_FormField* GetField(FX_DWORD index, |
| 578 const CFX_WideString& csFieldName = L""); | 581 const CFX_WideString& csFieldName = L""); |
| 579 | 582 |
| 580 void GetAllFieldNames(CFX_WideStringArray& allFieldNames); | 583 void GetAllFieldNames(CFX_WideStringArray& allFieldNames); |
| 581 | 584 |
| 582 FX_BOOL IsValidFormField(const void* pField); | |
|
Tom Sepez
2015/11/09 21:25:31
Is dead?
Lei Zhang
2015/11/09 22:45:27
It cannot ever return true AFAICT. Please double c
| |
| 583 | |
| 584 CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; | 585 CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; |
| 585 | 586 |
| 586 CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, | 587 CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, |
| 587 FX_FLOAT pdf_x, | 588 FX_FLOAT pdf_x, |
| 588 FX_FLOAT pdf_y, | 589 FX_FLOAT pdf_y, |
| 589 int* z_order) const; | 590 int* z_order) const; |
| 590 | 591 |
| 591 CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const; | 592 CPDF_FormControl* GetControlByDict(const CPDF_Dictionary* pWidgetDict) const; |
| 592 | 593 |
| 593 CPDF_Document* GetDocument() const { return m_pDocument; } | 594 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); | 638 void RemoveFormFont(const CPDF_Font* pFont); |
| 638 | 639 |
| 639 void RemoveFormFont(CFX_ByteString csNameTag); | 640 void RemoveFormFont(CFX_ByteString csNameTag); |
| 640 | 641 |
| 641 CPDF_DefaultAppearance GetDefaultAppearance(); | 642 CPDF_DefaultAppearance GetDefaultAppearance(); |
| 642 | 643 |
| 643 CPDF_Font* GetDefaultFormFont(); | 644 CPDF_Font* GetDefaultFormFont(); |
| 644 | 645 |
| 645 int GetFormAlignment(); | 646 int GetFormAlignment(); |
| 646 | 647 |
| 647 CPDF_FormField* CheckRequiredFields(const CFX_PtrArray* fields = NULL, | 648 CPDF_FormField* CheckRequiredFields( |
| 648 FX_BOOL bIncludeOrExclude = TRUE) const; | 649 const std::vector<CPDF_FormField*>* fields, |
|
Tom Sepez
2015/11/09 21:25:31
nit: const reference.
Lei Zhang
2015/11/09 22:45:27
Some callers pass in a nullptr.
| |
| 650 FX_BOOL bIncludeOrExclude) const; | |
|
Tom Sepez
2015/11/09 21:25:31
nit: bool.
Lei Zhang
2015/11/09 22:45:27
Done.
| |
| 649 | 651 |
| 650 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, | 652 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, |
| 651 FX_BOOL bSimpleFileSpec = FALSE) const; | 653 bool bSimpleFileSpec = false) const; |
| 652 | 654 |
| 653 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, | 655 CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, |
| 654 CFX_PtrArray& fields, | 656 const std::vector<CPDF_FormField*>& fields, |
| 655 FX_BOOL bIncludeOrExclude = TRUE, | 657 bool bIncludeOrExclude = true, |
| 656 FX_BOOL bSimpleFileSpec = FALSE) const; | 658 bool bSimpleFileSpec = false) const; |
| 657 | 659 |
| 658 FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE); | 660 FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE); |
| 659 | 661 |
| 660 FX_BOOL ResetForm(const CFX_PtrArray& fields, | 662 bool ResetForm(const std::vector<CPDF_FormField*>& fields, |
| 661 FX_BOOL bIncludeOrExclude = TRUE, | 663 bool bIncludeOrExclude = true, |
| 662 FX_BOOL bNotify = FALSE); | 664 bool bNotify = false); |
| 663 | 665 |
| 664 FX_BOOL ResetForm(FX_BOOL bNotify = FALSE); | 666 bool ResetForm(bool bNotify = false); |
| 665 | 667 |
| 666 CPDF_FormNotify* GetFormNotify() const { return m_pFormNotify; } | 668 CPDF_FormNotify* GetFormNotify() const { return m_pFormNotify; } |
| 667 | 669 |
| 668 void SetFormNotify(const CPDF_FormNotify* pNotify); | 670 void SetFormNotify(const CPDF_FormNotify* pNotify); |
| 669 | 671 |
| 670 FX_BOOL IsUpdated() { return m_bUpdated; } | 672 FX_BOOL IsUpdated() { return m_bUpdated; } |
| 671 | 673 |
| 672 void ClearUpdatedFlag() { m_bUpdated = FALSE; } | 674 void ClearUpdatedFlag() { m_bUpdated = FALSE; } |
| 673 | 675 |
| 674 FX_BOOL HasXFAForm() const; | 676 FX_BOOL HasXFAForm() const; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 878 | 880 |
| 879 FX_FLOAT m_FontSize; | 881 FX_FLOAT m_FontSize; |
| 880 | 882 |
| 881 CPDF_Font* m_pFont; | 883 CPDF_Font* m_pFont; |
| 882 }; | 884 }; |
| 883 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, | 885 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, |
| 884 const FX_CHAR* name, | 886 const FX_CHAR* name, |
| 885 int nLevel = 0); | 887 int nLevel = 0); |
| 886 class CPDF_IconFit { | 888 class CPDF_IconFit { |
| 887 public: | 889 public: |
| 890 // TODO(thestig): Examine why this cannot be explicit. | |
| 888 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 891 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
|
Tom Sepez
2015/11/09 21:25:31
nitto: two methods, const member, no default args,
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
| |
| 889 | 892 |
| 890 operator CPDF_Dictionary*() const { return m_pDict; } | 893 operator CPDF_Dictionary*() const { return m_pDict; } |
| 891 | 894 |
| 892 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; | 895 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; |
| 893 | 896 |
| 894 ScaleMethod GetScaleMethod(); | 897 ScaleMethod GetScaleMethod(); |
| 895 | 898 |
| 896 FX_BOOL IsProportionalScale(); | 899 FX_BOOL IsProportionalScale(); |
| 897 | 900 |
| 898 void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom); | 901 void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1051 | 1054 |
| 1052 virtual int AfterFormReset(const CPDF_InterForm* pForm) { return 0; } | 1055 virtual int AfterFormReset(const CPDF_InterForm* pForm) { return 0; } |
| 1053 | 1056 |
| 1054 virtual int BeforeFormImportData(const CPDF_InterForm* pForm) { return 0; } | 1057 virtual int BeforeFormImportData(const CPDF_InterForm* pForm) { return 0; } |
| 1055 | 1058 |
| 1056 virtual int AfterFormImportData(const CPDF_InterForm* pForm) { return 0; } | 1059 virtual int AfterFormImportData(const CPDF_InterForm* pForm) { return 0; } |
| 1057 }; | 1060 }; |
| 1058 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); | 1061 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); |
| 1059 class CPDF_PageLabel { | 1062 class CPDF_PageLabel { |
| 1060 public: | 1063 public: |
| 1061 CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } | 1064 explicit CPDF_PageLabel(CPDF_Document* pDocument) { m_pDocument = pDocument; } |
|
Tom Sepez
2015/11/09 21:25:31
nitto
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
| |
| 1062 | 1065 |
| 1063 CFX_WideString GetLabel(int nPage) const; | 1066 CFX_WideString GetLabel(int nPage) const; |
| 1064 | 1067 |
| 1065 int32_t GetPageByLabel(const CFX_ByteStringC& bsLabel) const; | 1068 int32_t GetPageByLabel(const CFX_ByteStringC& bsLabel) const; |
| 1066 | 1069 |
| 1067 int32_t GetPageByLabel(const CFX_WideStringC& wsLabel) const; | 1070 int32_t GetPageByLabel(const CFX_WideStringC& wsLabel) const; |
| 1068 | 1071 |
| 1069 protected: | 1072 protected: |
| 1070 CPDF_Document* m_pDocument; | 1073 CPDF_Document* m_pDocument; |
| 1071 }; | 1074 }; |
| 1072 | 1075 |
| 1073 class CPDF_Metadata { | 1076 class CPDF_Metadata { |
| 1074 public: | 1077 public: |
| 1075 explicit CPDF_Metadata(CPDF_Document* pDoc); | 1078 explicit CPDF_Metadata(CPDF_Document* pDoc); |
| 1076 ~CPDF_Metadata(); | 1079 ~CPDF_Metadata(); |
| 1077 | 1080 |
| 1078 const CXML_Element* GetRoot() const; | 1081 const CXML_Element* GetRoot() const; |
| 1079 | 1082 |
| 1080 private: | 1083 private: |
| 1081 nonstd::unique_ptr<CXML_Element> m_pXmlElement; | 1084 nonstd::unique_ptr<CXML_Element> m_pXmlElement; |
| 1082 }; | 1085 }; |
| 1083 | 1086 |
| 1084 class CPDF_ViewerPreferences { | 1087 class CPDF_ViewerPreferences { |
| 1085 public: | 1088 public: |
| 1086 CPDF_ViewerPreferences(CPDF_Document* pDoc); | 1089 explicit CPDF_ViewerPreferences(CPDF_Document* pDoc); |
| 1087 | 1090 |
| 1088 ~CPDF_ViewerPreferences(); | 1091 ~CPDF_ViewerPreferences(); |
| 1089 | 1092 |
| 1090 FX_BOOL IsDirectionR2L() const; | 1093 FX_BOOL IsDirectionR2L() const; |
| 1091 | 1094 |
| 1092 FX_BOOL PrintScaling() const; | 1095 FX_BOOL PrintScaling() const; |
| 1093 | 1096 |
| 1094 int32_t NumCopies() const; | 1097 int32_t NumCopies() const; |
| 1095 | 1098 |
| 1096 CPDF_Array* PrintPageRange() const; | 1099 CPDF_Array* PrintPageRange() const; |
| 1097 | 1100 |
| 1098 CFX_ByteString Duplex() const; | 1101 CFX_ByteString Duplex() const; |
| 1099 | 1102 |
| 1100 protected: | 1103 protected: |
| 1101 CPDF_Document* m_pDoc; | 1104 CPDF_Document* m_pDoc; |
|
Tom Sepez
2015/11/09 21:25:30
nit: const member?
Lei Zhang
2015/11/09 22:45:27
Done.
| |
| 1102 }; | 1105 }; |
| 1103 class CPDF_ApSettings { | 1106 class CPDF_ApSettings { |
| 1104 public: | 1107 public: |
| 1108 // TODO(thestig): Examine why this cannot be explicit. | |
| 1105 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } | 1109 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) { m_pDict = pDict; } |
|
Tom Sepez
2015/11/09 21:25:31
nitto
Lei Zhang
2015/11/09 22:45:27
Acknowledged.
| |
| 1106 | 1110 |
| 1107 operator CPDF_Dictionary*() const { return m_pDict; } | 1111 operator CPDF_Dictionary*() const { return m_pDict; } |
| 1108 | 1112 |
| 1109 FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry); | 1113 FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry); |
| 1110 | 1114 |
| 1111 int GetRotation(); | 1115 int GetRotation(); |
| 1112 | 1116 |
| 1113 inline FX_ARGB GetBorderColor(int& iColorType) { | 1117 inline FX_ARGB GetBorderColor(int& iColorType) { |
| 1114 return GetColor(iColorType, FX_BSTRC("BC")); | 1118 return GetColor(iColorType, FX_BSTRC("BC")); |
| 1115 } | 1119 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1165 FX_FLOAT fc[4], | 1169 FX_FLOAT fc[4], |
| 1166 const CFX_ByteStringC& csEntry); | 1170 const CFX_ByteStringC& csEntry); |
| 1167 | 1171 |
| 1168 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry); | 1172 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry); |
| 1169 | 1173 |
| 1170 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry); | 1174 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry); |
| 1171 friend class CPDF_FormControl; | 1175 friend class CPDF_FormControl; |
| 1172 }; | 1176 }; |
| 1173 | 1177 |
| 1174 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 1178 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| OLD | NEW |