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_FDE_VISUALSET_H_ | 7 #ifndef XFA_FDE_FDE_VISUALSET_H_ |
8 #define XFA_FDE_FDE_VISUALSET_H_ | 8 #define XFA_FDE_FDE_VISUALSET_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_coordinates.h" | 10 #include "core/fxcrt/include/fx_coordinates.h" |
11 #include "core/fxcrt/include/fx_system.h" | 11 #include "core/fxcrt/include/fx_system.h" |
12 #include "core/fxge/include/fx_dib.h" | 12 #include "core/fxge/include/fx_dib.h" |
13 #include "core/fxge/include/fx_ge.h" | 13 #include "core/fxge/include/fx_ge.h" |
14 #include "xfa/fde/fde_brush.h" | 14 #include "xfa/fde/fde_brush.h" |
15 #include "xfa/fde/fde_image.h" | |
16 #include "xfa/fde/fde_path.h" | 15 #include "xfa/fde/fde_path.h" |
17 #include "xfa/fde/fde_pen.h" | 16 #include "xfa/fde/fde_pen.h" |
| 17 #include "xfa/fgas/crt/fgas_memory.h" |
18 #include "xfa/fgas/font/fgas_font.h" | 18 #include "xfa/fgas/font/fgas_font.h" |
19 | 19 |
20 enum FDE_VISUALOBJTYPE { | 20 enum FDE_VISUALOBJTYPE { |
21 FDE_VISUALOBJ_Canvas = 0x00, | 21 FDE_VISUALOBJ_Canvas = 0x00, |
22 FDE_VISUALOBJ_Text = 0x01, | 22 FDE_VISUALOBJ_Text = 0x01 |
23 FDE_VISUALOBJ_Image = 0x02, | |
24 FDE_VISUALOBJ_Path = 0x04, | |
25 FDE_VISUALOBJ_Widget = 0x08, | |
26 }; | 23 }; |
27 | 24 |
28 typedef struct FDE_HVISUALOBJ_ { void* pData; } const* FDE_HVISUALOBJ; | 25 typedef struct FDE_HVISUALOBJ_ { void* pData; } const* FDE_HVISUALOBJ; |
29 | 26 |
30 class IFDE_VisualSet { | 27 class IFDE_VisualSet { |
31 public: | 28 public: |
32 virtual ~IFDE_VisualSet() {} | 29 virtual ~IFDE_VisualSet() {} |
33 virtual FDE_VISUALOBJTYPE GetType() = 0; | 30 virtual FDE_VISUALOBJTYPE GetType() = 0; |
34 virtual FX_BOOL GetBBox(FDE_HVISUALOBJ hVisualObj, CFX_RectF& bbox) = 0; | 31 virtual FX_BOOL GetBBox(FDE_HVISUALOBJ hVisualObj, CFX_RectF& bbox) = 0; |
35 virtual FX_BOOL GetMatrix(FDE_HVISUALOBJ hVisualObj, CFX_Matrix& matrix) = 0; | 32 virtual FX_BOOL GetMatrix(FDE_HVISUALOBJ hVisualObj, CFX_Matrix& matrix) = 0; |
(...skipping 18 matching lines...) Expand all Loading... |
54 virtual FX_FLOAT GetFontSize(FDE_HVISUALOBJ hText) = 0; | 51 virtual FX_FLOAT GetFontSize(FDE_HVISUALOBJ hText) = 0; |
55 virtual FX_ARGB GetFontColor(FDE_HVISUALOBJ hText) = 0; | 52 virtual FX_ARGB GetFontColor(FDE_HVISUALOBJ hText) = 0; |
56 virtual int32_t GetDisplayPos(FDE_HVISUALOBJ hText, | 53 virtual int32_t GetDisplayPos(FDE_HVISUALOBJ hText, |
57 FXTEXT_CHARPOS* pCharPos, | 54 FXTEXT_CHARPOS* pCharPos, |
58 FX_BOOL bCharCode = FALSE, | 55 FX_BOOL bCharCode = FALSE, |
59 CFX_WideString* pWSForms = NULL) = 0; | 56 CFX_WideString* pWSForms = NULL) = 0; |
60 virtual int32_t GetCharRects(FDE_HVISUALOBJ hText, | 57 virtual int32_t GetCharRects(FDE_HVISUALOBJ hText, |
61 CFX_RectFArray& rtArray) = 0; | 58 CFX_RectFArray& rtArray) = 0; |
62 }; | 59 }; |
63 | 60 |
64 struct FDE_IMAGEFILTERPARAMS : public CFX_Target { | |
65 int32_t iFilterType; | |
66 }; | |
67 | |
68 class IFDE_ImageSet : public IFDE_VisualSet { | |
69 public: | |
70 virtual IFDE_Image* GetImage(FDE_HVISUALOBJ hImage) = 0; | |
71 virtual FX_POSITION GetFirstFilterPosition(FDE_HVISUALOBJ hImage) = 0; | |
72 virtual const FDE_IMAGEFILTERPARAMS* GetNextFilter(FDE_HVISUALOBJ hImage, | |
73 FX_POSITION& pos) = 0; | |
74 }; | |
75 | |
76 class IFDE_PathSet : public IFDE_VisualSet { | |
77 public: | |
78 virtual IFDE_Path* GetPath(FDE_HVISUALOBJ hPath) = 0; | |
79 virtual int32_t GetFillMode(FDE_HVISUALOBJ hPath) = 0; | |
80 virtual int32_t GetRenderMode(FDE_HVISUALOBJ hPath) = 0; | |
81 virtual IFDE_Pen* GetPen(FDE_HVISUALOBJ hPath) = 0; | |
82 virtual FX_FLOAT GetPenWidth(FDE_HVISUALOBJ hPath) = 0; | |
83 virtual IFDE_Brush* GetBrush(FDE_HVISUALOBJ hPath) = 0; | |
84 }; | |
85 | |
86 enum FDE_WIDGETOBJ { | |
87 FDE_WIDGETOBJ_Unknown = 0x0000, | |
88 FDE_WIDGETOBJ_Anchor = 0x0100, | |
89 FDE_WIDGETOBJ_NamedDest = 0x0200, | |
90 FDE_WIDGETOBJ_HyperLink = 0x0400, | |
91 }; | |
92 | |
93 class IFDE_WidgetSet : public IFDE_VisualSet { | |
94 public: | |
95 virtual FDE_WIDGETOBJ GetWidgetType(FDE_HVISUALOBJ hWidget) = 0; | |
96 virtual FX_FLOAT GetFloat(FDE_HVISUALOBJ hWidget, | |
97 int32_t iParameter, | |
98 FX_FLOAT fDefVal = 0.0f) = 0; | |
99 virtual int32_t GetInteger(FDE_HVISUALOBJ hWidget, | |
100 int32_t iParameter, | |
101 int32_t iDefVal = 0) = 0; | |
102 virtual FX_BOOL GetString(FDE_HVISUALOBJ hWidget, | |
103 int32_t iParameter, | |
104 CFX_WideString& wsValue) = 0; | |
105 virtual FX_BOOL GetRects(FDE_HVISUALOBJ hWidget, | |
106 int32_t iParameter, | |
107 CFX_RectFArray& rects) = 0; | |
108 }; | |
109 | |
110 class IFDE_VisualSetIterator { | 61 class IFDE_VisualSetIterator { |
111 public: | 62 public: |
112 static IFDE_VisualSetIterator* Create(); | 63 static IFDE_VisualSetIterator* Create(); |
113 virtual ~IFDE_VisualSetIterator() {} | 64 virtual ~IFDE_VisualSetIterator() {} |
114 virtual void Release() = 0; | 65 virtual void Release() = 0; |
115 virtual FX_BOOL AttachCanvas(IFDE_CanvasSet* pCanvas) = 0; | 66 virtual FX_BOOL AttachCanvas(IFDE_CanvasSet* pCanvas) = 0; |
116 virtual FX_BOOL FilterObjects(uint32_t dwObjects = 0xFFFFFFFF) = 0; | 67 virtual FX_BOOL FilterObjects(uint32_t dwObjects = 0xFFFFFFFF) = 0; |
117 virtual void Reset() = 0; | 68 virtual void Reset() = 0; |
118 virtual FDE_HVISUALOBJ GetNext(IFDE_VisualSet*& pVisualSet, | 69 virtual FDE_HVISUALOBJ GetNext(IFDE_VisualSet*& pVisualSet, |
119 FDE_HVISUALOBJ* phCanvasObj = NULL, | 70 FDE_HVISUALOBJ* phCanvasObj = NULL, |
120 IFDE_CanvasSet** ppCanvasSet = NULL) = 0; | 71 IFDE_CanvasSet** ppCanvasSet = NULL) = 0; |
121 }; | 72 }; |
122 | 73 |
123 #endif // XFA_FDE_FDE_VISUALSET_H_ | 74 #endif // XFA_FDE_FDE_VISUALSET_H_ |
OLD | NEW |