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