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 XFA_FDE_CSS_FDE_CSS_H_ | 7 #ifndef XFA_FDE_CSS_FDE_CSS_H_ |
8 #define XFA_FDE_CSS_FDE_CSS_H_ | 8 #define XFA_FDE_CSS_FDE_CSS_H_ |
9 | 9 |
10 #include "core/include/fxge/fx_dib.h" | 10 #include "core/include/fxge/fx_dib.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 FDE_CSSSELECTORTYPE_Element, | 387 FDE_CSSSELECTORTYPE_Element, |
388 FDE_CSSSELECTORTYPE_Descendant, | 388 FDE_CSSSELECTORTYPE_Descendant, |
389 FDE_CSSSELECTORTYPE_Class, | 389 FDE_CSSSELECTORTYPE_Class, |
390 FDE_CSSSELECTORTYPE_Persudo, | 390 FDE_CSSSELECTORTYPE_Persudo, |
391 FDE_CSSSELECTORTYPE_ID, | 391 FDE_CSSSELECTORTYPE_ID, |
392 }; | 392 }; |
393 class IFDE_CSSSelector { | 393 class IFDE_CSSSelector { |
394 public: | 394 public: |
395 virtual ~IFDE_CSSSelector() {} | 395 virtual ~IFDE_CSSSelector() {} |
396 virtual FDE_CSSSELECTORTYPE GetType() const = 0; | 396 virtual FDE_CSSSELECTORTYPE GetType() const = 0; |
397 virtual FX_DWORD GetNameHash() const = 0; | 397 virtual uint32_t GetNameHash() const = 0; |
398 virtual IFDE_CSSSelector* GetNextSelector() const = 0; | 398 virtual IFDE_CSSSelector* GetNextSelector() const = 0; |
399 }; | 399 }; |
400 #define FDE_CSSMEDIATYPE_Braille 0x01 | 400 #define FDE_CSSMEDIATYPE_Braille 0x01 |
401 #define FDE_CSSMEDIATYPE_Emboss 0x02 | 401 #define FDE_CSSMEDIATYPE_Emboss 0x02 |
402 #define FDE_CSSMEDIATYPE_Handheld 0x04 | 402 #define FDE_CSSMEDIATYPE_Handheld 0x04 |
403 #define FDE_CSSMEDIATYPE_Print 0x08 | 403 #define FDE_CSSMEDIATYPE_Print 0x08 |
404 #define FDE_CSSMEDIATYPE_Projection 0x10 | 404 #define FDE_CSSMEDIATYPE_Projection 0x10 |
405 #define FDE_CSSMEDIATYPE_Screen 0x20 | 405 #define FDE_CSSMEDIATYPE_Screen 0x20 |
406 #define FDE_CSSMEDIATYPE_TTY 0x40 | 406 #define FDE_CSSMEDIATYPE_TTY 0x40 |
407 #define FDE_CSSMEDIATYPE_TV 0x80 | 407 #define FDE_CSSMEDIATYPE_TV 0x80 |
(...skipping 13 matching lines...) Expand all Loading... |
421 class IFDE_CSSStyleRule : public IFDE_CSSRule { | 421 class IFDE_CSSStyleRule : public IFDE_CSSRule { |
422 public: | 422 public: |
423 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_Style; } | 423 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_Style; } |
424 virtual int32_t CountSelectorLists() const = 0; | 424 virtual int32_t CountSelectorLists() const = 0; |
425 virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const = 0; | 425 virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const = 0; |
426 virtual IFDE_CSSDeclaration* GetDeclaration() const = 0; | 426 virtual IFDE_CSSDeclaration* GetDeclaration() const = 0; |
427 }; | 427 }; |
428 class IFDE_CSSMediaRule : public IFDE_CSSRule { | 428 class IFDE_CSSMediaRule : public IFDE_CSSRule { |
429 public: | 429 public: |
430 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_Media; } | 430 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_Media; } |
431 virtual FX_DWORD GetMediaList() const = 0; | 431 virtual uint32_t GetMediaList() const = 0; |
432 virtual int32_t CountRules() const = 0; | 432 virtual int32_t CountRules() const = 0; |
433 virtual IFDE_CSSRule* GetRule(int32_t index) = 0; | 433 virtual IFDE_CSSRule* GetRule(int32_t index) = 0; |
434 }; | 434 }; |
435 class IFDE_CSSFontFaceRule : public IFDE_CSSRule { | 435 class IFDE_CSSFontFaceRule : public IFDE_CSSRule { |
436 public: | 436 public: |
437 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_FontFace; } | 437 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_FontFace; } |
438 virtual IFDE_CSSDeclaration* GetDeclaration() const = 0; | 438 virtual IFDE_CSSDeclaration* GetDeclaration() const = 0; |
439 }; | 439 }; |
440 class IFDE_CSSStyleSheet : public IFX_Unknown { | 440 class IFDE_CSSStyleSheet : public IFX_Unknown { |
441 public: | 441 public: |
442 static IFDE_CSSStyleSheet* LoadHTMLStandardStyleSheet(); | 442 static IFDE_CSSStyleSheet* LoadHTMLStandardStyleSheet(); |
443 static IFDE_CSSStyleSheet* LoadFromStream( | 443 static IFDE_CSSStyleSheet* LoadFromStream( |
444 const CFX_WideString& szUrl, | 444 const CFX_WideString& szUrl, |
445 IFX_Stream* pStream, | 445 IFX_Stream* pStream, |
446 uint16_t wCodePage, | 446 uint16_t wCodePage, |
447 FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL); | 447 uint32_t dwMediaList = FDE_CSSMEDIATYPE_ALL); |
448 static IFDE_CSSStyleSheet* LoadFromBuffer( | 448 static IFDE_CSSStyleSheet* LoadFromBuffer( |
449 const CFX_WideString& szUrl, | 449 const CFX_WideString& szUrl, |
450 const FX_WCHAR* pBuffer, | 450 const FX_WCHAR* pBuffer, |
451 int32_t iBufSize, | 451 int32_t iBufSize, |
452 uint16_t wCodePage, | 452 uint16_t wCodePage, |
453 FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL); | 453 uint32_t dwMediaList = FDE_CSSMEDIATYPE_ALL); |
454 virtual FX_BOOL GetUrl(CFX_WideString& szUrl) = 0; | 454 virtual FX_BOOL GetUrl(CFX_WideString& szUrl) = 0; |
455 virtual FX_DWORD GetMediaList() const = 0; | 455 virtual uint32_t GetMediaList() const = 0; |
456 virtual uint16_t GetCodePage() const = 0; | 456 virtual uint16_t GetCodePage() const = 0; |
457 | 457 |
458 virtual int32_t CountRules() const = 0; | 458 virtual int32_t CountRules() const = 0; |
459 virtual IFDE_CSSRule* GetRule(int32_t index) = 0; | 459 virtual IFDE_CSSRule* GetRule(int32_t index) = 0; |
460 }; | 460 }; |
461 typedef CFX_ArrayTemplate<IFDE_CSSStyleSheet*> CFDE_CSSStyleSheetArray; | 461 typedef CFX_ArrayTemplate<IFDE_CSSStyleSheet*> CFDE_CSSStyleSheetArray; |
462 #define FDE_CSSUSERSTYLESHEET (FX_BSTRC("#USERSHEET")) | 462 #define FDE_CSSUSERSTYLESHEET (FX_BSTRC("#USERSHEET")) |
463 #define FDE_CSSUAGENTSTYLESHEET (FX_BSTRC("#AGENTSHEET")) | 463 #define FDE_CSSUAGENTSTYLESHEET (FX_BSTRC("#AGENTSHEET")) |
464 class IFDE_CSSStyleSheetCache { | 464 class IFDE_CSSStyleSheetCache { |
465 public: | 465 public: |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 class IFDE_CSSParagraphStyle { | 929 class IFDE_CSSParagraphStyle { |
930 public: | 930 public: |
931 virtual ~IFDE_CSSParagraphStyle() {} | 931 virtual ~IFDE_CSSParagraphStyle() {} |
932 virtual FX_FLOAT GetLineHeight() const = 0; | 932 virtual FX_FLOAT GetLineHeight() const = 0; |
933 virtual FDE_CSSWHITESPACE GetWhiteSpace() const = 0; | 933 virtual FDE_CSSWHITESPACE GetWhiteSpace() const = 0; |
934 virtual const FDE_CSSLENGTH& GetTextIndent() const = 0; | 934 virtual const FDE_CSSLENGTH& GetTextIndent() const = 0; |
935 virtual FDE_CSSTEXTALIGN GetTextAlign() const = 0; | 935 virtual FDE_CSSTEXTALIGN GetTextAlign() const = 0; |
936 virtual FDE_CSSVERTICALALIGN GetVerticalAlign() const = 0; | 936 virtual FDE_CSSVERTICALALIGN GetVerticalAlign() const = 0; |
937 virtual FX_FLOAT GetNumberVerticalAlign() const = 0; | 937 virtual FX_FLOAT GetNumberVerticalAlign() const = 0; |
938 virtual FDE_CSSTEXTTRANSFORM GetTextTransform() const = 0; | 938 virtual FDE_CSSTEXTTRANSFORM GetTextTransform() const = 0; |
939 virtual FX_DWORD GetTextDecoration() const = 0; | 939 virtual uint32_t GetTextDecoration() const = 0; |
940 virtual const FDE_CSSLENGTH& GetLetterSpacing() const = 0; | 940 virtual const FDE_CSSLENGTH& GetLetterSpacing() const = 0; |
941 virtual const FDE_CSSLENGTH& GetWordSpacing() const = 0; | 941 virtual const FDE_CSSLENGTH& GetWordSpacing() const = 0; |
942 virtual FDE_CSSWRITINGMODE GetWritingMode() const = 0; | 942 virtual FDE_CSSWRITINGMODE GetWritingMode() const = 0; |
943 virtual FDE_CSSWORDBREAK GetWordBreak() const = 0; | 943 virtual FDE_CSSWORDBREAK GetWordBreak() const = 0; |
944 virtual int32_t GetWidows() const = 0; | 944 virtual int32_t GetWidows() const = 0; |
945 virtual FX_ARGB GetTextEmphasisColor() const = 0; | 945 virtual FX_ARGB GetTextEmphasisColor() const = 0; |
946 virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const = 0; | 946 virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const = 0; |
947 virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const = 0; | 947 virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const = 0; |
948 virtual FDE_CSSPAGEBREAK GetPageBreakInside() const = 0; | 948 virtual FDE_CSSPAGEBREAK GetPageBreakInside() const = 0; |
949 virtual int32_t GetOrphans() const = 0; | 949 virtual int32_t GetOrphans() const = 0; |
950 virtual FDE_CSSLINEBREAK GetLineBreak() const = 0; | 950 virtual FDE_CSSLINEBREAK GetLineBreak() const = 0; |
951 virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const = 0; | 951 virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const = 0; |
952 virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const = 0; | 952 virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const = 0; |
953 virtual const FX_WCHAR* GetTextEmphasisCustom() const = 0; | 953 virtual const FX_WCHAR* GetTextEmphasisCustom() const = 0; |
954 virtual FDE_CSSTEXTCOMBINE GetTextCombineType() const = 0; | 954 virtual FDE_CSSTEXTCOMBINE GetTextCombineType() const = 0; |
955 virtual FX_BOOL HasTextCombineNumber() const = 0; | 955 virtual FX_BOOL HasTextCombineNumber() const = 0; |
956 virtual FX_FLOAT GetTextCombineNumber() const = 0; | 956 virtual FX_FLOAT GetTextCombineNumber() const = 0; |
957 virtual void SetLineHeight(FX_FLOAT fLineHeight) = 0; | 957 virtual void SetLineHeight(FX_FLOAT fLineHeight) = 0; |
958 virtual void SetWhiteSpace(FDE_CSSWHITESPACE eWhiteSpace) = 0; | 958 virtual void SetWhiteSpace(FDE_CSSWHITESPACE eWhiteSpace) = 0; |
959 virtual void SetTextIndent(const FDE_CSSLENGTH& textIndent) = 0; | 959 virtual void SetTextIndent(const FDE_CSSLENGTH& textIndent) = 0; |
960 virtual void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) = 0; | 960 virtual void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) = 0; |
961 virtual void SetVerticalAlign(FDE_CSSVERTICALALIGN eVerticalAlign) = 0; | 961 virtual void SetVerticalAlign(FDE_CSSVERTICALALIGN eVerticalAlign) = 0; |
962 virtual void SetNumberVerticalAlign(FX_FLOAT fAlign) = 0; | 962 virtual void SetNumberVerticalAlign(FX_FLOAT fAlign) = 0; |
963 virtual void SetTextTransform(FDE_CSSTEXTTRANSFORM eTextTransform) = 0; | 963 virtual void SetTextTransform(FDE_CSSTEXTTRANSFORM eTextTransform) = 0; |
964 virtual void SetTextDecoration(FX_DWORD dwTextDecoration) = 0; | 964 virtual void SetTextDecoration(uint32_t dwTextDecoration) = 0; |
965 virtual void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) = 0; | 965 virtual void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) = 0; |
966 virtual void SetWordSpacing(const FDE_CSSLENGTH& wordSpacing) = 0; | 966 virtual void SetWordSpacing(const FDE_CSSLENGTH& wordSpacing) = 0; |
967 virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) = 0; | 967 virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) = 0; |
968 virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) = 0; | 968 virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) = 0; |
969 virtual void SetWidows(int32_t iWidows) = 0; | 969 virtual void SetWidows(int32_t iWidows) = 0; |
970 virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) = 0; | 970 virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) = 0; |
971 virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) = 0; | 971 virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) = 0; |
972 virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) = 0; | 972 virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) = 0; |
973 virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) = 0; | 973 virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) = 0; |
974 virtual void SetOrphans(int32_t iOrphans) = 0; | 974 virtual void SetOrphans(int32_t iOrphans) = 0; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 virtual ~IFDE_CSSStyleSelector() {} | 1058 virtual ~IFDE_CSSStyleSelector() {} |
1059 virtual void Release() = 0; | 1059 virtual void Release() = 0; |
1060 virtual void SetFontMgr(IFX_FontMgr* pFontMgr) = 0; | 1060 virtual void SetFontMgr(IFX_FontMgr* pFontMgr) = 0; |
1061 virtual void SetDefFontSize(FX_FLOAT fFontSize) = 0; | 1061 virtual void SetDefFontSize(FX_FLOAT fFontSize) = 0; |
1062 virtual FX_BOOL SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType, | 1062 virtual FX_BOOL SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType, |
1063 IFDE_CSSStyleSheet* pSheet) = 0; | 1063 IFDE_CSSStyleSheet* pSheet) = 0; |
1064 virtual FX_BOOL SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType, | 1064 virtual FX_BOOL SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType, |
1065 const CFDE_CSSStyleSheetArray* pArray) = 0; | 1065 const CFDE_CSSStyleSheetArray* pArray) = 0; |
1066 virtual void SetStylePriority(FDE_CSSSTYLESHEETGROUP eType, | 1066 virtual void SetStylePriority(FDE_CSSSTYLESHEETGROUP eType, |
1067 FDE_CSSSTYLESHEETPRIORITY ePriority) = 0; | 1067 FDE_CSSSTYLESHEETPRIORITY ePriority) = 0; |
1068 virtual void UpdateStyleIndex(FX_DWORD dwMediaList) = 0; | 1068 virtual void UpdateStyleIndex(uint32_t dwMediaList) = 0; |
1069 virtual IFDE_CSSAccelerator* InitAccelerator() = 0; | 1069 virtual IFDE_CSSAccelerator* InitAccelerator() = 0; |
1070 virtual IFDE_CSSComputedStyle* CreateComputedStyle( | 1070 virtual IFDE_CSSComputedStyle* CreateComputedStyle( |
1071 IFDE_CSSComputedStyle* pParentStyle) = 0; | 1071 IFDE_CSSComputedStyle* pParentStyle) = 0; |
1072 virtual int32_t MatchDeclarations( | 1072 virtual int32_t MatchDeclarations( |
1073 IFDE_CSSTagProvider* pTag, | 1073 IFDE_CSSTagProvider* pTag, |
1074 CFDE_CSSDeclarationArray& matchedDecls, | 1074 CFDE_CSSDeclarationArray& matchedDecls, |
1075 FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE) = 0; | 1075 FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE) = 0; |
1076 virtual void ComputeStyle(IFDE_CSSTagProvider* pTag, | 1076 virtual void ComputeStyle(IFDE_CSSTagProvider* pTag, |
1077 const IFDE_CSSDeclaration** ppDeclArray, | 1077 const IFDE_CSSDeclaration** ppDeclArray, |
1078 int32_t iDeclCount, | 1078 int32_t iDeclCount, |
1079 IFDE_CSSComputedStyle* pDestStyle) = 0; | 1079 IFDE_CSSComputedStyle* pDestStyle) = 0; |
1080 }; | 1080 }; |
1081 | 1081 |
1082 #endif // XFA_FDE_CSS_FDE_CSS_H_ | 1082 #endif // XFA_FDE_CSS_FDE_CSS_H_ |
OLD | NEW |