diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2014-10-28 23:03:33 -0700 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2014-11-03 11:10:11 -0800 |
commit | fdc00a7042d912aafaabddae4d9c84199921ef23 (patch) | |
tree | 32ab8ac91cc68d2cd15b9168782a71b3f3f5e7b9 /xfa/src/fdp/include | |
parent | e9b38fa38de2c95d8260be31c57d9272c4d127ed (diff) | |
download | pdfium-fdc00a7042d912aafaabddae4d9c84199921ef23.tar.xz |
Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
Diffstat (limited to 'xfa/src/fdp/include')
-rw-r--r-- | xfa/src/fdp/include/fde.h | 20 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_brs.h | 143 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_css.h | 1082 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_img.h | 76 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_mem.h | 23 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_pen.h | 61 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_psr.h | 94 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_pth.h | 29 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_rdr.h | 32 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_rdv.h | 53 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_tto.h | 69 | ||||
-rw-r--r-- | xfa/src/fdp/include/fde_xml.h | 188 |
12 files changed, 1870 insertions, 0 deletions
diff --git a/xfa/src/fdp/include/fde.h b/xfa/src/fdp/include/fde.h new file mode 100644 index 0000000000..1e2c311188 --- /dev/null +++ b/xfa/src/fdp/include/fde.h @@ -0,0 +1,20 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE
+#define _FDE
+#include "fde_mem.h"
+#include "fde_xml.h"
+#include "fde_img.h"
+#include "fde_brs.h"
+#include "fde_pen.h"
+#include "fde_pth.h"
+#include "fde_tto.h"
+#include "fde_psr.h"
+#include "fde_css.h"
+#include "fde_rdv.h"
+#include "fde_rdr.h"
+#endif
diff --git a/xfa/src/fdp/include/fde_brs.h b/xfa/src/fdp/include/fde_brs.h new file mode 100644 index 0000000000..04a4f48ad5 --- /dev/null +++ b/xfa/src/fdp/include/fde_brs.h @@ -0,0 +1,143 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_BRUSH
+#define _FDE_BRUSH
+class IFDE_Image;
+class IFDE_Path;
+class IFDE_Brush;
+class IFDE_SolidBrush;
+class IFDE_HatchBrush;
+class IFDE_TextureBrush;
+class IFDE_LinearGradientBrush;
+#define FDE_BRUSHTYPE_Unknown -1
+#define FDE_BRUSHTYPE_Solid 0
+#define FDE_BRUSHTYPE_Hatch 1
+#define FDE_BRUSHTYPE_Texture 2
+#define FDE_BRUSHTYPE_LinearGradient 3
+#define FDE_BRUSHTYPE_MAX 3
+#define FDE_WRAPMODE_Tile 0
+#define FDE_WRAPMODE_TileFlipX 1
+#define FDE_WRAPMODE_TileFlipY 2
+#define FDE_WRAPMODE_TileFlipXY 3
+#define FDE_WRAPMODE_Clamp 4
+typedef struct _FDE_GRADIENTCOLOR {
+ FX_FLOAT pos;
+ FX_ARGB color;
+} FDE_GRADIENTCOLOR, * FDE_LPGRADIENTCOLOR;
+typedef FDE_GRADIENTCOLOR const * FDE_LPCGRADIENTCOLOR;
+typedef CFX_ArrayTemplate<FDE_GRADIENTCOLOR> CFDE_GradientColors;
+class IFDE_Brush
+{
+public:
+ static IFDE_Brush* Create(FX_INT32 iType);
+ virtual void Release() = 0;
+ virtual FX_INT32 GetType() const = 0;
+};
+class IFDE_SolidBrush : public IFDE_Brush
+{
+public:
+ virtual FX_ARGB GetColor() const = 0;
+ virtual void SetColor(FX_ARGB color) = 0;
+ virtual const CFX_Matrix& GetMatrix() const = 0;
+ virtual void ResetMatrix() = 0;
+ virtual void TranslateMatrix(FX_FLOAT dx, FX_FLOAT dy) = 0;
+ virtual void RotateMatrix(FX_FLOAT fRadian) = 0;
+ virtual void ScaleMatrix(FX_FLOAT sx, FX_FLOAT sy) = 0;
+ virtual void ConcatMatrix(const CFX_Matrix &matrix) = 0;
+ virtual void SetMatrix(const CFX_Matrix &matrix) = 0;
+};
+#define FDE_HATCHSTYLE_Horizontal 0
+#define FDE_HATCHSTYLE_Vertical 1
+#define FDE_HATCHSTYLE_ForwardDiagonal 2
+#define FDE_HATCHSTYLE_BackwardDiagonal 3
+#define FDE_HATCHSTYLE_Cross 4
+#define FDE_HATCHSTYLE_DiagonalCross 5
+#define FDE_HATCHSTYLE_05Percent 6
+#define FDE_HATCHSTYLE_10Percent 7
+#define FDE_HATCHSTYLE_20Percent 8
+#define FDE_HATCHSTYLE_25Percent 9
+#define FDE_HATCHSTYLE_30Percent 10
+#define FDE_HATCHSTYLE_40Percent 11
+#define FDE_HATCHSTYLE_50Percent 12
+#define FDE_HATCHSTYLE_60Percent 13
+#define FDE_HATCHSTYLE_70Percent 14
+#define FDE_HATCHSTYLE_75Percent 15
+#define FDE_HATCHSTYLE_80Percent 16
+#define FDE_HATCHSTYLE_90Percent 17
+#define FDE_HATCHSTYLE_LightDownwardDiagonal 18
+#define FDE_HATCHSTYLE_LightUpwardDiagonal 19
+#define FDE_HATCHSTYLE_DarkDownwardDiagonal 20
+#define FDE_HATCHSTYLE_DarkUpwardDiagonal 21
+#define FDE_HATCHSTYLE_WideDownwardDiagonal 22
+#define FDE_HATCHSTYLE_WideUpwardDiagonal 23
+#define FDE_HATCHSTYLE_LightVertical 24
+#define FDE_HATCHSTYLE_LightHorizontal 25
+#define FDE_HATCHSTYLE_NarrowVertical 26
+#define FDE_HATCHSTYLE_NarrowHorizontal 27
+#define FDE_HATCHSTYLE_DarkVertical 28
+#define FDE_HATCHSTYLE_DarkHorizontal 29
+#define FDE_HATCHSTYLE_DashedDownwardDiagonal 30
+#define FDE_HATCHSTYLE_DashedUpwardDiagonal 31
+#define FDE_HATCHSTYLE_DashedHorizontal 32
+#define FDE_HATCHSTYLE_DashedVertical 33
+#define FDE_HATCHSTYLE_SmallConfetti 34
+#define FDE_HATCHSTYLE_LargeConfetti 35
+#define FDE_HATCHSTYLE_ZigZag 36
+#define FDE_HATCHSTYLE_Wave 37
+#define FDE_HATCHSTYLE_DiagonalBrick 38
+#define FDE_HATCHSTYLE_HorizontalBrick 39
+#define FDE_HATCHSTYLE_Weave 40
+#define FDE_HATCHSTYLE_Plaid 41
+#define FDE_HATCHSTYLE_Divot 42
+#define FDE_HATCHSTYLE_DottedGrid 43
+#define FDE_HATCHSTYLE_DottedDiamond 44
+#define FDE_HATCHSTYLE_Shingle 45
+#define FDE_HATCHSTYLE_Trellis 46
+#define FDE_HATCHSTYLE_Sphere 47
+#define FDE_HATCHSTYLE_SmallGrid 48
+#define FDE_HATCHSTYLE_SmallCheckerBoard 49
+#define FDE_HATCHSTYLE_LargeCheckerBoard 50
+#define FDE_HATCHSTYLE_OutlinedDiamond 51
+#define FDE_HATCHSTYLE_SolidDiamond 52
+#define FDE_HATCHSTYLE_Total 53
+#define FDE_HATCHSTYLE_LargeGrid FDE_HATCHSTYLE_Cross
+#define FDE_HATCHSTYLE_Min FDE_HATCHSTYLE_Horizontal
+#define FDE_HATCHSTYLE_Max (FDE_HATCHSTYLE_Total - 1)
+class IFDE_HatchBrush : public IFDE_Brush
+{
+public:
+ virtual FX_ARGB GetColor(FX_BOOL bForegroundColor) const = 0;
+ virtual void SetColor(FX_ARGB color, FX_BOOL bForegroundColor) = 0;
+ virtual FX_INT32 GetHatchStyle() const = 0;
+ virtual FX_BOOL SetHatchStyle(FX_INT32 iHatchStyle) = 0;
+};
+class IFDE_TextureBrush : public IFDE_Brush
+{
+public:
+ virtual IFDE_Image* GetImage() const = 0;
+ virtual void SetImage(IFDE_Image *pImage, FX_BOOL bAutoRelease) = 0;
+ virtual FX_INT32 GetWrapMode() const = 0;
+ virtual void SetWrapMode(FX_INT32 iWrapMode) = 0;
+};
+#define FDE_LINEARGRADIENTMODE_Horizontal 0
+#define FDE_LINEARGRADIENTMODE_Vertical 1
+#define FDE_LINEARGRADIENTMODE_ForwardDiagonal 2
+#define FDE_LINEARGRADIENTMODE_BackwardDiagonal 3
+class IFDE_LinearGradientBrush : public IFDE_Brush
+{
+public:
+ virtual void GetLinearPoints(CFX_PointF &startingPoint, CFX_PointF &endingPoint) const = 0;
+ virtual void SetLinearPoints(const CFX_PointF &startingPoint, const CFX_PointF &endingPoint) = 0;
+ virtual void GetLinearColors(FX_ARGB &startingColor, FX_ARGB &endingColor) const = 0;
+ virtual void SetLinearColors(const FX_ARGB &startingColor, const FX_ARGB &endingColor) = 0;
+ virtual FX_INT32 CountGradientColors() const = 0;
+ virtual FX_BOOL GetGradientColors(CFDE_GradientColors &colors) const = 0;
+ virtual FX_BOOL SetGradientColors(const CFDE_GradientColors &colors) = 0;
+ virtual FX_INT32 GetWrapMode() const = 0;
+ virtual void SetWrapMode(FX_INT32 iWrapMode) = 0;
+};
+#endif
diff --git a/xfa/src/fdp/include/fde_css.h b/xfa/src/fdp/include/fde_css.h new file mode 100644 index 0000000000..2870c8d27a --- /dev/null +++ b/xfa/src/fdp/include/fde_css.h @@ -0,0 +1,1082 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_CSS
+#define _FDE_CSS
+class IFDE_HTMNotify;
+class IFDE_CSSValue;
+class IFDE_CSSPrimitiveValue;
+class IFDE_CSSValueList;
+class IFDE_CSSDeclaration;
+class IFDE_CSSSelector;
+class IFDE_CSSRule;
+class IFDE_CSSStyleRule;
+class IFDE_CSSMediaRule;
+class IFDE_CSSFontFaceRule;
+class IFDE_CSSStyleSheet;
+class IFDE_CSSStyleSheetCache;
+class IFDE_CSSSyntaxParser;
+class IFDE_CSSRubyStyle;
+class IFDE_CSSMultiColumnStyle;
+class IFDE_CSSGeneratedContentStyle;
+class IFDE_CSSFontStyle;
+class IFDE_CSSBoundaryStyle;
+class IFDE_CSSPositionStyle;
+class IFDE_CSSParagraphStyle;
+class IFDE_CSSBackgroundStyle;
+class IFDE_CSSListStyle;
+class IFDE_CSSTableStyle;
+class IFDE_CSSVisualStyle;
+class IFDE_CSSComputedStyle;
+class IFDE_CSSTagProvider;
+class IFDE_CSSAccelerator;
+class IFDE_CSSStyleSelector;
+class IFDE_CSSCounterContext;
+class IFDE_CSSCounterManager;
+class IFDE_CSSQuoteContext;
+class IFDE_CSSContentContext;
+class IFDE_CSSMultiColumnContext;
+class IFDE_CSSFloatContext;
+enum FDE_CSSVALUETYPE {
+ FDE_CSSVALUETYPE_Primitive = 1,
+ FDE_CSSVALUETYPE_List = 2,
+ FDE_CSSVALUETYPE_Shorthand,
+};
+enum FDE_CSSPRIMITIVETYPE {
+ FDE_CSSPRIMITIVETYPE_Unknown = 0,
+ FDE_CSSPRIMITIVETYPE_Number = 1,
+ FDE_CSSPRIMITIVETYPE_Percent = 2,
+ FDE_CSSPRIMITIVETYPE_EMS = 3,
+ FDE_CSSPRIMITIVETYPE_EXS = 4,
+ FDE_CSSPRIMITIVETYPE_PX = 5,
+ FDE_CSSPRIMITIVETYPE_CM = 6,
+ FDE_CSSPRIMITIVETYPE_MM = 7,
+ FDE_CSSPRIMITIVETYPE_IN = 8,
+ FDE_CSSPRIMITIVETYPE_PT = 9,
+ FDE_CSSPRIMITIVETYPE_PC = 10,
+ FDE_CSSPRIMITIVETYPE_String = 19,
+ FDE_CSSPRIMITIVETYPE_URI = 20,
+ FDE_CSSPRIMITIVETYPE_RGB = 25,
+ FDE_CSSPRIMITIVETYPE_Enum,
+ FDE_CSSPRIMITIVETYPE_Function,
+};
+enum FDE_CSSPROPERTYVALUE {
+ FDE_CSSPROPERTYVALUE_Bolder,
+ FDE_CSSPROPERTYVALUE_LowerLatin,
+ FDE_CSSPROPERTYVALUE_Lowercase,
+ FDE_CSSPROPERTYVALUE_LowerGreek,
+ FDE_CSSPROPERTYVALUE_Sesame,
+ FDE_CSSPROPERTYVALUE_None,
+ FDE_CSSPROPERTYVALUE_NwResize,
+ FDE_CSSPROPERTYVALUE_WResize,
+ FDE_CSSPROPERTYVALUE_Dot,
+ FDE_CSSPROPERTYVALUE_End,
+ FDE_CSSPROPERTYVALUE_Ltr,
+ FDE_CSSPROPERTYVALUE_Pre,
+ FDE_CSSPROPERTYVALUE_Rtl,
+ FDE_CSSPROPERTYVALUE_Sub,
+ FDE_CSSPROPERTYVALUE_Top,
+ FDE_CSSPROPERTYVALUE_Visible,
+ FDE_CSSPROPERTYVALUE_Filled,
+ FDE_CSSPROPERTYVALUE_SwResize,
+ FDE_CSSPROPERTYVALUE_NoRepeat,
+ FDE_CSSPROPERTYVALUE_Default,
+ FDE_CSSPROPERTYVALUE_Transparent,
+ FDE_CSSPROPERTYVALUE_Ridge,
+ FDE_CSSPROPERTYVALUE_Right,
+ FDE_CSSPROPERTYVALUE_HorizontalTb,
+ FDE_CSSPROPERTYVALUE_DistributeLetter,
+ FDE_CSSPROPERTYVALUE_DoubleCircle,
+ FDE_CSSPROPERTYVALUE_Ruby,
+ FDE_CSSPROPERTYVALUE_Collapse,
+ FDE_CSSPROPERTYVALUE_Normal,
+ FDE_CSSPROPERTYVALUE_Avoid,
+ FDE_CSSPROPERTYVALUE_UpperRoman,
+ FDE_CSSPROPERTYVALUE_Auto,
+ FDE_CSSPROPERTYVALUE_Text,
+ FDE_CSSPROPERTYVALUE_XSmall,
+ FDE_CSSPROPERTYVALUE_Thin,
+ FDE_CSSPROPERTYVALUE_Repeat,
+ FDE_CSSPROPERTYVALUE_Small,
+ FDE_CSSPROPERTYVALUE_NeResize,
+ FDE_CSSPROPERTYVALUE_NoContent,
+ FDE_CSSPROPERTYVALUE_Outside,
+ FDE_CSSPROPERTYVALUE_EResize,
+ FDE_CSSPROPERTYVALUE_TableRow,
+ FDE_CSSPROPERTYVALUE_Bottom,
+ FDE_CSSPROPERTYVALUE_Underline,
+ FDE_CSSPROPERTYVALUE_CjkIdeographic,
+ FDE_CSSPROPERTYVALUE_SeResize,
+ FDE_CSSPROPERTYVALUE_Fixed,
+ FDE_CSSPROPERTYVALUE_Double,
+ FDE_CSSPROPERTYVALUE_Solid,
+ FDE_CSSPROPERTYVALUE_RubyBaseGroup,
+ FDE_CSSPROPERTYVALUE_OpenQuote,
+ FDE_CSSPROPERTYVALUE_Lighter,
+ FDE_CSSPROPERTYVALUE_LowerRoman,
+ FDE_CSSPROPERTYVALUE_Strict,
+ FDE_CSSPROPERTYVALUE_TableCaption,
+ FDE_CSSPROPERTYVALUE_Oblique,
+ FDE_CSSPROPERTYVALUE_Decimal,
+ FDE_CSSPROPERTYVALUE_Loose,
+ FDE_CSSPROPERTYVALUE_Hebrew,
+ FDE_CSSPROPERTYVALUE_Hidden,
+ FDE_CSSPROPERTYVALUE_Dashed,
+ FDE_CSSPROPERTYVALUE_Embed,
+ FDE_CSSPROPERTYVALUE_TableRowGroup,
+ FDE_CSSPROPERTYVALUE_TableColumn,
+ FDE_CSSPROPERTYVALUE_Static,
+ FDE_CSSPROPERTYVALUE_Outset,
+ FDE_CSSPROPERTYVALUE_DecimalLeadingZero,
+ FDE_CSSPROPERTYVALUE_KeepWords,
+ FDE_CSSPROPERTYVALUE_KatakanaIroha,
+ FDE_CSSPROPERTYVALUE_Super,
+ FDE_CSSPROPERTYVALUE_Center,
+ FDE_CSSPROPERTYVALUE_TableHeaderGroup,
+ FDE_CSSPROPERTYVALUE_Inside,
+ FDE_CSSPROPERTYVALUE_XxLarge,
+ FDE_CSSPROPERTYVALUE_Triangle,
+ FDE_CSSPROPERTYVALUE_RubyTextGroup,
+ FDE_CSSPROPERTYVALUE_Circle,
+ FDE_CSSPROPERTYVALUE_Hiragana,
+ FDE_CSSPROPERTYVALUE_RepeatX,
+ FDE_CSSPROPERTYVALUE_RepeatY,
+ FDE_CSSPROPERTYVALUE_Move,
+ FDE_CSSPROPERTYVALUE_HiraganaIroha,
+ FDE_CSSPROPERTYVALUE_RubyBase,
+ FDE_CSSPROPERTYVALUE_Scroll,
+ FDE_CSSPROPERTYVALUE_Smaller,
+ FDE_CSSPROPERTYVALUE_TableFooterGroup,
+ FDE_CSSPROPERTYVALUE_Baseline,
+ FDE_CSSPROPERTYVALUE_Separate,
+ FDE_CSSPROPERTYVALUE_Armenian,
+ FDE_CSSPROPERTYVALUE_Open,
+ FDE_CSSPROPERTYVALUE_Relative,
+ FDE_CSSPROPERTYVALUE_Thick,
+ FDE_CSSPROPERTYVALUE_Justify,
+ FDE_CSSPROPERTYVALUE_Middle,
+ FDE_CSSPROPERTYVALUE_Always,
+ FDE_CSSPROPERTYVALUE_DistributeSpace,
+ FDE_CSSPROPERTYVALUE_LineEdge,
+ FDE_CSSPROPERTYVALUE_PreWrap,
+ FDE_CSSPROPERTYVALUE_Medium,
+ FDE_CSSPROPERTYVALUE_NResize,
+ FDE_CSSPROPERTYVALUE_ListItem,
+ FDE_CSSPROPERTYVALUE_Show,
+ FDE_CSSPROPERTYVALUE_Currentcolor,
+ FDE_CSSPROPERTYVALUE_NoCloseQuote,
+ FDE_CSSPROPERTYVALUE_VerticalLr,
+ FDE_CSSPROPERTYVALUE_VerticalRl,
+ FDE_CSSPROPERTYVALUE_Pointer,
+ FDE_CSSPROPERTYVALUE_XxSmall,
+ FDE_CSSPROPERTYVALUE_Bold,
+ FDE_CSSPROPERTYVALUE_Both,
+ FDE_CSSPROPERTYVALUE_SmallCaps,
+ FDE_CSSPROPERTYVALUE_Katakana,
+ FDE_CSSPROPERTYVALUE_After,
+ FDE_CSSPROPERTYVALUE_Horizontal,
+ FDE_CSSPROPERTYVALUE_Dotted,
+ FDE_CSSPROPERTYVALUE_Disc,
+ FDE_CSSPROPERTYVALUE_Georgian,
+ FDE_CSSPROPERTYVALUE_Inline,
+ FDE_CSSPROPERTYVALUE_Overline,
+ FDE_CSSPROPERTYVALUE_Wait,
+ FDE_CSSPROPERTYVALUE_BreakAll,
+ FDE_CSSPROPERTYVALUE_UpperAlpha,
+ FDE_CSSPROPERTYVALUE_Capitalize,
+ FDE_CSSPROPERTYVALUE_Nowrap,
+ FDE_CSSPROPERTYVALUE_TextBottom,
+ FDE_CSSPROPERTYVALUE_NoOpenQuote,
+ FDE_CSSPROPERTYVALUE_Groove,
+ FDE_CSSPROPERTYVALUE_Progress,
+ FDE_CSSPROPERTYVALUE_Larger,
+ FDE_CSSPROPERTYVALUE_CloseQuote,
+ FDE_CSSPROPERTYVALUE_TableCell,
+ FDE_CSSPROPERTYVALUE_PreLine,
+ FDE_CSSPROPERTYVALUE_Absolute,
+ FDE_CSSPROPERTYVALUE_InlineTable,
+ FDE_CSSPROPERTYVALUE_BidiOverride,
+ FDE_CSSPROPERTYVALUE_InlineBlock,
+ FDE_CSSPROPERTYVALUE_Inset,
+ FDE_CSSPROPERTYVALUE_Crosshair,
+ FDE_CSSPROPERTYVALUE_UpperLatin,
+ FDE_CSSPROPERTYVALUE_Help,
+ FDE_CSSPROPERTYVALUE_Hide,
+ FDE_CSSPROPERTYVALUE_Uppercase,
+ FDE_CSSPROPERTYVALUE_SResize,
+ FDE_CSSPROPERTYVALUE_Table,
+ FDE_CSSPROPERTYVALUE_Blink,
+ FDE_CSSPROPERTYVALUE_Block,
+ FDE_CSSPROPERTYVALUE_Start,
+ FDE_CSSPROPERTYVALUE_TableColumnGroup,
+ FDE_CSSPROPERTYVALUE_Italic,
+ FDE_CSSPROPERTYVALUE_LineThrough,
+ FDE_CSSPROPERTYVALUE_KeepAll,
+ FDE_CSSPROPERTYVALUE_LowerAlpha,
+ FDE_CSSPROPERTYVALUE_RunIn,
+ FDE_CSSPROPERTYVALUE_Square,
+ FDE_CSSPROPERTYVALUE_XLarge,
+ FDE_CSSPROPERTYVALUE_Large,
+ FDE_CSSPROPERTYVALUE_Before,
+ FDE_CSSPROPERTYVALUE_Left,
+ FDE_CSSPROPERTYVALUE_TextTop,
+ FDE_CSSPROPERTYVALUE_RubyText,
+ FDE_CSSPROPERTYVALUE_NoDisplay,
+ FDE_CSSPROPERTYVALUE_MAX
+};
+class IFDE_CSSValue
+{
+public:
+ virtual FDE_CSSVALUETYPE GetType() const = 0;
+};
+class IFDE_CSSPrimitiveValue : public IFDE_CSSValue
+{
+public:
+ virtual FDE_CSSVALUETYPE GetType() const
+ {
+ return FDE_CSSVALUETYPE_Primitive;
+ }
+ virtual FDE_CSSPRIMITIVETYPE GetPrimitiveType() const = 0;
+ virtual FX_ARGB GetRGBColor() const = 0;
+ virtual FX_FLOAT GetFloat() const = 0;
+ virtual FX_LPCWSTR GetString(FX_INT32 &iLength) const = 0;
+ virtual FDE_CSSPROPERTYVALUE GetEnum() const = 0;
+ virtual FX_LPCWSTR GetFuncName() const = 0;
+ virtual FX_INT32 CountArgs() const = 0;
+ virtual IFDE_CSSValue* GetArgs(FX_INT32 index) const = 0;
+};
+class IFDE_CSSValueList : public IFDE_CSSValue
+{
+public:
+ virtual FDE_CSSVALUETYPE GetType() const
+ {
+ return FDE_CSSVALUETYPE_List;
+ }
+ virtual FX_INT32 CountValues() const = 0;
+ virtual IFDE_CSSValue* GetValue(FX_INT32 index) const = 0;
+};
+enum FDE_CSSPROPERTY {
+ FDE_CSSPROPERTY_WritingMode,
+ FDE_CSSPROPERTY_ColumnRuleWidth,
+ FDE_CSSPROPERTY_BorderLeft,
+ FDE_CSSPROPERTY_ColumnRule,
+ FDE_CSSPROPERTY_Height,
+ FDE_CSSPROPERTY_CounterReset,
+ FDE_CSSPROPERTY_Content,
+ FDE_CSSPROPERTY_RubyPosition,
+ FDE_CSSPROPERTY_BackgroundColor,
+ FDE_CSSPROPERTY_Width,
+ FDE_CSSPROPERTY_Src,
+ FDE_CSSPROPERTY_Top,
+ FDE_CSSPROPERTY_Margin,
+ FDE_CSSPROPERTY_BorderColor,
+ FDE_CSSPROPERTY_Widows,
+ FDE_CSSPROPERTY_BorderBottomColor,
+ FDE_CSSPROPERTY_TextIndent,
+ FDE_CSSPROPERTY_Right,
+ FDE_CSSPROPERTY_TextEmphasisStyle,
+ FDE_CSSPROPERTY_PaddingLeft,
+ FDE_CSSPROPERTY_ColumnWidth,
+ FDE_CSSPROPERTY_MarginLeft,
+ FDE_CSSPROPERTY_Border,
+ FDE_CSSPROPERTY_BorderTop,
+ FDE_CSSPROPERTY_RubyOverhang,
+ FDE_CSSPROPERTY_PageBreakBefore,
+ FDE_CSSPROPERTY_MaxHeight,
+ FDE_CSSPROPERTY_MinWidth,
+ FDE_CSSPROPERTY_BorderLeftColor,
+ FDE_CSSPROPERTY_Bottom,
+ FDE_CSSPROPERTY_Quotes,
+ FDE_CSSPROPERTY_MaxWidth,
+ FDE_CSSPROPERTY_PaddingRight,
+ FDE_CSSPROPERTY_ListStyleImage,
+ FDE_CSSPROPERTY_WhiteSpace,
+ FDE_CSSPROPERTY_BorderBottom,
+ FDE_CSSPROPERTY_ListStyleType,
+ FDE_CSSPROPERTY_WordBreak,
+ FDE_CSSPROPERTY_OverflowX,
+ FDE_CSSPROPERTY_OverflowY,
+ FDE_CSSPROPERTY_BorderTopColor,
+ FDE_CSSPROPERTY_FontFamily,
+ FDE_CSSPROPERTY_Cursor,
+ FDE_CSSPROPERTY_RubyAlign,
+ FDE_CSSPROPERTY_ColumnRuleColor,
+ FDE_CSSPROPERTY_FontWeight,
+ FDE_CSSPROPERTY_BorderRightStyle,
+ FDE_CSSPROPERTY_MinHeight,
+ FDE_CSSPROPERTY_Color,
+ FDE_CSSPROPERTY_LetterSpacing,
+ FDE_CSSPROPERTY_EmptyCells,
+ FDE_CSSPROPERTY_TextAlign,
+ FDE_CSSPROPERTY_RubySpan,
+ FDE_CSSPROPERTY_Position,
+ FDE_CSSPROPERTY_BorderStyle,
+ FDE_CSSPROPERTY_BorderBottomStyle,
+ FDE_CSSPROPERTY_BorderCollapse,
+ FDE_CSSPROPERTY_ColumnCount,
+ FDE_CSSPROPERTY_BorderRightWidth,
+ FDE_CSSPROPERTY_UnicodeBidi,
+ FDE_CSSPROPERTY_VerticalAlign,
+ FDE_CSSPROPERTY_PaddingTop,
+ FDE_CSSPROPERTY_Columns,
+ FDE_CSSPROPERTY_Overflow,
+ FDE_CSSPROPERTY_TableLayout,
+ FDE_CSSPROPERTY_FontVariant,
+ FDE_CSSPROPERTY_ListStyle,
+ FDE_CSSPROPERTY_BackgroundPosition,
+ FDE_CSSPROPERTY_BorderWidth,
+ FDE_CSSPROPERTY_TextEmphasisColor,
+ FDE_CSSPROPERTY_BorderLeftStyle,
+ FDE_CSSPROPERTY_PageBreakInside,
+ FDE_CSSPROPERTY_TextEmphasis,
+ FDE_CSSPROPERTY_BorderBottomWidth,
+ FDE_CSSPROPERTY_ColumnGap,
+ FDE_CSSPROPERTY_Orphans,
+ FDE_CSSPROPERTY_BorderRight,
+ FDE_CSSPROPERTY_FontSize,
+ FDE_CSSPROPERTY_PageBreakAfter,
+ FDE_CSSPROPERTY_CaptionSide,
+ FDE_CSSPROPERTY_BackgroundRepeat,
+ FDE_CSSPROPERTY_BorderTopStyle,
+ FDE_CSSPROPERTY_BorderSpacing,
+ FDE_CSSPROPERTY_TextTransform,
+ FDE_CSSPROPERTY_FontStyle,
+ FDE_CSSPROPERTY_Font,
+ FDE_CSSPROPERTY_LineHeight,
+ FDE_CSSPROPERTY_MarginRight,
+ FDE_CSSPROPERTY_Float,
+ FDE_CSSPROPERTY_BorderLeftWidth,
+ FDE_CSSPROPERTY_Display,
+ FDE_CSSPROPERTY_Clear,
+ FDE_CSSPROPERTY_ColumnRuleStyle,
+ FDE_CSSPROPERTY_TextCombine,
+ FDE_CSSPROPERTY_ListStylePosition,
+ FDE_CSSPROPERTY_Visibility,
+ FDE_CSSPROPERTY_PaddingBottom,
+ FDE_CSSPROPERTY_BackgroundAttachment,
+ FDE_CSSPROPERTY_BackgroundImage,
+ FDE_CSSPROPERTY_LineBreak,
+ FDE_CSSPROPERTY_Background,
+ FDE_CSSPROPERTY_BorderTopWidth,
+ FDE_CSSPROPERTY_WordSpacing,
+ FDE_CSSPROPERTY_BorderRightColor,
+ FDE_CSSPROPERTY_CounterIncrement,
+ FDE_CSSPROPERTY_Left,
+ FDE_CSSPROPERTY_TextDecoration,
+ FDE_CSSPROPERTY_Padding,
+ FDE_CSSPROPERTY_MarginBottom,
+ FDE_CSSPROPERTY_MarginTop,
+ FDE_CSSPROPERTY_Direction,
+ FDE_CSSPROPERTY_MAX
+};
+class IFDE_CSSDeclaration
+{
+public:
+ virtual IFDE_CSSValue* GetProperty(FDE_CSSPROPERTY eProperty, FX_BOOL &bImportant) const = 0;
+ virtual FX_POSITION GetStartPosition() const = 0;
+ virtual void GetNextProperty(FX_POSITION &pos, FDE_CSSPROPERTY &eProperty, IFDE_CSSValue *&pValue, FX_BOOL &bImportant) const = 0;
+ virtual FX_POSITION GetStartCustom() const = 0;
+ virtual void GetNextCustom(FX_POSITION &pos, CFX_WideString &wsName, CFX_WideString &wsValue) const = 0;
+};
+typedef CFX_ArrayTemplate<IFDE_CSSDeclaration*> CFDE_CSSDeclarationArray;
+enum FDE_CSSPERSUDO {
+ FDE_CSSPERSUDO_After,
+ FDE_CSSPERSUDO_Before,
+ FDE_CSSPERSUDO_NONE
+};
+enum FDE_CSSSELECTORTYPE {
+ FDE_CSSSELECTORTYPE_Element,
+ FDE_CSSSELECTORTYPE_Descendant,
+ FDE_CSSSELECTORTYPE_Class,
+ FDE_CSSSELECTORTYPE_Persudo,
+ FDE_CSSSELECTORTYPE_ID,
+};
+class IFDE_CSSSelector
+{
+public:
+ virtual FDE_CSSSELECTORTYPE GetType() const = 0;
+ virtual FX_DWORD GetNameHash() const = 0;
+ virtual IFDE_CSSSelector* GetNextSelector() const = 0;
+};
+#define FDE_CSSMEDIATYPE_Braille 0x01
+#define FDE_CSSMEDIATYPE_Emboss 0x02
+#define FDE_CSSMEDIATYPE_Handheld 0x04
+#define FDE_CSSMEDIATYPE_Print 0x08
+#define FDE_CSSMEDIATYPE_Projection 0x10
+#define FDE_CSSMEDIATYPE_Screen 0x20
+#define FDE_CSSMEDIATYPE_TTY 0x40
+#define FDE_CSSMEDIATYPE_TV 0x80
+#define FDE_CSSMEDIATYPE_ALL 0xFF
+enum FDE_CSSRULETYPE {
+ FDE_CSSRULETYPE_Unknown = 0,
+ FDE_CSSRULETYPE_Style = 1,
+ FDE_CSSRULETYPE_Media = 4,
+ FDE_CSSRULETYPE_FontFace = 5,
+};
+class IFDE_CSSRule
+{
+public:
+ virtual FDE_CSSRULETYPE GetType() const = 0;
+};
+typedef CFX_MassArrayTemplate<IFDE_CSSRule*> CFDE_CSSRuleArray;
+class IFDE_CSSStyleRule : public IFDE_CSSRule
+{
+public:
+ virtual FDE_CSSRULETYPE GetType() const
+ {
+ return FDE_CSSRULETYPE_Style;
+ }
+ virtual FX_INT32 CountSelectorLists() const = 0;
+ virtual IFDE_CSSSelector* GetSelectorList(FX_INT32 index) const = 0;
+ virtual IFDE_CSSDeclaration* GetDeclaration() const = 0;
+};
+class IFDE_CSSMediaRule : public IFDE_CSSRule
+{
+public:
+ virtual FDE_CSSRULETYPE GetType() const
+ {
+ return FDE_CSSRULETYPE_Media;
+ }
+ virtual FX_DWORD GetMediaList() const = 0;
+ virtual FX_INT32 CountRules() const = 0;
+ virtual IFDE_CSSRule* GetRule(FX_INT32 index) = 0;
+};
+class IFDE_CSSFontFaceRule : public IFDE_CSSRule
+{
+public:
+ virtual FDE_CSSRULETYPE GetType() const
+ {
+ return FDE_CSSRULETYPE_FontFace;
+ }
+ virtual IFDE_CSSDeclaration* GetDeclaration() const = 0;
+};
+class IFDE_CSSStyleSheet : public IFX_Unknown
+{
+public:
+ static IFDE_CSSStyleSheet* LoadHTMLStandardStyleSheet();
+ static IFDE_CSSStyleSheet* LoadFromStream(const CFX_WideString &szUrl, IFX_Stream *pStream, FX_WORD wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL);
+ static IFDE_CSSStyleSheet* LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL);
+ virtual FX_BOOL GetUrl(CFX_WideString &szUrl) = 0;
+ virtual FX_DWORD GetMediaList() const = 0;
+ virtual FX_WORD GetCodePage() const = 0;
+
+ virtual FX_INT32 CountRules() const = 0;
+ virtual IFDE_CSSRule* GetRule(FX_INT32 index) = 0;
+};
+typedef CFX_ArrayTemplate<IFDE_CSSStyleSheet*> CFDE_CSSStyleSheetArray;
+#define FDE_CSSUSERSTYLESHEET (FX_BSTRC("#USERSHEET"))
+#define FDE_CSSUAGENTSTYLESHEET (FX_BSTRC("#AGENTSHEET"))
+class IFDE_CSSStyleSheetCache
+{
+public:
+ static IFDE_CSSStyleSheetCache* Create();
+ virtual void Release() = 0;
+ virtual void SetMaxItems(FX_INT32 iMaxCount = 5) = 0;
+ virtual void AddStyleSheet(FX_BSTR szKey, IFDE_CSSStyleSheet *pStyleSheet) = 0;
+ virtual IFDE_CSSStyleSheet* GetStyleSheet(FX_BSTR szKey) const = 0;
+ virtual void RemoveStyleSheet(FX_BSTR szKey) = 0;
+};
+enum FDE_CSSSYNTAXSTATUS {
+ FDE_CSSSYNTAXSTATUS_Error,
+ FDE_CSSSYNTAXSTATUS_EOS,
+ FDE_CSSSYNTAXSTATUS_None,
+ FDE_CSSSYNTAXSTATUS_Charset,
+ FDE_CSSSYNTAXSTATUS_ImportRule,
+ FDE_CSSSYNTAXSTATUS_ImportClose,
+ FDE_CSSSYNTAXSTATUS_PageRule,
+ FDE_CSSSYNTAXSTATUS_StyleRule,
+ FDE_CSSSYNTAXSTATUS_FontFaceRule,
+ FDE_CSSSYNTAXSTATUS_MediaRule,
+ FDE_CSSSYNTAXSTATUS_MediaType,
+ FDE_CSSSYNTAXSTATUS_URI,
+ FDE_CSSSYNTAXSTATUS_Selector,
+ FDE_CSSSYNTAXSTATUS_DeclOpen,
+ FDE_CSSSYNTAXSTATUS_DeclClose,
+ FDE_CSSSYNTAXSTATUS_PropertyName,
+ FDE_CSSSYNTAXSTATUS_PropertyValue,
+};
+class IFDE_CSSSyntaxParser
+{
+public:
+ static IFDE_CSSSyntaxParser* Create();
+ virtual void Release() = 0;
+ virtual FX_BOOL Init(IFX_Stream *pStream, FX_INT32 iCSSPlaneSize, FX_INT32 iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0;
+ virtual FX_BOOL Init(FX_LPCWSTR pBuffer, FX_INT32 iBufferSize, FX_INT32 iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0;
+
+ virtual FDE_CSSSYNTAXSTATUS DoSyntaxParse() = 0;
+ virtual FX_LPCWSTR GetCurrentString(FX_INT32 &iLength) const = 0;
+};
+enum FDE_CSSLENGTHUNIT {
+ FDE_CSSLENGTHUNIT_Auto,
+ FDE_CSSLENGTHUNIT_None,
+ FDE_CSSLENGTHUNIT_Normal,
+ FDE_CSSLENGTHUNIT_Point,
+ FDE_CSSLENGTHUNIT_Percent,
+};
+#define FDE_CSSUNITBITS (3)
+#define FDE_CSSUNITMASK ((1 << FDE_CSSUNITBITS) - 1)
+struct FDE_CSSLENGTH {
+ FDE_CSSLENGTH& Set(FDE_CSSLENGTHUNIT eUnit)
+ {
+ m_iData = eUnit;
+ return *this;
+ }
+ FDE_CSSLENGTH& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue)
+ {
+ m_iData = ((FX_INTPTR)(fValue * 1024.0f) << FDE_CSSUNITBITS) | eUnit;
+ return *this;
+ }
+ FDE_CSSLENGTHUNIT GetUnit() const
+ {
+ return (FDE_CSSLENGTHUNIT)(m_iData & FDE_CSSUNITMASK);
+ }
+ FX_FLOAT GetValue() const
+ {
+ return (m_iData >> FDE_CSSUNITBITS) / 1024.0f;
+ }
+ FX_BOOL NonZero() const
+ {
+ return (m_iData >> FDE_CSSUNITBITS) != 0;
+ }
+private:
+ FX_INTPTR m_iData;
+};
+struct FDE_CSSPOINT {
+ FDE_CSSPOINT& Set(FDE_CSSLENGTHUNIT eUnit)
+ {
+ x.Set(eUnit);
+ y.Set(eUnit);
+ return *this;
+ }
+ FDE_CSSPOINT& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue)
+ {
+ x.Set(eUnit, fValue);
+ y.Set(eUnit, fValue);
+ return *this;
+ }
+ FDE_CSSLENGTH x, y;
+};
+struct FDE_CSSSIZE {
+ FDE_CSSSIZE& Set(FDE_CSSLENGTHUNIT eUnit)
+ {
+ cx.Set(eUnit);
+ cy.Set(eUnit);
+ return *this;
+ }
+ FDE_CSSSIZE& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue)
+ {
+ cx.Set(eUnit, fValue);
+ cy.Set(eUnit, fValue);
+ return *this;
+ }
+ FDE_CSSLENGTH cx, cy;
+};
+struct FDE_CSSRECT {
+ FDE_CSSRECT& Set(FDE_CSSLENGTHUNIT eUnit)
+ {
+ left.Set(eUnit);
+ top.Set(eUnit);
+ right.Set(eUnit);
+ bottom.Set(eUnit);
+ return *this;
+ }
+ FDE_CSSRECT& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue)
+ {
+ left.Set(eUnit, fValue);
+ top.Set(eUnit, fValue);
+ right.Set(eUnit, fValue);
+ bottom.Set(eUnit, fValue);
+ return *this;
+ }
+
+ FDE_CSSLENGTH left, top, right, bottom;
+};
+enum FDE_CSSBKGATTACHMENT {
+ FDE_CSSBKGATTACHMENT_Scroll,
+ FDE_CSSBKGATTACHMENT_Fixed,
+};
+enum FDE_CSSBKGREPEAT {
+ FDE_CSSBKGREPEAT_Repeat,
+ FDE_CSSBKGREPEAT_RepeatX,
+ FDE_CSSBKGREPEAT_RepeatY,
+ FDE_CSSBKGREPEAT_NoRepeat,
+};
+enum FDE_CSSBORDERSTYLE {
+ FDE_CSSBORDERSTYLE_None,
+ FDE_CSSBORDERSTYLE_Hidden,
+ FDE_CSSBORDERSTYLE_Dotted,
+ FDE_CSSBORDERSTYLE_Dashed,
+ FDE_CSSBORDERSTYLE_Solid,
+ FDE_CSSBORDERSTYLE_Double,
+ FDE_CSSBORDERSTYLE_Groove,
+ FDE_CSSBORDERSTYLE_Ridge,
+ FDE_CSSBORDERSTYLE_Inset,
+ FDE_CSSBORDERSTYLE_outset,
+};
+enum FDE_CSSCLEAR {
+ FDE_CSSCLEAR_None,
+ FDE_CSSCLEAR_Left,
+ FDE_CSSCLEAR_Right,
+ FDE_CSSCLEAR_Both,
+};
+enum FDE_CSSDISPLAY {
+ FDE_CSSDISPLAY_None,
+ FDE_CSSDISPLAY_ListItem,
+ FDE_CSSDISPLAY_RunIn,
+ FDE_CSSDISPLAY_Block,
+ FDE_CSSDISPLAY_Inline,
+ FDE_CSSDISPLAY_InlineBlock,
+ FDE_CSSDISPLAY_InlineTable,
+ FDE_CSSDISPLAY_Table,
+ FDE_CSSDISPLAY_TableRow,
+ FDE_CSSDISPLAY_TableCell,
+ FDE_CSSDISPLAY_TableCaption,
+ FDE_CSSDISPLAY_TableColumn,
+ FDE_CSSDISPLAY_TableRowGroup,
+ FDE_CSSDISPLAY_TableColumnGroup,
+ FDE_CSSDISPLAY_TableHeaderGroup,
+ FDE_CSSDISPLAY_TableFooterGroup,
+ FDE_CSSDISPLAY_Ruby,
+ FDE_CSSDISPLAY_RubyBase,
+ FDE_CSSDISPLAY_RubyText,
+ FDE_CSSDISPLSY_RubyBaseGroup,
+ FDE_CSSDISPLAY_RubyTextGroup,
+};
+enum FDE_CSSVISIBILITY {
+ FDE_CSSVISIBILITY_Visible,
+ FDE_CSSVISIBILITY_Hidden,
+ FDE_CSSVISIBILITY_Collapse,
+};
+enum FDE_CSSFONTSTYLE {
+ FDE_CSSFONTSTYLE_Normal,
+ FDE_CSSFONTSTYLE_Italic,
+};
+enum FDE_CSSFLOAT {
+ FDE_CSSFLOAT_None,
+ FDE_CSSFLOAT_Left,
+ FDE_CSSFLOAT_Right,
+};
+enum FDE_CSSWRITINGMODE {
+ FDE_CSSWRITINGMODE_HorizontalTb,
+ FDE_CSSWRITINGMODE_VerticalRl,
+ FDE_CSSWRITINGMODE_VerticalLr,
+};
+enum FDE_CSSWORDBREAK {
+ FDE_CSSWORDBREAK_Normal,
+ FDE_CSSWORDBREAK_KeepAll,
+ FDE_CSSWORDBREAK_BreakAll,
+ FDE_CSSWORDBREAK_KeepWords,
+};
+enum FDE_CSSPAGEBREAK {
+ FDE_CSSPAGEBREAK_Auto,
+ FDE_CSSPAGEBREAK_Always,
+ FDE_CSSPAGEBREAK_Avoid,
+ FDE_CSSPAGEBREAK_Left,
+ FDE_CSSPAGEBREAK_Right,
+};
+enum FDE_CSSOVERFLOW {
+ FDE_CSSOVERFLOW_Visible,
+ FDE_CSSOVERFLOW_Hidden,
+ FDE_CSSOVERFLOW_Scroll,
+ FDE_CSSOVERFLOW_Auto,
+ FDE_CSSOVERFLOW_NoDisplay,
+ FDE_CSSOVERFLOW_NoContent,
+};
+enum FDE_CSSLINEBREAK {
+ FDE_CSSLINEBREAK_Auto,
+ FDE_CSSLINEBREAK_Loose,
+ FDE_CSSLINEBREAK_Normal,
+ FDE_CSSLINEBREAK_Strict,
+};
+enum FDE_CSSTEXTEMPHASISFILL {
+ FDE_CSSTEXTEMPHASISFILL_Filled,
+ FDE_CSSTEXTEMPHASISFILL_Open,
+};
+enum FDE_CSSTEXTEMPHASISMARK {
+ FDE_CSSTEXTEMPHASISMARK_None,
+ FDE_CSSTEXTEMPHASISMARK_Auto,
+ FDE_CSSTEXTEMPHASISMARK_Dot,
+ FDE_CSSTEXTEMPHASISMARK_Circle,
+ FDE_CSSTEXTEMPHASISMARK_DoubleCircle,
+ FDE_CSSTEXTEMPHASISMARK_Triangle,
+ FDE_CSSTEXTEMPHASISMARK_Sesame,
+ FDE_CSSTEXTEMPHASISMARK_Custom,
+};
+enum FDE_CSSTEXTCOMBINE {
+ FDE_CSSTEXTCOMBINE_Horizontal,
+ FDE_CSSTEXTCOMBINE_None,
+};
+enum FDE_CSSCURSOR {
+ FDE_CSSCURSOR_Auto,
+ FDE_CSSCURSOR_Crosshair,
+ FDE_CSSCURSOR_Default,
+ FDE_CSSCURSOR_Pointer,
+ FDE_CSSCURSOR_Move,
+ FDE_CSSCURSOR_EResize,
+ FDE_CSSCURSOR_NeResize,
+ FDE_CSSCURSOR_NwResize,
+ FDE_CSSCURSOR_NResize,
+ FDE_CSSCURSOR_SeResize,
+ FDE_CSSCURSOR_SwResize,
+ FDE_CSSCURSOR_SResize,
+ FDE_CSSCURSOR_WResize,
+ FDE_CSSCURSOR_Text,
+ FDE_CSSCURSOR_Wait,
+ FDE_CSSCURSOR_Help,
+ FDE_CSSCURSOR_Progress,
+};
+enum FDE_CSSPOSITION {
+ FDE_CSSPOSITION_Static,
+ FDE_CSSPOSITION_Relative,
+ FDE_CSSPOSITION_Absolute,
+ FDE_CSSPOSITION_Fixed,
+};
+enum FDE_CSSCAPTIONSIDE {
+ FDE_CSSCAPTIONSIDE_Top,
+ FDE_CSSCAPTIONSIDE_Bottom,
+ FDE_CSSCAPTIONSIDE_Left,
+ FDE_CSSCAPTIONSIDE_Right,
+ FDE_CSSCAPTIONSIDE_Before,
+ FDE_CSSCAPTIONSIDE_After,
+};
+enum FDE_CSSRUBYALIGN {
+ FDE_CSSRUBYALIGN_Auto,
+ FDE_CSSRUBYALIGN_Start,
+ FDE_CSSRUBYALIGN_Left,
+ FDE_CSSRUBYALIGN_Center,
+ FDE_CSSRUBYALIGN_End,
+ FDE_CSSRUBYALIGN_Right,
+ FDE_CSSRUBYALIGN_DistributeLetter,
+ FDE_CSSRUBYALIGN_DistributeSpace,
+ FDE_CSSRUBYALIGN_LineEdge,
+};
+enum FDE_CSSRUBYOVERHANG {
+ FDE_CSSRUBYOVERHANG_Auto,
+ FDE_CSSRUBYOVERHANG_Start,
+ FDE_CSSRUBYOVERHANG_End,
+ FDE_CSSRUBYOVERHANG_None,
+};
+enum FDE_CSSRUBYPOSITION {
+ FDE_CSSRUBYPOSITION_Before,
+ FDE_CSSRUBYPOSITION_After,
+ FDE_CSSRUBYPOSITION_Right,
+ FDE_CSSRUBYPOSITION_Inline,
+};
+enum FDE_CSSRUBYSPAN {
+ FDE_CSSRUBYSPAN_None,
+ FDE_CSSRUBYSPAN_Attr,
+};
+enum FDE_CSSTEXTALIGN {
+ FDE_CSSTEXTALIGN_Left,
+ FDE_CSSTEXTALIGN_Right,
+ FDE_CSSTEXTALIGN_Center,
+ FDE_CSSTEXTALIGN_Justify,
+ FDE_CSSTEXTALIGN_JustifyAll,
+};
+enum FDE_CSSVERTICALALIGN {
+ FDE_CSSVERTICALALIGN_Baseline,
+ FDE_CSSVERTICALALIGN_Sub,
+ FDE_CSSVERTICALALIGN_Super,
+ FDE_CSSVERTICALALIGN_Top,
+ FDE_CSSVERTICALALIGN_TextTop,
+ FDE_CSSVERTICALALIGN_Middle,
+ FDE_CSSVERTICALALIGN_Bottom,
+ FDE_CSSVERTICALALIGN_TextBottom,
+ FDE_CSSVERTICALALIGN_Number,
+};
+enum FDE_CSSLISTSTYLETYPE {
+ FDE_CSSLISTSTYLETYPE_Disc,
+ FDE_CSSLISTSTYLETYPE_Circle,
+ FDE_CSSLISTSTYLETYPE_Square,
+ FDE_CSSLISTSTYLETYPE_Decimal,
+ FDE_CSSLISTSTYLETYPE_DecimalLeadingZero,
+ FDE_CSSLISTSTYLETYPE_LowerRoman,
+ FDE_CSSLISTSTYLETYPE_UpperRoman,
+ FDE_CSSLISTSTYLETYPE_LowerGreek,
+ FDE_CSSLISTSTYLETYPE_LowerLatin,
+ FDE_CSSLISTSTYLETYPE_UpperLatin,
+ FDE_CSSLISTSTYLETYPE_Armenian,
+ FDE_CSSLISTSTYLETYPE_Georgian,
+ FDE_CSSLISTSTYLETYPE_LowerAlpha,
+ FDE_CSSLISTSTYLETYPE_UpperAlpha,
+ FDE_CSSLISTSTYLETYPE_None,
+ FDE_CSSLISTSTYLETYPE_CjkIdeographic,
+ FDE_CSSLISTSTYLETYPE_Hebrew,
+ FDE_CSSLISTSTYLETYPE_Hiragana,
+ FDE_CSSLISTSTYLETYPE_HiraganaIroha,
+ FDE_CSSLISTSTYLETYPE_Katakana,
+ FDE_CSSLISTSTYLETYPE_KatakanaIroha,
+};
+enum FDE_CSSLISTSTYLEPOSITION {
+ FDE_CSSLISTSTYLEPOSITION_Outside,
+ FDE_CSSLISTSTYLEPOSITION_Inside,
+};
+enum FDE_CSSWHITESPACE {
+ FDE_CSSWHITESPACE_Normal,
+ FDE_CSSWHITESPACE_Pre,
+ FDE_CSSWHITESPACE_Nowrap,
+ FDE_CSSWHITESPACE_PreWrap,
+ FDE_CSSWHITESPACE_PreLine,
+};
+enum FDE_CSSFONTVARIANT {
+ FDE_CSSFONTVARIANT_Normal,
+ FDE_CSSFONTVARIANT_SmallCaps,
+};
+enum FDE_CSSTEXTTRANSFORM {
+ FDE_CSSTEXTTRANSFORM_None,
+ FDE_CSSTEXTTRANSFORM_Capitalize,
+ FDE_CSSTEXTTRANSFORM_UpperCase,
+ FDE_CSSTEXTTRANSFORM_LowerCase,
+};
+enum FDE_CSSTEXTDECORATION {
+ FDE_CSSTEXTDECORATION_None = 0,
+ FDE_CSSTEXTDECORATION_Underline = 1,
+ FDE_CSSTEXTDECORATION_Overline = 2,
+ FDE_CSSTEXTDECORATION_LineThrough = 4,
+ FDE_CSSTEXTDECORATION_Blink = 8,
+ FDE_CSSTEXTDECORATION_Double = 16,
+};
+class IFDE_CSSRubyStyle
+{
+public:
+ virtual FDE_CSSRUBYALIGN GetRubyAlign() const = 0;
+ virtual FDE_CSSRUBYOVERHANG GetRubyOverhang() const = 0;
+ virtual FDE_CSSRUBYPOSITION GetRubyPosition() const = 0;
+ virtual FDE_CSSRUBYSPAN GetRubySpanType() const = 0;
+ virtual IFDE_CSSValue* GetRubySpanAttr() const = 0;
+};
+class IFDE_CSSMultiColumnStyle
+{
+public:
+ virtual const FDE_CSSLENGTH& GetColumnCount() const = 0;
+ virtual const FDE_CSSLENGTH& GetColumnGap() const = 0;
+ virtual FX_ARGB GetColumnRuleColor() const = 0;
+ virtual FDE_CSSBORDERSTYLE GetColumnRuleStyle() const = 0;
+ virtual const FDE_CSSLENGTH& GetColumnRuleWidth() const = 0;
+ virtual const FDE_CSSLENGTH& GetColumnWidth() const = 0;
+ virtual void SetColumnCount(const FDE_CSSLENGTH &columnCount) = 0;
+ virtual void SetColumnGap(const FDE_CSSLENGTH &columnGap) = 0;
+ virtual void SetColumnRuleColor(FX_ARGB dwColumnRuleColor) = 0;
+ virtual void SetColumnRuleStyle(FDE_CSSBORDERSTYLE eColumnRuleStyle) = 0;
+ virtual void SetColumnRuleWidth(const FDE_CSSLENGTH &columnRuleWidth) = 0;
+ virtual void SetColumnWidth(const FDE_CSSLENGTH &columnWidth) = 0;
+};
+class IFDE_CSSGeneratedContentStyle
+{
+public:
+ virtual FX_INT32 CountCounters() = 0;
+ virtual FX_LPCWSTR GetCounterIdentifier(FX_INT32 index) = 0;
+ virtual FX_BOOL GetCounterReset(FX_INT32 index, FX_INT32 &iValue) = 0;
+ virtual FX_BOOL GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue) = 0;
+ virtual IFDE_CSSValueList* GetContent() const = 0;
+ virtual FX_INT32 CountQuotes() const = 0;
+ virtual FX_LPCWSTR GetQuotes(FX_INT32 index) const = 0;
+};
+class IFDE_CSSFontStyle
+{
+public:
+ virtual FX_INT32 CountFontFamilies() const = 0;
+ virtual FX_LPCWSTR GetFontFamily(FX_INT32 index) const = 0;
+ virtual FX_WORD GetFontWeight() const = 0;
+ virtual FDE_CSSFONTVARIANT GetFontVariant() const = 0;
+ virtual FDE_CSSFONTSTYLE GetFontStyle() const = 0;
+ virtual FX_FLOAT GetFontSize() const = 0;
+ virtual FX_ARGB GetColor() const = 0;
+ virtual void SetFontWeight(FX_WORD wFontWeight) = 0;
+ virtual void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) = 0;
+ virtual void SetFontStyle(FDE_CSSFONTSTYLE eFontStyle) = 0;
+ virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
+ virtual void SetColor(FX_ARGB dwFontColor) = 0;
+};
+class IFDE_CSSBoundaryStyle
+{
+public:
+ virtual FX_ARGB GetBorderLeftColor() const = 0;
+ virtual FX_ARGB GetBorderTopColor() const = 0;
+ virtual FX_ARGB GetBorderRightColor() const = 0;
+ virtual FX_ARGB GetBorderBottomColor() const = 0;
+ virtual FDE_CSSBORDERSTYLE GetBorderLeftStyle() const = 0;
+ virtual FDE_CSSBORDERSTYLE GetBorderTopStyle() const = 0;
+ virtual FDE_CSSBORDERSTYLE GetBorderRightStyle() const = 0;
+ virtual FDE_CSSBORDERSTYLE GetBorderBottomStyle() const = 0;
+ virtual const FDE_CSSRECT* GetBorderWidth() const = 0;
+ virtual const FDE_CSSRECT* GetMarginWidth() const = 0;
+ virtual const FDE_CSSRECT* GetPaddingWidth() const = 0;
+ virtual void SetBorderLeftColor(FX_ARGB dwBorderColor) = 0;
+ virtual void SetBorderTopColor(FX_ARGB dwBorderColor) = 0;
+ virtual void SetBorderRightColor(FX_ARGB dwBorderColor) = 0;
+ virtual void SetBorderBottomColor(FX_ARGB dwBorderColor) = 0;
+
+ virtual void SetBorderLeftStyle(FDE_CSSBORDERSTYLE eBorderStyle) = 0;
+ virtual void SetBorderTopStyle(FDE_CSSBORDERSTYLE eBorderStyle) = 0;
+ virtual void SetBorderRightStyle(FDE_CSSBORDERSTYLE eBorderStyle) = 0;
+ virtual void SetBorderBottomStyle(FDE_CSSBORDERSTYLE eBorderStyle) = 0;
+
+ virtual void SetBorderWidth(const FDE_CSSRECT &rect) = 0;
+ virtual void SetMarginWidth(const FDE_CSSRECT &rect) = 0;
+ virtual void SetPaddingWidth(const FDE_CSSRECT &rect) = 0;
+};
+class IFDE_CSSPositionStyle
+{
+public:
+ virtual FDE_CSSDISPLAY GetDisplay() const = 0;
+ virtual const FDE_CSSSIZE& GetBoxSize() const = 0;
+ virtual const FDE_CSSSIZE& GetMinBoxSize() const = 0;
+ virtual const FDE_CSSSIZE& GetMaxBoxSize() const = 0;
+ virtual FDE_CSSFLOAT GetFloat() const = 0;
+ virtual FDE_CSSCLEAR GetClear() const = 0;
+ virtual FDE_CSSPOSITION GetPosition() const = 0;
+ virtual FDE_CSSLENGTH GetTop() const = 0;
+ virtual FDE_CSSLENGTH GetBottom() const = 0;
+ virtual FDE_CSSLENGTH GetLeft() const = 0;
+ virtual FDE_CSSLENGTH GetRight() const = 0;
+ virtual void SetDisplay(FDE_CSSDISPLAY eDisplay) = 0;
+ virtual void SetBoxSize(const FDE_CSSSIZE &boxSize) = 0;
+ virtual void SetMinBoxSize(const FDE_CSSSIZE &minBoxSize) = 0;
+ virtual void SetMaxBoxSize(const FDE_CSSSIZE &maxBoxSize) = 0;
+ virtual void SetFloat(FDE_CSSFLOAT eFloat) = 0;
+ virtual void SetClear(FDE_CSSCLEAR eClear) = 0;
+};
+class IFDE_CSSParagraphStyle
+{
+public:
+ virtual FX_FLOAT GetLineHeight() const = 0;
+ virtual FDE_CSSWHITESPACE GetWhiteSpace() const = 0;
+ virtual const FDE_CSSLENGTH& GetTextIndent() const = 0;
+ virtual FDE_CSSTEXTALIGN GetTextAlign() const = 0;
+ virtual FDE_CSSVERTICALALIGN GetVerticalAlign() const = 0;
+ virtual FX_FLOAT GetNumberVerticalAlign() const = 0;
+ virtual FDE_CSSTEXTTRANSFORM GetTextTransform() const = 0;
+ virtual FX_DWORD GetTextDecoration() const = 0;
+ virtual const FDE_CSSLENGTH& GetLetterSpacing() const = 0;
+ virtual const FDE_CSSLENGTH& GetWordSpacing() const = 0;
+ virtual FDE_CSSWRITINGMODE GetWritingMode() const = 0;
+ virtual FDE_CSSWORDBREAK GetWordBreak() const = 0;
+ virtual FX_INT32 GetWidows() const = 0;
+ virtual FX_ARGB GetTextEmphasisColor() const = 0;
+ virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const = 0;
+ virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const = 0;
+ virtual FDE_CSSPAGEBREAK GetPageBreakInside() const = 0;
+ virtual FX_INT32 GetOrphans() const = 0;
+ virtual FDE_CSSLINEBREAK GetLineBreak() const = 0;
+ virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const = 0;
+ virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const = 0;
+ virtual FX_LPCWSTR GetTextEmphasisCustom() const = 0;
+ virtual FDE_CSSTEXTCOMBINE GetTextCombineType() const = 0;
+ virtual FX_BOOL HasTextCombineNumber() const = 0;
+ virtual FX_FLOAT GetTextCombineNumber() const = 0;
+ virtual void SetLineHeight(FX_FLOAT fLineHeight) = 0;
+ virtual void SetWhiteSpace(FDE_CSSWHITESPACE eWhiteSpace) = 0;
+ virtual void SetTextIndent(const FDE_CSSLENGTH &textIndent) = 0;
+ virtual void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) = 0;
+ virtual void SetVerticalAlign(FDE_CSSVERTICALALIGN eVerticalAlign) = 0;
+ virtual void SetNumberVerticalAlign(FX_FLOAT fAlign) = 0;
+ virtual void SetTextTransform(FDE_CSSTEXTTRANSFORM eTextTransform) = 0;
+ virtual void SetTextDecoration(FX_DWORD dwTextDecoration) = 0;
+ virtual void SetLetterSpacing(const FDE_CSSLENGTH &letterSpacing) = 0;
+ virtual void SetWordSpacing(const FDE_CSSLENGTH &wordSpacing) = 0;
+ virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) = 0;
+ virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) = 0;
+ virtual void SetWidows(FX_INT32 iWidows) = 0;
+ virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) = 0;
+ virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) = 0;
+ virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) = 0;
+ virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) = 0;
+ virtual void SetOrphans(FX_INT32 iOrphans) = 0;
+ virtual void SetLineBreak(FDE_CSSLINEBREAK eLineBreak) = 0;
+};
+class IFDE_CSSBackgroundStyle
+{
+public:
+ virtual FX_ARGB GetBKGColor() const = 0;
+ virtual FX_LPCWSTR GetBKGImage() const = 0;
+ virtual FDE_CSSBKGREPEAT GetBKGRepeat() const = 0;
+ virtual FDE_CSSBKGATTACHMENT GetBKGAttachment() const = 0;
+ virtual const FDE_CSSPOINT& GetBKGPosition() const = 0;
+ virtual void SetBKGColor(FX_ARGB dwBKGColor) = 0;
+ virtual void SetBKGPosition(const FDE_CSSPOINT &bkgPosition) = 0;
+};
+class IFDE_CSSListStyle
+{
+public:
+ virtual FDE_CSSLISTSTYLETYPE GetListStyleType() const = 0;
+ virtual FDE_CSSLISTSTYLEPOSITION GetListStylePosition() const = 0;
+ virtual FX_LPCWSTR GetListStyleImage() const = 0;
+ virtual void SetListStyleType(FDE_CSSLISTSTYLETYPE eListStyleType) = 0;
+ virtual void SetListStylePosition(FDE_CSSLISTSTYLEPOSITION eListStylePosition) = 0;
+};
+class IFDE_CSSTableStyle
+{
+public:
+ virtual FDE_CSSCAPTIONSIDE GetCaptionSide() const = 0;
+};
+class IFDE_CSSVisualStyle
+{
+public:
+ virtual FDE_CSSVISIBILITY GetVisibility() const = 0;
+ virtual FDE_CSSOVERFLOW GetOverflowX() const = 0;
+ virtual FDE_CSSOVERFLOW GetOverflowY() const = 0;
+ virtual void SetVisibility(FDE_CSSVISIBILITY eVisibility) = 0;
+};
+class IFDE_CSSComputedStyle : public IFX_Unknown
+{
+public:
+ virtual void Reset() = 0;
+ virtual IFDE_CSSFontStyle* GetFontStyles() const = 0;
+ virtual IFDE_CSSBoundaryStyle* GetBoundaryStyles() const = 0;
+ virtual IFDE_CSSPositionStyle* GetPositionStyles() const = 0;
+ virtual IFDE_CSSParagraphStyle* GetParagraphStyles() const = 0;
+ virtual IFDE_CSSBackgroundStyle* GetBackgroundStyles() const = 0;
+ virtual IFDE_CSSVisualStyle* GetVisualStyles() const = 0;
+ virtual IFDE_CSSListStyle* GetListStyles() const = 0;
+ virtual IFDE_CSSMultiColumnStyle* GetMultiColumnStyle() const = 0;
+ virtual IFDE_CSSTableStyle* GetTableStyle() const = 0;
+ virtual IFDE_CSSGeneratedContentStyle* GetGeneratedContentStyle() const = 0;
+ virtual IFDE_CSSRubyStyle* GetRubyStyle() const = 0;
+ virtual FX_BOOL GetCustomStyle(FX_WSTR wsName, CFX_WideString &wsValue) const = 0;
+};
+enum FDE_CSSSTYLESHEETGROUP {
+ FDE_CSSSTYLESHEETGROUP_UserAgent,
+ FDE_CSSSTYLESHEETGROUP_User,
+ FDE_CSSSTYLESHEETGROUP_Author,
+ FDE_CSSSTYLESHEETGROUP_MAX,
+};
+enum FDE_CSSSTYLESHEETPRIORITY {
+ FDE_CSSSTYLESHEETPRIORITY_High,
+ FDE_CSSSTYLESHEETPRIORITY_Mid,
+ FDE_CSSSTYLESHEETPRIORITY_Low,
+ FDE_CSSSTYLESHEETPRIORITY_MAX,
+};
+class IFDE_CSSTagProvider
+{
+public:
+ virtual CFX_WideStringC GetTagName() = 0;
+ virtual FX_POSITION GetFirstAttribute() = 0;
+ virtual void GetNextAttribute(FX_POSITION &pos, CFX_WideStringC &wsAttr, CFX_WideStringC &wsValue) = 0;
+};
+class IFDE_CSSAccelerator
+{
+public:
+ virtual void OnEnterTag(IFDE_CSSTagProvider *pTag) = 0;
+ virtual void OnLeaveTag(IFDE_CSSTagProvider *pTag) = 0;
+};
+class IFDE_CSSStyleSelector
+{
+public:
+ static IFDE_CSSStyleSelector* Create();
+ virtual void Release() = 0;
+ virtual void SetFontMgr(IFX_FontMgr *pFontMgr) = 0;
+ virtual void SetDefFontSize(FX_FLOAT fFontSize) = 0;
+ virtual FX_BOOL SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType, IFDE_CSSStyleSheet *pSheet) = 0;
+ virtual FX_BOOL SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType, const CFDE_CSSStyleSheetArray *pArray) = 0;
+ virtual void SetStylePriority(FDE_CSSSTYLESHEETGROUP eType, FDE_CSSSTYLESHEETPRIORITY ePriority) = 0;
+ virtual void UpdateStyleIndex(FX_DWORD dwMediaList) = 0;
+ virtual IFDE_CSSAccelerator* InitAccelerator() = 0;
+ virtual IFDE_CSSComputedStyle* CreateComputedStyle(IFDE_CSSComputedStyle *pParentStyle) = 0;
+ virtual FX_INT32 MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE) = 0;
+ virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle) = 0;
+};
+#endif
diff --git a/xfa/src/fdp/include/fde_img.h b/xfa/src/fdp/include/fde_img.h new file mode 100644 index 0000000000..808bc4c304 --- /dev/null +++ b/xfa/src/fdp/include/fde_img.h @@ -0,0 +1,76 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_IMAGE
+#define _FDE_IMAGE
+class IFDE_Image;
+#define FDE_IMAGEFORMAT_Unknown -1
+#define FDE_IMAGEFORMAT_BMP 0
+#define FDE_IMAGEFORMAT_GIF 1
+#define FDE_IMAGEFORMAT_JPEG 2
+#define FDE_IMAGEFORMAT_PNG 3
+#define FDE_IMAGEFORMAT_TIFF 4
+#define FDE_IMAGEFORMAT_JPEG2000 5
+#define FDE_IMAGEFORMAT_JBig2 6
+class IFDE_Image
+{
+public:
+ static IFDE_Image* Create(IFX_Stream *pStream, FX_INT32 iFormat = FDE_IMAGEFORMAT_Unknown);
+ virtual void Release() = 0;
+ virtual FX_BOOL LoadImage() = 0;
+ virtual void FreeImage() = 0;
+ virtual FX_INT32 CountFrames() const = 0;
+ virtual FX_BOOL LoadFrame(FX_INT32 index) = 0;
+ virtual CFX_DIBitmap* GetFrameImage() = 0;
+ virtual FX_INT32 GetImageFormat() const = 0;
+ virtual FX_INT32 GetImageWidth() const = 0;
+ virtual FX_INT32 GetImageHeight() const = 0;
+ virtual FX_INT32 GetDelayTime(FX_INT32 iFrameIndex) const = 0;
+ virtual FX_INT32 GetLoopCount() const = 0;
+ virtual FX_BOOL StartLoadImage(CFX_DIBitmap *pDIBitmap, FX_INT32 dibX, FX_INT32 dibY, FX_INT32 dibCX, FX_INT32 dibCY,
+ FX_INT32 imgX, FX_INT32 imgY, FX_INT32 imgCX, FX_INT32 imgCY, FX_INT32 iFrameIndex = 0) = 0;
+ virtual FX_INT32 DoLoadImage(IFX_Pause *pPause = NULL) = 0;
+ virtual void StopLoadImage() = 0;
+};
+#define FDE_IMAGEFILTER_Unknown -1
+#define FDE_IMAGEFILTER_Opacity 0
+#define FDE_IMAGEFILTER_GrayScale 1
+#define FDE_IMAGEFILTER_BlackWhite 2
+#define FDE_IMAGEFILTER_InvertColor 3
+#define FDE_IMAGEFILTER_TransparentColor 4
+#define FDE_IMAGEFILTER_MaskColor 5
+#define FDE_IMAGEFILTER_Brightness 6
+#define FDE_IMAGEFILTER_Contrast 7
+typedef struct _FDE_IMAGEFILTERPARAMS : public CFX_Target {
+ FX_INT32 iFilterType;
+} FDE_IMAGEFILTERPARAMS, * FDE_LPIMAGEFILTERPARAMS;
+typedef FDE_IMAGEFILTERPARAMS const * FDE_LPCIMAGEFILTERPARAMS;
+typedef struct _FDE_OPACITYPARAMS : public FDE_IMAGEFILTERPARAMS {
+ FX_INT32 iOpacity;
+} FDE_OPACITYPARAMS, * FDE_LPOPACITYPARAMS;
+typedef FDE_OPACITYPARAMS const * FDE_LPCOPACITYPARAMS;
+typedef struct _FDE_BLACKWHITEPARAMS : public FDE_IMAGEFILTERPARAMS {
+ FX_ARGB dwBlackColor;
+ FX_ARGB dwWhiteColor;
+} FDE_BLACKWHITEPARAMS, * FDE_LPBLACKWHITEPARAMS;
+typedef FDE_BLACKWHITEPARAMS const * FDE_LPCBLACKWHITEPARAMS;
+typedef struct _FDE_TRANSPARENTPARAMS : public FDE_IMAGEFILTERPARAMS {
+ FX_ARGB color;
+} FDE_TRANSPARENTPARAMS, * FDE_LPTRANSPARENTPARAMS;
+typedef FDE_TRANSPARENTPARAMS const * FDE_LPCTRANSPARENTPARAMS;
+typedef struct _FDE_MASKCOLORPARAMS : public FDE_IMAGEFILTERPARAMS {
+ FX_ARGB color;
+} FDE_MASKCOLORPARAMS, * FDE_LPMASKCOLORPARAMS;
+typedef FDE_MASKCOLORPARAMS const * FDE_LPCMASKCOLORPARAMS;
+typedef struct _FDE_BRIGHTNESSPARAMS : public FDE_IMAGEFILTERPARAMS {
+ FX_INT32 iBrightness;
+} FDE_BRIGHTNESSPARAMS, * FDE_LPBRIGHTNESSPARAMS;
+typedef FDE_BRIGHTNESSPARAMS const * FDE_LPCBRIGHTNESSPARAMS;
+typedef struct _FDE_CONTRASTPARAMS : public FDE_IMAGEFILTERPARAMS {
+ FX_INT32 iContrast;
+} FDE_CONTRASTPARAMS, * FDE_LPCONTRASTPARAMS;
+typedef FDE_CONTRASTPARAMS const * FDE_LPCCONTRASTPARAMS;
+#endif
diff --git a/xfa/src/fdp/include/fde_mem.h b/xfa/src/fdp/include/fde_mem.h new file mode 100644 index 0000000000..516e67c945 --- /dev/null +++ b/xfa/src/fdp/include/fde_mem.h @@ -0,0 +1,23 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_MEM
+#define _FDE_MEM
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define FDE_Alloc(size) FX_Alloc(FX_BYTE, size)
+#define FDE_Realloc(ptr, newSize) FX_Realloc(FX_BYTE, ptr, newSize)
+#define FDE_Free(ptr) FX_Free(ptr)
+#define FDE_New FXTARGET_New
+#define FDE_Delete FXTARGET_Delete
+#define FDE_NewWith FXTARGET_NewWith
+#define FDE_DeleteWith FXTARGET_DeleteWith
+
+#ifdef __cplusplus
+};
+#endif
+#endif
diff --git a/xfa/src/fdp/include/fde_pen.h b/xfa/src/fdp/include/fde_pen.h new file mode 100644 index 0000000000..7730b6a964 --- /dev/null +++ b/xfa/src/fdp/include/fde_pen.h @@ -0,0 +1,61 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_PEN
+#define _FDE_PEN
+class IFDE_Pen;
+#define FDE_PENTYPE_Unknown FDE_BRUSHTYPE_Unknown
+#define FDE_PENTYPE_SolidColor FDE_BRUSHTYPE_Solid
+#define FDE_PENTYPE_HatchBrush FDE_BRUSHTYPE_Hatch
+#define FDE_PENTYPE_TextureBrush FDE_BRUSHTYPE_Texture
+#define FDE_PENTYPE_LinearGradient FDE_BRUSHTYPE_LinearGradient
+#define FDE_PENTYPE_MAX FDE_BRUSHTYPE_MAX
+#define FDE_DASHSTYLE_Solid 0
+#define FDE_DASHSTYLE_Dash 1
+#define FDE_DASHSTYLE_Dot 2
+#define FDE_DASHSTYLE_DashDot 3
+#define FDE_DASHSTYLE_DashDotDot 4
+#define FDE_DASHSTYLE_Customized 5
+#define FDE_LINEJOIN_Miter 0
+#define FDE_LINEJOIN_Round 1
+#define FDE_LINEJOIN_Bevel 2
+#define FDE_LINECAP_Flat 0
+#define FDE_LINECAP_Round 1
+#define FDE_LINECAP_Square 2
+typedef struct _FDE_COMPOUNDPATTERN {
+ FX_FLOAT pos;
+ FX_FLOAT width;
+} FDE_COMPOUNDPATTERN, * FDE_LPCOMPOUNDPATTERN;
+typedef FDE_COMPOUNDPATTERN const * FDE_LPCCOMPOUNDPATTERN;
+typedef CFX_ArrayTemplate<FDE_COMPOUNDPATTERN> CFDE_CompoundPatterns;
+class IFDE_Pen
+{
+public:
+ static IFDE_Pen* Create();
+ virtual void Release() = 0;
+ virtual FX_INT32 GetType() const = 0;
+ virtual FX_ARGB GetColor() const = 0;
+ virtual void SetColor(FX_ARGB color) = 0;
+ virtual IFDE_Brush* GetBrush() const = 0;
+ virtual void SetBrush(IFDE_Brush *pBrush, FX_BOOL bAutoRelease) = 0;
+ virtual FX_INT32 GetLineCap() const = 0;
+ virtual void SetLineCap(FX_INT32 iLineCap) = 0;
+ virtual FX_INT32 GetDashStyle() const = 0;
+ virtual void SetDashStyle(FX_INT32 iDashStyle) = 0;
+ virtual FX_FLOAT GetDashPhase() const = 0;
+ virtual void SetDashPhase(FX_FLOAT fPhase) = 0;
+ virtual FX_INT32 CountDashArray() const = 0;
+ virtual FX_INT32 GetDashArray(CFX_FloatArray &dashArray) const = 0;
+ virtual void SetDashArray(const CFX_FloatArray &dashArray) = 0;
+ virtual FX_INT32 GetLineJoin() const = 0;
+ virtual void SetLineJoin(FX_INT32 iLineJoin) = 0;
+ virtual FX_FLOAT GetMiterLimit() const = 0;
+ virtual void SetMiterLimit(FX_FLOAT fMiterLimit) = 0;
+ virtual FX_INT32 CountCompoundPatterns() const = 0;
+ virtual FX_BOOL GetCompoundPatterns(CFDE_CompoundPatterns &compoundPatterns) const = 0;
+ virtual FX_BOOL SetCompoundPatterns(const CFDE_CompoundPatterns &compoundPatterns) = 0;
+};
+#endif
diff --git a/xfa/src/fdp/include/fde_psr.h b/xfa/src/fdp/include/fde_psr.h new file mode 100644 index 0000000000..64070e6648 --- /dev/null +++ b/xfa/src/fdp/include/fde_psr.h @@ -0,0 +1,94 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_PARSER
+#define _FDE_PARSER
+enum FDE_VISUALOBJTYPE {
+ FDE_VISUALOBJ_Canvas = 0x00,
+ FDE_VISUALOBJ_Text = 0x01 ,
+ FDE_VISUALOBJ_Image = 0x02 ,
+ FDE_VISUALOBJ_Path = 0x04 ,
+ FDE_VISUALOBJ_Widget = 0x08 ,
+};
+typedef struct _FDE_HVISUALOBJ {
+ FX_LPVOID pData;
+} const * FDE_HVISUALOBJ;
+class IFDE_VisualSet
+{
+public:
+ virtual FDE_VISUALOBJTYPE GetType() = 0;
+ virtual FX_BOOL GetBBox(FDE_HVISUALOBJ hVisualObj, CFX_RectF &bbox) = 0;
+ virtual FX_BOOL GetMatrix(FDE_HVISUALOBJ hVisualObj, CFX_Matrix &matrix) = 0;
+ virtual FX_BOOL GetRect(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt) = 0;
+ virtual FX_BOOL GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt) = 0;
+};
+class IFDE_CanvasSet : public IFDE_VisualSet
+{
+public:
+ virtual FX_POSITION GetFirstPosition(FDE_HVISUALOBJ hCanvas) = 0;
+ virtual FDE_HVISUALOBJ GetNext(FDE_HVISUALOBJ hCanvas, FX_POSITION &pos, IFDE_VisualSet *&pVisualSet) = 0;
+ virtual FDE_HVISUALOBJ GetParentCanvas(FDE_HVISUALOBJ hCanvas, IFDE_VisualSet *&pVisualSet) = 0;
+};
+class IFDE_TextSet : public IFDE_VisualSet
+{
+public:
+ virtual FX_INT32 GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText) = 0;
+ virtual IFX_Font* GetFont(FDE_HVISUALOBJ hText) = 0;
+ virtual FX_FLOAT GetFontSize(FDE_HVISUALOBJ hText) = 0;
+ virtual FX_ARGB GetFontColor(FDE_HVISUALOBJ hText) = 0;
+ virtual FX_INT32 GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL) = 0;
+ virtual FX_INT32 GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray) = 0;
+};
+class IFDE_ImageSet : public IFDE_VisualSet
+{
+public:
+ virtual IFDE_Image* GetImage(FDE_HVISUALOBJ hImage) = 0;
+ virtual FX_POSITION GetFirstFilterPosition(FDE_HVISUALOBJ hImage) = 0;
+ virtual FDE_LPCIMAGEFILTERPARAMS GetNextFilter(FDE_HVISUALOBJ hImage, FX_POSITION &pos) = 0;
+};
+#define FDE_FILLMODE_Alternate 1
+#define FDE_FILLMODE_Winding 2
+#define FDE_PATHRENDER_Stroke 1
+#define FDE_PATHRENDER_Fill 2
+#define FDE_PATHRENDER_FillStroke 3
+class IFDE_PathSet : public IFDE_VisualSet
+{
+public:
+ virtual IFDE_Path* GetPath(FDE_HVISUALOBJ hPath) = 0;
+ virtual FX_INT32 GetFillMode(FDE_HVISUALOBJ hPath) = 0;
+ virtual FX_INT32 GetRenderMode(FDE_HVISUALOBJ hPath) = 0;
+ virtual IFDE_Pen* GetPen(FDE_HVISUALOBJ hPath) = 0;
+ virtual FX_FLOAT GetPenWidth(FDE_HVISUALOBJ hPath) = 0;
+ virtual IFDE_Brush* GetBrush(FDE_HVISUALOBJ hPath) = 0;
+};
+enum FDE_WIDGETOBJ {
+ FDE_WIDGETOBJ_Unknown = 0x0000,
+ FDE_WIDGETOBJ_Anchor = 0x0100,
+ FDE_WIDGETOBJ_NamedDest = 0x0200,
+ FDE_WIDGETOBJ_HyperLink = 0x0400,
+};
+#define FDE_WIDGETPARAM_Uri 1
+#define FDE_WIDGETPARAM_Rects 2
+class IFDE_WidgetSet : public IFDE_VisualSet
+{
+public:
+ virtual FDE_WIDGETOBJ GetWidgetType(FDE_HVISUALOBJ hWidget) = 0;
+ virtual FX_FLOAT GetFloat(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, FX_FLOAT fDefVal = 0.0f) = 0;
+ virtual FX_INT32 GetInteger(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, FX_INT32 iDefVal = 0) = 0;
+ virtual FX_BOOL GetString(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, CFX_WideString &wsValue) = 0;
+ virtual FX_BOOL GetRects(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, CFX_RectFArray &rects) = 0;
+};
+class IFDE_VisualSetIterator
+{
+public:
+ static IFDE_VisualSetIterator* Create();
+ virtual void Release() = 0;
+ virtual FX_BOOL AttachCanvas(IFDE_CanvasSet *pCanvas) = 0;
+ virtual FX_BOOL FilterObjects(FX_DWORD dwObjects = 0xFFFFFFFF) = 0;
+ virtual void Reset() = 0;
+ virtual FDE_HVISUALOBJ GetNext(IFDE_VisualSet *&pVisualSet, FDE_HVISUALOBJ *phCanvasObj = NULL, IFDE_CanvasSet **ppCanvasSet = NULL) = 0;
+};
+#endif
diff --git a/xfa/src/fdp/include/fde_pth.h b/xfa/src/fdp/include/fde_pth.h new file mode 100644 index 0000000000..be3cc8d50e --- /dev/null +++ b/xfa/src/fdp/include/fde_pth.h @@ -0,0 +1,29 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_PATH
+#define _FDE_PATH
+class IFDE_Path;
+class IFDE_Path
+{
+public:
+ static IFDE_Path* Create();
+ virtual void Release() = 0;
+ virtual FX_BOOL StartFigure() = 0;
+ virtual FX_BOOL CloseFigure() = 0;
+ virtual void AddBezier(const CFX_PointsF &points) = 0;
+ virtual void AddBeziers(const CFX_PointsF &points) = 0;
+ virtual void AddCurve(const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f) = 0;
+ virtual void AddEllipse(const CFX_RectF &rect) = 0;
+ virtual void AddLines(const CFX_PointsF &points) = 0;
+ virtual void AddLine(const CFX_PointF &pt1, const CFX_PointF &pt2) = 0;
+ virtual void AddPath(const IFDE_Path *pSrc, FX_BOOL bConnect) = 0;
+ virtual void AddPolygon(const CFX_PointsF &points) = 0;
+ virtual void AddRectangle(const CFX_RectF &rect) = 0;
+ virtual void GetBBox(CFX_RectF &bbox) const = 0;
+ virtual void GetBBox(CFX_RectF &bbox, FX_FLOAT fLineWidth, FX_FLOAT fMiterLimit) const = 0;
+};
+#endif
diff --git a/xfa/src/fdp/include/fde_rdr.h b/xfa/src/fdp/include/fde_rdr.h new file mode 100644 index 0000000000..74c5d24516 --- /dev/null +++ b/xfa/src/fdp/include/fde_rdr.h @@ -0,0 +1,32 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_RENDERCONTEXT
+#define _FDE_RENDERCONTEXT
+class IFDE_Page;
+class IFDE_RenderDevice;
+class IFDE_RenderContext;
+void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, FX_INT32 iRotate, FX_DWORD dwCoordinatesType = 0);
+enum FDE_RENDERSTATUS {
+ FDE_RENDERSTATUS_Reset = 0,
+ FDE_RENDERSTATUS_Paused ,
+ FDE_RENDERSTATUS_Done ,
+ FDE_RENDERSTATUS_Failed ,
+};
+class IFDE_RenderContext
+{
+public:
+ static IFDE_RenderContext* Create();
+ virtual void Release() = 0;
+ virtual FX_BOOL StartRender(IFDE_RenderDevice *pRenderDevice,
+ IFDE_CanvasSet *pCanvasSet,
+ const CFX_Matrix &tmDoc2Device
+ ) = 0;
+ virtual FDE_RENDERSTATUS GetStatus() const = 0;
+ virtual FDE_RENDERSTATUS DoRender(IFX_Pause *pPause = NULL) = 0;
+ virtual void StopRender() = 0;
+};
+#endif
diff --git a/xfa/src/fdp/include/fde_rdv.h b/xfa/src/fdp/include/fde_rdv.h new file mode 100644 index 0000000000..ee1e922c48 --- /dev/null +++ b/xfa/src/fdp/include/fde_rdv.h @@ -0,0 +1,53 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_RENDERDEVICE
+#define _FDE_RENDERDEVICE
+class IFDE_Pen;
+class IFDE_Brush;
+class IFDE_Image;
+class CFX_DIBitmap;
+class CFX_DIBSource;
+class IFDE_RenderDevice;
+typedef struct _FDE_HDEVICESTATE {
+ FX_LPVOID pData;
+} * FDE_HDEVICESTATE;
+class IFDE_RenderDevice
+{
+public:
+ static IFDE_RenderDevice* Create(CFX_DIBitmap *pBitmap, FX_BOOL bRgbByteOrder = FALSE);
+ static IFDE_RenderDevice* Create(CFX_RenderDevice *pDevice);
+ virtual void Release() = 0;
+
+ virtual FX_INT32 GetWidth() const = 0;
+ virtual FX_INT32 GetHeight() const = 0;
+ virtual FDE_HDEVICESTATE SaveState() = 0;
+ virtual void RestoreState(FDE_HDEVICESTATE hState) = 0;
+ virtual FX_BOOL SetClipPath(const IFDE_Path *pClip) = 0;
+ virtual IFDE_Path* GetClipPath() const = 0;
+ virtual FX_BOOL SetClipRect(const CFX_RectF &rtClip) = 0;
+ virtual const CFX_RectF& GetClipRect() = 0;
+
+ virtual FX_FLOAT GetDpiX() const = 0;
+ virtual FX_FLOAT GetDpiY() const = 0;
+
+ virtual FX_BOOL DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL) = 0;
+ virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawBezier(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointF &pt1, const CFX_PointF &pt2, const CFX_PointF &pt3, const CFX_PointF &pt4, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawCurve(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawEllipse(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawLines(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawLine(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointF &pt1, const CFX_PointF &pt2, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawPath(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const IFDE_Path *pPath, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawPolygon(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL DrawRectangle(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL FillClosedCurve(IFDE_Brush *pBrush, const CFX_PointsF &points, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL FillEllipse(IFDE_Brush* pBrush, const CFX_RectF& rect, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL FillPath(IFDE_Brush *pBrush, const IFDE_Path *pPath, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL FillPolygon(IFDE_Brush *pBrush, const CFX_PointsF &points, const CFX_Matrix *pMatrix = NULL) = 0;
+ virtual FX_BOOL FillRectangle(IFDE_Brush *pBrush, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL) = 0;
+};
+#endif
diff --git a/xfa/src/fdp/include/fde_tto.h b/xfa/src/fdp/include/fde_tto.h new file mode 100644 index 0000000000..25dead13ca --- /dev/null +++ b/xfa/src/fdp/include/fde_tto.h @@ -0,0 +1,69 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_TEXTOUT
+#define _FDE_TEXTOUT
+class IFDE_TextOut;
+#define FDE_TTOSTYLE_Underline 0x0001
+#define FDE_TTOSTYLE_Strikeout 0x0002
+#define FDE_TTOSTYLE_VerticalLayout 0x0004
+#define FDE_TTOSTYLE_SingleLine 0x0010
+#define FDE_TTOSTYLE_ExpandTab 0x0020
+#define FDE_TTOSTYLE_HotKey 0x0040
+#define FDE_TTOSTYLE_Ellipsis 0x0080
+#define FDE_TTOSTYLE_LineWrap 0x0100
+#define FDE_TTOSTYLE_ArabicShapes 0x0200
+#define FDE_TTOSTYLE_RTL 0x0400
+#define FDE_TTOSTYLE_ArabicContext 0x0800
+#define FDE_TTOSTYLE_LastLineHeight 0x1000
+#define FDE_TTOALIGNMENT_TopLeft 0
+#define FDE_TTOALIGNMENT_TopCenter 1
+#define FDE_TTOALIGNMENT_TopRight 2
+#define FDE_TTOALIGNMENT_TopAuto 3
+#define FDE_TTOALIGNMENT_CenterLeft 4
+#define FDE_TTOALIGNMENT_Center 5
+#define FDE_TTOALIGNMENT_CenterRight 6
+#define FDE_TTOALIGNMENT_CenterAuto 7
+#define FDE_TTOALIGNMENT_BottomLeft 8
+#define FDE_TTOALIGNMENT_BottomCenter 9
+#define FDE_TTOALIGNMENT_BottomRight 10
+#define FDE_TTOALIGNMENT_BottomAuto 11
+class IFDE_TextOut
+{
+public:
+ static IFDE_TextOut* Create();
+ virtual void Release() = 0;
+ virtual void SetFont(IFX_Font *pFont) = 0;
+ virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
+ virtual void SetTextColor(FX_ARGB color) = 0;
+ virtual void SetStyles(FX_DWORD dwStyles) = 0;
+ virtual void SetTabWidth(FX_FLOAT fTabWidth) = 0;
+ virtual void SetEllipsisString(const CFX_WideString &wsEllipsis) = 0;
+ virtual void SetParagraphBreakChar(FX_WCHAR wch) = 0;
+ virtual void SetAlignment(FX_INT32 iAlignment) = 0;
+ virtual void SetLineSpace(FX_FLOAT fLineSpace) = 0;
+ virtual void SetDIBitmap(CFX_DIBitmap *pDIB) = 0;
+ virtual void SetRenderDevice(CFX_RenderDevice *pDevice) = 0;
+ virtual void SetClipRect(const CFX_Rect &rtClip) = 0;
+ virtual void SetClipRect(const CFX_RectF &rtClip) = 0;
+ virtual void SetMatrix(const CFX_Matrix &matrix) = 0;
+ virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0;
+ virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Size &size) = 0;
+ virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size) = 0;
+ virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Rect &rect) = 0;
+ virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) = 0;
+ virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 x, FX_INT32 y) = 0;
+ virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y) = 0;
+ virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_Rect &rect) = 0;
+ virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) = 0;
+ virtual void SetLogicClipRect(const CFX_RectF &rtClip) = 0;
+ virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size) = 0;
+ virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) = 0;
+ virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y) = 0;
+ virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) = 0;
+ virtual FX_INT32 GetTotalLines() = 0;
+};
+#endif
diff --git a/xfa/src/fdp/include/fde_xml.h b/xfa/src/fdp/include/fde_xml.h new file mode 100644 index 0000000000..b8b136b5aa --- /dev/null +++ b/xfa/src/fdp/include/fde_xml.h @@ -0,0 +1,188 @@ +// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FDE_XML
+#define _FDE_XML
+class IFDE_XMLNode;
+class IFDE_XMLInstruction;
+class IFDE_XMLDeclaration;
+class IFDE_XMLDeclComment;
+class IFDE_XMLDeclCharData;
+class IFDE_XMLDeclDocType;
+class IFDE_XMLDeclElement;
+class IFDE_XMLDeclAttriList;
+class IFDE_XMLDeclNotition;
+class IFDE_XMLDeclEntity;
+class IFDE_XMLElement;
+class IFDE_XMLText;
+class IFDE_XMLDoc;
+class IFDE_XMLParser;
+class IFDE_XMLSyntaxParser;
+#ifdef __cplusplus
+extern "C" {
+#endif
+enum FDE_XMLNODETYPE {
+ FDE_XMLNODE_Unknown = 0,
+ FDE_XMLNODE_Instruction ,
+ FDE_XMLNODE_Element ,
+ FDE_XMLNODE_Text ,
+ FDE_XMLNODE_CharData ,
+};
+typedef struct _FDE_XMLNODE {
+ FX_INT32 iNodeNum;
+ FDE_XMLNODETYPE eNodeType;
+} FDE_XMLNODE, * FDE_LPXMLNODE;
+typedef FDE_XMLNODE const * FDE_LPCXMLNODE;
+typedef CFX_StackTemplate<FDE_XMLNODE> CFDE_XMLNodeStack;
+FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch);
+FX_BOOL FDE_IsXMLWhiteSpace(FX_WCHAR ch);
+FX_BOOL FDE_IsXMLNameChar(FX_WCHAR ch, FX_BOOL bFirstChar);
+#ifdef __cplusplus
+}
+#endif
+class IFDE_XMLNode
+{
+public:
+ virtual void Release() = 0;
+ virtual FDE_XMLNODETYPE GetType() const = 0;
+ virtual FX_INT32 CountChildNodes() const = 0;
+ virtual IFDE_XMLNode* GetChildNode(FX_INT32 index) const = 0;
+ virtual FX_INT32 GetChildNodeIndex(IFDE_XMLNode *pNode) const = 0;
+ virtual IFDE_XMLNode* GetPath(FX_LPCWSTR pPath, FX_INT32 iLength = -1, FX_BOOL bQualifiedName = TRUE) const = 0;
+ virtual FX_INT32 InsertChildNode(IFDE_XMLNode *pNode, FX_INT32 index = -1) = 0;
+ virtual void RemoveChildNode(IFDE_XMLNode *pNode) = 0;
+ virtual void DeleteChildren() = 0;
+ enum NodeItem {Root = 0, Parent, FirstSibling, PriorSibling, NextSibling, LastSibling, FirstNeighbor, PriorNeighbor, NextNeighbor, LastNeighbor, FirstChild, LastChild};
+ virtual IFDE_XMLNode* GetNodeItem(NodeItem eItem) const = 0;
+ virtual FX_INT32 GetNodeLevel() const = 0;
+ virtual FX_BOOL InsertNodeItem(IFDE_XMLNode::NodeItem eItem, IFDE_XMLNode *pNode) = 0;
+ virtual IFDE_XMLNode* RemoveNodeItem(IFDE_XMLNode::NodeItem eItem) = 0;
+ virtual IFDE_XMLNode* Clone(FX_BOOL bRecursive) = 0;
+ virtual void SaveXMLNode(IFX_Stream *pXMLStream) = 0;
+};
+class IFDE_XMLInstruction : public IFDE_XMLNode
+{
+public:
+ static IFDE_XMLInstruction* Create(const CFX_WideString &wsTarget);
+ virtual void GetTargetName(CFX_WideString &wsTarget) const = 0;
+ virtual FX_INT32 CountAttributes() const = 0;
+ virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0;
+ virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const = 0;
+ virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const = 0;
+ virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue) = 0;
+ virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const = 0;
+ virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) = 0;
+ virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const = 0;
+ virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue) = 0;
+ virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName) = 0;
+ virtual FX_INT32 CountData() const = 0;
+ virtual FX_BOOL GetData(FX_INT32 index, CFX_WideString &wsData) const = 0;
+ virtual void AppendData(const CFX_WideString &wsData) = 0;
+ virtual void RemoveData(FX_INT32 index) = 0;
+};
+class IFDE_XMLElement : public IFDE_XMLNode
+{
+public:
+ static IFDE_XMLElement* Create(const CFX_WideString &wsTag);
+ virtual void GetTagName(CFX_WideString &wsTag) const = 0;
+ virtual void GetLocalTagName(CFX_WideString &wsTag) const = 0;
+ virtual void GetNamespacePrefix(CFX_WideString &wsPrefix) const = 0;
+ virtual void GetNamespaceURI(CFX_WideString &wsNamespace) const = 0;
+ virtual FX_INT32 CountAttributes() const = 0;
+ virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0;
+ virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const = 0;
+ virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const = 0;
+ virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue) = 0;
+ virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const = 0;
+ virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) = 0;
+ virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const = 0;
+ virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue) = 0;
+ virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName) = 0;
+ virtual void GetTextData(CFX_WideString &wsText) const = 0;
+ virtual void SetTextData(const CFX_WideString &wsText) = 0;
+};
+class IFDE_XMLText : public IFDE_XMLNode
+{
+public:
+ static IFDE_XMLText* Create(const CFX_WideString &wsText);
+ virtual void GetText(CFX_WideString &wsText) const = 0;
+ virtual void SetText(const CFX_WideString &wsText) = 0;
+};
+class IFDE_XMLDeclaration : public IFDE_XMLNode
+{
+public:
+};
+class IFDE_XMLCharData : public IFDE_XMLDeclaration
+{
+public:
+ static IFDE_XMLCharData* Create(const CFX_WideString &wsCData);
+
+ virtual void GetCharData(CFX_WideString &wsCData) const = 0;
+ virtual void SetCharData(const CFX_WideString &wsCData) = 0;
+};
+typedef struct _FDE_XMLREADERHANDLER {
+ FX_LPVOID pData;
+
+ void (*OnTagEnter)(_FDE_XMLREADERHANDLER *pThis, FDE_XMLNODETYPE eType, const CFX_WideString &wsTagName);
+ void (*OnTagBreak)(_FDE_XMLREADERHANDLER *pThis, const CFX_WideString &wsTagName);
+ void (*OnTagClose)(_FDE_XMLREADERHANDLER *pThis, const CFX_WideString &wsTagName);
+ void (*OnAttribute)(_FDE_XMLREADERHANDLER *pThis, const CFX_WideString &wsName, const CFX_WideString &wsValue);
+ void (*OnData)(_FDE_XMLREADERHANDLER *pThis, FDE_XMLNODETYPE eType, const CFX_WideString &wsValue);
+} FDE_XMLREADERHANDLER, * FDE_LPXMLREADERHANDLER;
+class IFDE_XMLDoc
+{
+public:
+ static IFDE_XMLDoc* Create();
+ virtual void Release() = 0;
+ virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, FX_INT32 iXMLPlaneSize = 8192, FX_INT32 iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL) = 0;
+ virtual FX_BOOL LoadXML(IFDE_XMLParser *pXMLParser) = 0;
+ virtual FX_INT32 DoLoad(IFX_Pause *pPause = NULL) = 0;
+ virtual void CloseXML() = 0;
+ virtual IFDE_XMLNode* GetRoot() const = 0;
+ virtual void SaveXML(IFX_Stream *pXMLStream = NULL, FX_BOOL bSaveBOM = TRUE) = 0;
+ virtual void SaveXMLNode(IFX_Stream *pXMLStream, IFDE_XMLNode *pNode) = 0;
+};
+class IFDE_XMLParser
+{
+public:
+ virtual void Release() = 0;
+ virtual FX_INT32 DoParser(IFX_Pause *pPause) = 0;
+};
+#define FDE_XMLSYNTAXSTATUS_None 0x00
+#define FDE_XMLSYNTAXSTATUS_InstructionOpen 0x01
+#define FDE_XMLSYNTAXSTATUS_InstructionClose 0x02
+#define FDE_XMLSYNTAXSTATUS_ElementOpen 0x03
+#define FDE_XMLSYNTAXSTATUS_ElementBreak 0x04
+#define FDE_XMLSYNTAXSTATUS_ElementClose 0x05
+#define FDE_XMLSYNTAXSTATUS_TargetName 0x06
+#define FDE_XMLSYNTAXSTATUS_TagName 0x07
+#define FDE_XMLSYNTAXSTATUS_AttriName 0x08
+#define FDE_XMLSYNTAXSTATUS_AttriValue 0x09
+#define FDE_XMLSYNTAXSTATUS_Text 0x0A
+#define FDE_XMLSYNTAXSTATUS_CData 0x0B
+#define FDE_XMLSYNTAXSTATUS_TargetData 0x0C
+#define FDE_XMLSYNTAXSTATUS_Error 0xFE
+#define FDE_XMLSYNTAXSTATUS_EOS 0xFF
+class IFDE_XMLSyntaxParser
+{
+public:
+ static IFDE_XMLSyntaxParser* Create();
+ virtual void Release() = 0;
+ virtual void Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize = 256) = 0;
+ virtual FX_DWORD DoSyntaxParse() = 0;
+ virtual FX_INT32 GetStatus() const = 0;
+ virtual FX_INT32 GetCurrentPos() const = 0;
+ virtual FX_FILESIZE GetCurrentBinaryPos() const = 0;
+ virtual FX_INT32 GetCurrentNodeNumber() const = 0;
+ virtual FX_INT32 GetLastNodeNumber() const = 0;
+ virtual void GetTargetName(CFX_WideString &wsTarget) const = 0;
+ virtual void GetTagName(CFX_WideString &wsTag) const = 0;
+ virtual void GetAttributeName(CFX_WideString &wsAttriName) const = 0;
+ virtual void GetAttributeValue(CFX_WideString &wsAttriValue) const = 0;
+ virtual void GetTextData(CFX_WideString &wsText) const = 0;
+ virtual void GetTargetData(CFX_WideString &wsData) const = 0;
+};
+#endif
|