OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef XFA_SRC_FDE_FDE_VISUALSET_H_ | |
8 #define XFA_SRC_FDE_FDE_VISUALSET_H_ | |
9 | |
10 #include "core/include/fxcrt/fx_coordinates.h" | |
11 #include "core/include/fxcrt/fx_system.h" | |
12 #include "core/include/fxge/fx_dib.h" | |
13 #include "core/include/fxge/fx_ge.h" | |
14 #include "xfa/src/fde/fde_brush.h" | |
15 #include "xfa/src/fde/fde_image.h" | |
16 #include "xfa/src/fde/fde_path.h" | |
17 #include "xfa/src/fde/fde_pen.h" | |
18 #include "xfa/src/fgas/font/fgas_font.h" | |
19 | |
20 enum FDE_VISUALOBJTYPE { | |
21 FDE_VISUALOBJ_Canvas = 0x00, | |
22 FDE_VISUALOBJ_Text = 0x01, | |
23 FDE_VISUALOBJ_Image = 0x02, | |
24 FDE_VISUALOBJ_Path = 0x04, | |
25 FDE_VISUALOBJ_Widget = 0x08, | |
26 }; | |
27 | |
28 typedef struct FDE_HVISUALOBJ_ { void* pData; } const* FDE_HVISUALOBJ; | |
29 | |
30 class IFDE_VisualSet { | |
31 public: | |
32 virtual ~IFDE_VisualSet() {} | |
33 virtual FDE_VISUALOBJTYPE GetType() = 0; | |
34 virtual FX_BOOL GetBBox(FDE_HVISUALOBJ hVisualObj, CFX_RectF& bbox) = 0; | |
35 virtual FX_BOOL GetMatrix(FDE_HVISUALOBJ hVisualObj, CFX_Matrix& matrix) = 0; | |
36 virtual FX_BOOL GetRect(FDE_HVISUALOBJ hVisualObj, CFX_RectF& rt) = 0; | |
37 virtual FX_BOOL GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF& rt) = 0; | |
38 }; | |
39 | |
40 class IFDE_CanvasSet : public IFDE_VisualSet { | |
41 public: | |
42 virtual FX_POSITION GetFirstPosition(FDE_HVISUALOBJ hCanvas) = 0; | |
43 virtual FDE_HVISUALOBJ GetNext(FDE_HVISUALOBJ hCanvas, | |
44 FX_POSITION& pos, | |
45 IFDE_VisualSet*& pVisualSet) = 0; | |
46 virtual FDE_HVISUALOBJ GetParentCanvas(FDE_HVISUALOBJ hCanvas, | |
47 IFDE_VisualSet*& pVisualSet) = 0; | |
48 }; | |
49 | |
50 class IFDE_TextSet : public IFDE_VisualSet { | |
51 public: | |
52 virtual int32_t GetString(FDE_HVISUALOBJ hText, CFX_WideString& wsText) = 0; | |
53 virtual IFX_Font* GetFont(FDE_HVISUALOBJ hText) = 0; | |
54 virtual FX_FLOAT GetFontSize(FDE_HVISUALOBJ hText) = 0; | |
55 virtual FX_ARGB GetFontColor(FDE_HVISUALOBJ hText) = 0; | |
56 virtual int32_t GetDisplayPos(FDE_HVISUALOBJ hText, | |
57 FXTEXT_CHARPOS* pCharPos, | |
58 FX_BOOL bCharCode = FALSE, | |
59 CFX_WideString* pWSForms = NULL) = 0; | |
60 virtual int32_t GetCharRects(FDE_HVISUALOBJ hText, | |
61 CFX_RectFArray& rtArray) = 0; | |
62 }; | |
63 | |
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 { | |
111 public: | |
112 static IFDE_VisualSetIterator* Create(); | |
113 virtual ~IFDE_VisualSetIterator() {} | |
114 virtual void Release() = 0; | |
115 virtual FX_BOOL AttachCanvas(IFDE_CanvasSet* pCanvas) = 0; | |
116 virtual FX_BOOL FilterObjects(FX_DWORD dwObjects = 0xFFFFFFFF) = 0; | |
117 virtual void Reset() = 0; | |
118 virtual FDE_HVISUALOBJ GetNext(IFDE_VisualSet*& pVisualSet, | |
119 FDE_HVISUALOBJ* phCanvasObj = NULL, | |
120 IFDE_CanvasSet** ppCanvasSet = NULL) = 0; | |
121 }; | |
122 | |
123 #endif // XFA_SRC_FDE_FDE_VISUALSET_H_ | |
OLD | NEW |