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 "../fpdfapi/fpdf_parser.h" | 10 #include "../fpdfapi/fpdf_parser.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 FX_DWORD GetFlags() const | 325 FX_DWORD GetFlags() const |
326 { | 326 { |
327 return m_pDict->GetInteger("Flags"); | 327 return m_pDict->GetInteger("Flags"); |
328 } | 328 } |
329 | 329 |
330 CFX_WideString GetJavaScript() const; | 330 CFX_WideString GetJavaScript() const; |
331 | 331 |
332 CPDF_Dictionary* GetAnnot() const; | 332 CPDF_Dictionary* GetAnnot() const; |
333 | 333 |
334 FX_INT32» » » GetOperationType() const; | 334 int32_t» » » » GetOperationType() const; |
335 | 335 |
336 CPDF_Stream* GetSoundStream() const | 336 CPDF_Stream* GetSoundStream() const |
337 { | 337 { |
338 return m_pDict->GetStream("Sound"); | 338 return m_pDict->GetStream("Sound"); |
339 } | 339 } |
340 | 340 |
341 FX_FLOAT GetVolume() const | 341 FX_FLOAT GetVolume() const |
342 { | 342 { |
343 return m_pDict->GetNumber("Volume"); | 343 return m_pDict->GetNumber("Volume"); |
344 } | 344 } |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 | 726 |
727 static FX_BOOL UpdatingAPEnabled(); | 727 static FX_BOOL UpdatingAPEnabled(); |
728 | 728 |
729 | 729 |
730 static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* p
ResDict, FX_LPCSTR csType, int iMinLen = 2, FX_LPCSTR csPrefix = ""); | 730 static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* p
ResDict, FX_LPCSTR csType, int iMinLen = 2, FX_LPCSTR csPrefix = ""); |
731 | 731 |
732 | 732 |
733 | 733 |
734 static CPDF_Font* AddSystemDefaultFont(const CPDF_Document* pDocum
ent); | 734 static CPDF_Font* AddSystemDefaultFont(const CPDF_Document* pDocum
ent); |
735 | 735 |
736 static CPDF_Font*» » AddSystemFont(const CPDF_Document* pDocument, CF
X_ByteString csFontName, FX_BYTE iCharSet = 1); | 736 static CPDF_Font*» » AddSystemFont(const CPDF_Document* pDocument, CF
X_ByteString csFontName, uint8_t iCharSet = 1); |
737 | 737 |
738 static CPDF_Font*» » AddSystemFont(const CPDF_Document* pDocument, CF
X_WideString csFontName, FX_BYTE iCharSet = 1); | 738 static CPDF_Font*» » AddSystemFont(const CPDF_Document* pDocument, CF
X_WideString csFontName, uint8_t iCharSet = 1); |
739 | 739 |
740 static CPDF_Font* AddStandardFont(const CPDF_Document* pDocument,
CFX_ByteString csFontName); | 740 static CPDF_Font* AddStandardFont(const CPDF_Document* pDocument,
CFX_ByteString csFontName); |
741 | 741 |
742 static CFX_ByteString» GetNativeFont(FX_BYTE iCharSet, FX_LPVOID pLogFo
nt = NULL); | 742 static CFX_ByteString» GetNativeFont(uint8_t iCharSet, FX_LPVOID pLogFo
nt = NULL); |
743 | 743 |
744 static CFX_ByteString GetNativeFont(FX_LPVOID pLogFont = NULL); | 744 static CFX_ByteString GetNativeFont(FX_LPVOID pLogFont = NULL); |
745 | 745 |
746 static FX_BYTE» » » GetNativeCharSet(); | 746 static uint8_t» » » GetNativeCharSet(); |
747 | 747 |
748 static CPDF_Font*» » AddNativeFont(FX_BYTE iCharSet, const CPDF_Docum
ent* pDocument); | 748 static CPDF_Font*» » AddNativeFont(uint8_t iCharSet, const CPDF_Docum
ent* pDocument); |
749 | 749 |
750 static CPDF_Font* AddNativeFont(const CPDF_Document* pDocument); | 750 static CPDF_Font* AddNativeFont(const CPDF_Document* pDocument); |
751 | 751 |
752 | 752 |
753 | 753 |
754 | 754 |
755 FX_BOOL ValidateFieldName(CFX_WideString
& csNewFieldName, int iType); | 755 FX_BOOL ValidateFieldName(CFX_WideString
& csNewFieldName, int iType); |
756 | 756 |
757 FX_BOOL ValidateFieldName(const CPDF_For
mField* pField, CFX_WideString& csNewFieldName); | 757 FX_BOOL ValidateFieldName(const CPDF_For
mField* pField, CFX_WideString& csNewFieldName); |
758 | 758 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 | 830 |
831 | 831 |
832 FX_DWORD CountFormFonts(); | 832 FX_DWORD CountFormFonts(); |
833 | 833 |
834 CPDF_Font* GetFormFont(FX_DWORD index, CFX_ByteStri
ng& csNameTag); | 834 CPDF_Font* GetFormFont(FX_DWORD index, CFX_ByteStri
ng& csNameTag); |
835 | 835 |
836 CPDF_Font* GetFormFont(CFX_ByteString csNameTag); | 836 CPDF_Font* GetFormFont(CFX_ByteString csNameTag); |
837 | 837 |
838 CPDF_Font* GetFormFont(CFX_ByteString csFontName, C
FX_ByteString& csNameTag); | 838 CPDF_Font* GetFormFont(CFX_ByteString csFontName, C
FX_ByteString& csNameTag); |
839 | 839 |
840 CPDF_Font*» » » » GetNativeFormFont(FX_BYTE iCharSet, CFX_
ByteString& csNameTag); | 840 CPDF_Font*» » » » GetNativeFormFont(uint8_t iCharSet, CFX_
ByteString& csNameTag); |
841 | 841 |
842 CPDF_Font* GetNativeFormFont(CFX_ByteString& csName
Tag); | 842 CPDF_Font* GetNativeFormFont(CFX_ByteString& csName
Tag); |
843 | 843 |
844 FX_BOOL FindFormFont(const CPDF_Font* pF
ont, CFX_ByteString& csNameTag); | 844 FX_BOOL FindFormFont(const CPDF_Font* pF
ont, CFX_ByteString& csNameTag); |
845 | 845 |
846 FX_BOOL FindFormFont(CFX_ByteString csFo
ntName, CPDF_Font*& pFont, CFX_ByteString& csNameTag); | 846 FX_BOOL FindFormFont(CFX_ByteString csFo
ntName, CPDF_Font*& pFont, CFX_ByteString& csNameTag); |
847 | 847 |
848 inline FX_BOOL FindFormFont(CFX_WideString csFontName,
CPDF_Font*& pFont, CFX_ByteString& csNameTag) | 848 inline FX_BOOL FindFormFont(CFX_WideString csFontName,
CPDF_Font*& pFont, CFX_ByteString& csNameTag) |
849 { | 849 { |
850 return FindFormFont(PDF_EncodeText(csFontName), pFont, csNameTag); | 850 return FindFormFont(PDF_EncodeText(csFontName), pFont, csNameTag); |
851 } | 851 } |
852 | 852 |
853 | 853 |
854 | 854 |
855 | 855 |
856 | 856 |
857 void AddFormFont(const CPDF_Font* pFo
nt, CFX_ByteString& csNameTag); | 857 void AddFormFont(const CPDF_Font* pFo
nt, CFX_ByteString& csNameTag); |
858 | 858 |
859 CPDF_Font*» » » » AddNativeFormFont(FX_BYTE iCharSet, CFX_
ByteString& csNameTag); | 859 CPDF_Font*» » » » AddNativeFormFont(uint8_t iCharSet, CFX_
ByteString& csNameTag); |
860 | 860 |
861 CPDF_Font* AddNativeFormFont(CFX_ByteString& csName
Tag); | 861 CPDF_Font* AddNativeFormFont(CFX_ByteString& csName
Tag); |
862 | 862 |
863 void RemoveFormFont(const CPDF_Font*
pFont); | 863 void RemoveFormFont(const CPDF_Font*
pFont); |
864 | 864 |
865 void RemoveFormFont(CFX_ByteString cs
NameTag); | 865 void RemoveFormFont(CFX_ByteString cs
NameTag); |
866 | 866 |
867 | 867 |
868 | 868 |
869 | 869 |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 public: | 1510 public: |
1511 | 1511 |
1512 CPDF_PageLabel(CPDF_Document* pDocument) | 1512 CPDF_PageLabel(CPDF_Document* pDocument) |
1513 { | 1513 { |
1514 m_pDocument = pDocument; | 1514 m_pDocument = pDocument; |
1515 } | 1515 } |
1516 | 1516 |
1517 | 1517 |
1518 CFX_WideString GetLabel(int nPage) cons
t; | 1518 CFX_WideString GetLabel(int nPage) cons
t; |
1519 | 1519 |
1520 FX_INT32» » » » » » GetPageByLabel(FX_BSTR b
sLabel) const; | 1520 int32_t» » » » » » GetPageByLabel(FX_BSTR b
sLabel) const; |
1521 | 1521 |
1522 | 1522 |
1523 FX_INT32» » » » » » GetPageByLabel(FX_WSTR w
sLabel) const; | 1523 int32_t» » » » » » GetPageByLabel(FX_WSTR w
sLabel) const; |
1524 | 1524 |
1525 protected: | 1525 protected: |
1526 CPDF_Document* m_pDocument; | 1526 CPDF_Document* m_pDocument; |
1527 }; | 1527 }; |
1528 class CPDF_Metadata | 1528 class CPDF_Metadata |
1529 { | 1529 { |
1530 public: | 1530 public: |
1531 | 1531 |
1532 CPDF_Metadata(); | 1532 CPDF_Metadata(); |
1533 | 1533 |
1534 | 1534 |
1535 ~CPDF_Metadata(); | 1535 ~CPDF_Metadata(); |
1536 | 1536 |
1537 void LoadDoc(CPDF_Document *pDoc); | 1537 void LoadDoc(CPDF_Document *pDoc); |
1538 | 1538 |
1539 | 1539 |
1540 FX_INT32» » » GetString(FX_BSTR bsItem, CFX_WideString &wsStr)
; | 1540 int32_t» » » GetString(FX_BSTR bsItem, CFX_WideString &wsStr)
; |
1541 | 1541 |
1542 CXML_Element* GetRoot() const; | 1542 CXML_Element* GetRoot() const; |
1543 | 1543 |
1544 CXML_Element* GetRDF() const; | 1544 CXML_Element* GetRDF() const; |
1545 | 1545 |
1546 protected: | 1546 protected: |
1547 FX_LPVOID m_pData; | 1547 FX_LPVOID m_pData; |
1548 }; | 1548 }; |
1549 class CPDF_ViewerPreferences | 1549 class CPDF_ViewerPreferences |
1550 { | 1550 { |
1551 public: | 1551 public: |
1552 | 1552 |
1553 CPDF_ViewerPreferences(CPDF_Document *pDoc); | 1553 CPDF_ViewerPreferences(CPDF_Document *pDoc); |
1554 | 1554 |
1555 | 1555 |
1556 ~CPDF_ViewerPreferences(); | 1556 ~CPDF_ViewerPreferences(); |
1557 | 1557 |
1558 | 1558 |
1559 FX_BOOL IsDirectionR2L() const; | 1559 FX_BOOL IsDirectionR2L() const; |
1560 | 1560 |
1561 FX_BOOL PrintScaling() const; | 1561 FX_BOOL PrintScaling() const; |
1562 | 1562 |
1563 FX_INT32 NumCopies() const; | 1563 int32_t NumCopies() const; |
1564 | 1564 |
1565 CPDF_Array* PrintPageRange() const; | 1565 CPDF_Array* PrintPageRange() const; |
1566 | 1566 |
1567 CFX_ByteString Duplex() const; | 1567 CFX_ByteString Duplex() const; |
1568 | 1568 |
1569 protected: | 1569 protected: |
1570 CPDF_Document* m_pDoc; | 1570 CPDF_Document* m_pDoc; |
1571 }; | 1571 }; |
1572 class CPDF_ApSettings | 1572 class CPDF_ApSettings |
1573 { | 1573 { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 | 1692 |
1693 void GetOriginalColor(int& iColorType
, FX_FLOAT fc[4], FX_BSTR csEntry); | 1693 void GetOriginalColor(int& iColorType
, FX_FLOAT fc[4], FX_BSTR csEntry); |
1694 | 1694 |
1695 CFX_WideString GetCaption(FX_BSTR csEntry); | 1695 CFX_WideString GetCaption(FX_BSTR csEntry); |
1696 | 1696 |
1697 CPDF_Stream* GetIcon(FX_BSTR csEntry); | 1697 CPDF_Stream* GetIcon(FX_BSTR csEntry); |
1698 friend class CPDF_FormControl; | 1698 friend class CPDF_FormControl; |
1699 }; | 1699 }; |
1700 | 1700 |
1701 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 1701 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
OLD | NEW |