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_FWL_CORE_IFWL_GRID_H_ | |
8 #define XFA_FWL_CORE_IFWL_GRID_H_ | |
9 | |
10 #include "xfa/fwl/core/ifwl_content.h" | |
11 | |
12 class IFWL_Widget; | |
13 | |
14 #define FWL_CLASS_Grid L"FWL_GRID" | |
15 #define FWL_CLASSHASH_Grid 3150298670 | |
16 #define FWL_GRIDSTYLEEXT_ShowGridLines (1L << 0) | |
17 | |
18 struct FWL_LAYOUTDATA { | |
19 FX_FLOAT fWidth; | |
20 FX_FLOAT fHeight; | |
21 }; | |
22 | |
23 enum FWL_GRIDUNIT { | |
24 FWL_GRIDUNIT_Auto = 0, | |
25 FWL_GRIDUNIT_Fixed, | |
26 FWL_GRIDUNIT_Scaled, | |
27 FWL_GRIDUNIT_Infinity, | |
28 }; | |
29 | |
30 enum FWL_GRIDMARGIN { | |
31 FWL_GRIDMARGIN_Left = 0, | |
32 FWL_GRIDMARGIN_Top, | |
33 FWL_GRIDMARGIN_Right, | |
34 FWL_GRIDMARGIN_Bottom, | |
35 }; | |
36 | |
37 enum FWL_GRIDSIZE { | |
38 FWL_GRIDSIZE_Width = 0, | |
39 FWL_GRIDSIZE_Height, | |
40 FWL_GRIDSIZE_MinWidth, | |
41 FWL_GRIDSIZE_MinHeight, | |
42 FWL_GRIDSIZE_MaxWidth, | |
43 FWL_GRIDSIZE_MaxHeight, | |
44 }; | |
45 | |
46 typedef struct FWL_HGRIDCOLROW_ { void* pData; } * FWL_HGRIDCOLROW; | |
47 | |
48 class IFWL_Grid : public IFWL_Content { | |
49 public: | |
50 static IFWL_Grid* Create(const CFWL_WidgetImpProperties& properties); | |
51 | |
52 FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, int32_t nIndex = -1); | |
53 int32_t CountColRows(FX_BOOL bColumn); | |
54 FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, int32_t nIndex); | |
55 int32_t GetIndex(FWL_HGRIDCOLROW hColRow); | |
56 FX_FLOAT GetSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); | |
57 FWL_ERR SetSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit); | |
58 FX_FLOAT GetMinSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); | |
59 FWL_ERR SetMinSize(FWL_HGRIDCOLROW hColRow, | |
60 FX_FLOAT fSize, | |
61 FWL_GRIDUNIT eUnit); | |
62 FX_FLOAT GetMaxSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); | |
63 FWL_ERR SetMaxSize(FWL_HGRIDCOLROW hColRow, | |
64 FX_FLOAT fSize, | |
65 FWL_GRIDUNIT eUnit); | |
66 FX_BOOL DeleteColRow(FWL_HGRIDCOLROW hColRow); | |
67 FX_BOOL IsColumn(FWL_HGRIDCOLROW hColRow); | |
68 int32_t GetWidgetPos(IFWL_Widget* pWidget, FX_BOOL bColumn); | |
69 FWL_ERR SetWidgetPos(IFWL_Widget* pWidget, int32_t iPos, FX_BOOL bColumn); | |
70 int32_t GetWidgetSpan(IFWL_Widget* pWidget, FX_BOOL bColumn); | |
71 FWL_ERR SetWidgetSpan(IFWL_Widget* pWidget, int32_t iSpan, FX_BOOL bColumn); | |
72 FX_FLOAT GetWidgetSize(IFWL_Widget* pWidget, | |
73 FWL_GRIDSIZE eSize, | |
74 FWL_GRIDUNIT& eUnit); | |
75 FWL_ERR SetWidgetSize(IFWL_Widget* pWidget, | |
76 FWL_GRIDSIZE eSize, | |
77 FX_FLOAT fSize, | |
78 FWL_GRIDUNIT eUit); | |
79 FX_BOOL GetWidgetMargin(IFWL_Widget* pWidget, | |
80 FWL_GRIDMARGIN eMargin, | |
81 FX_FLOAT& fMargin); | |
82 FWL_ERR SetWidgetMargin(IFWL_Widget* pWidget, | |
83 FWL_GRIDMARGIN eMargin, | |
84 FX_FLOAT fMargin); | |
85 FWL_ERR RemoveWidgetMargin(IFWL_Widget* pWidget, FWL_GRIDMARGIN eMargin); | |
86 FX_FLOAT GetGridSize(FWL_GRIDSIZE eSize, FWL_GRIDUNIT& eUnit); | |
87 FWL_ERR SetGridSize(FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit); | |
88 | |
89 protected: | |
90 IFWL_Grid(); | |
91 }; | |
92 | |
93 #endif // XFA_FWL_CORE_IFWL_GRID_H_ | |
OLD | NEW |