-
Notifications
You must be signed in to change notification settings - Fork 0
/
QFormLayout.hs
137 lines (128 loc) · 5.73 KB
/
QFormLayout.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
-- This file is part of Qtah.
--
-- Copyright 2015-2016 Bryan Gardiner <[email protected]>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
module Graphics.UI.Qtah.Generator.Interface.Widgets.QFormLayout (
aModule,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass, ExportEnum),
MethodApplicability (MConst),
Purity (Nonpure),
addReqIncludes,
ident,
ident1,
ident2,
includeLocal,
includeStd,
makeClass,
makeFnMethod,
mkConstMethod,
mkConstMethod',
mkCtor,
mkMethod,
mkMethod',
mkProp,
mkProps,
)
import Foreign.Hoppy.Generator.Types (bitspaceT, constT, enumT, intT, objT, ptrT, refT, voidT)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import Graphics.UI.Qtah.Generator.Interface.Core.Types (bs_Alignment)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QLayout (c_QLayout)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QLayoutItem (c_QLayoutItem)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QWidget (c_QWidget)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
minVersion = [4, 4]
aModule =
AQtModule $
makeQtModuleWithMinVersion ["Widgets", "QFormLayout"] minVersion
[ QtExport $ ExportClass c_QFormLayout
, QtExport $ ExportEnum e_FieldGrowthPolicy
, QtExport $ ExportEnum e_ItemRole
, QtExport $ ExportEnum e_RowWrapPolicy
]
c_QFormLayout =
addReqIncludes [includeStd "QFormLayout",
includeLocal "wrap_qformlayout.hpp"] $
makeClass (ident "QFormLayout") Nothing [c_QLayout]
[ mkCtor "new" []
, mkCtor "newWithParent" [ptrT $ objT c_QWidget]
] $
[ mkMethod' "addRow" "addRowWidgetWidget" [ptrT $ objT c_QWidget, ptrT $ objT c_QWidget] voidT
, mkMethod' "addRow" "addRowWidgetLayout" [ptrT $ objT c_QWidget, ptrT $ objT c_QLayout] voidT
, mkMethod' "addRow" "addRowStringWidget" [objT c_QString, ptrT $ objT c_QWidget] voidT
, mkMethod' "addRow" "addRowStringLayout" [objT c_QString, ptrT $ objT c_QLayout] voidT
, mkMethod' "addRow" "addRowWidget" [ptrT $ objT c_QWidget] voidT
, mkMethod' "addRow" "addRowLayout" [ptrT $ objT c_QLayout] voidT
, makeFnMethod (ident2 "qtah" "qformlayout" "getItemRow") "getItemRow" MConst Nonpure
[refT $ constT $ objT c_QFormLayout, intT] intT
, makeFnMethod (ident2 "qtah" "qformlayout" "getItemRole") "getItemRole" MConst Nonpure
[refT $ constT $ objT c_QFormLayout, intT] $ enumT e_ItemRole
, makeFnMethod (ident2 "qtah" "qformlayout" "getLayoutRow") "getLayoutRow" MConst Nonpure
[refT $ constT $ objT c_QFormLayout, ptrT $ objT c_QLayout] intT
, makeFnMethod (ident2 "qtah" "qformlayout" "getLayoutRole") "getLayoutRole" MConst Nonpure
[refT $ constT $ objT c_QFormLayout, ptrT $ objT c_QLayout] $ enumT e_ItemRole
, makeFnMethod (ident2 "qtah" "qformlayout" "getWidgetRow") "getWidgetRow" MConst Nonpure
[refT $ constT $ objT c_QFormLayout, ptrT $ objT c_QWidget] intT
, makeFnMethod (ident2 "qtah" "qformlayout" "getWidgetRole") "getWidgetRole" MConst Nonpure
[refT $ constT $ objT c_QFormLayout, ptrT $ objT c_QWidget] $ enumT e_ItemRole
, mkMethod' "insertRow" "insertRowWidgetWidget"
[intT, ptrT $ objT c_QWidget, ptrT $ objT c_QWidget] voidT
, mkMethod' "insertRow" "insertRowWidgetLayout"
[intT, ptrT $ objT c_QWidget, ptrT $ objT c_QLayout] voidT
, mkMethod' "insertRow" "insertRowStringWidget"
[intT, objT c_QString, ptrT $ objT c_QWidget] voidT
, mkMethod' "insertRow" "insertRowStringLayout"
[intT, objT c_QString, ptrT $ objT c_QLayout] voidT
, mkMethod' "insertRow" "insertRowWidget" [intT, ptrT $ objT c_QWidget] voidT
, mkMethod' "insertRow" "insertRowLayout" [intT, ptrT $ objT c_QLayout] voidT
, mkConstMethod "itemAt" [intT, enumT e_ItemRole] $ ptrT $ objT c_QLayoutItem
, mkConstMethod' "labelForField" "labelForFieldWidget"
[ptrT $ objT c_QWidget] $ ptrT $ objT c_QWidget
, mkConstMethod' "labelForField" "labelForFieldLayout"
[ptrT $ objT c_QLayout] $ ptrT $ objT c_QWidget
, mkConstMethod "rowCount" [] intT
, mkMethod "setItem" [intT, enumT e_ItemRole, ptrT $ objT c_QLayoutItem] voidT
, mkMethod "setLayout" [intT, enumT e_ItemRole, ptrT $ objT c_QLayout] voidT
, mkMethod "setWidget" [intT, enumT e_ItemRole, ptrT $ objT c_QWidget] voidT
] ++
mkProps
[ mkProp "fieldGrowthPolicy" $ enumT e_FieldGrowthPolicy
, mkProp "formAlignment" $ bitspaceT bs_Alignment
, mkProp "horizontalSpacing" intT
, mkProp "labelAlignment" $ bitspaceT bs_Alignment
, mkProp "rowWrapPolicy" $ enumT e_RowWrapPolicy
, mkProp "spacing" intT
, mkProp "verticalSpacing" intT
]
e_FieldGrowthPolicy =
makeQtEnum (ident1 "QFormLayout" "FieldGrowthPolicy") [includeStd "QFormLayout"]
[ (0, ["fields", "stay", "at", "size", "hint"])
, (1, ["expanding", "fields", "grow"])
, (2, ["all", "non", "fixed", "fields", "grow"])
]
e_ItemRole =
makeQtEnum (ident1 "QFormLayout" "ItemRole") [includeStd "QFormLayout"]
[ (0, ["label", "role"])
, (1, ["field", "role"])
, (2, ["spanning", "role"])
]
e_RowWrapPolicy =
makeQtEnum (ident1 "QFormLayout" "RowWrapPolicy") [includeStd "QFormLayout"]
[ (0, ["dont", "wrap", "rows"])
, (1, ["wrap", "long", "rows"])
, (2, ["wrap", "all", "rows"])
]