ObjQt  Diff

Differences From Artifact [122eed180b]:

To Artifact [d6c33d3e64]:


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
138
139
140
141

142
143
144
145
146

147
148
149
150
151

152
153
154
155
156

157
158
159
160
161

162
163
164
165
166

167
168
169
170
171

172
173
174
175
176

177
178
179
180
181

182
183
184
185
186

187
188
189
190
191

192
193
194
195
196

197
198
199
200
201

202
203
204
205
206

207
208
209
210
211

212
213
214
215
216

217
218
219
220
221

222
223
224
225
226

227
228
229
230
231

232
233
234
235
236
237

238
239
240
241
242
243
244
245
246
247
248
249

250
251
252
253
254

255
256
257
258
259

260
261
262
263
264
265

266
267
268
269
270






271
272
273
274
275

276
277
278
279
280

281
282
283
284
285

286
287
288
289
290

291
292
293
294
295

296
297
298
299
300

301
302
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

138
139
140
141
142

143
144
145
146
147

148
149
150
151
152

153
154
155
156
157

158
159
160
161
162

163
164
165
166
167

168
169
170
171
172

173
174
175
176
177

178
179
180
181
182

183
184
185
186
187

188
189
190
191
192

193
194
195
196
197

198
199
200
201
202

203
204
205
206
207

208
209
210
211
212

213
214
215
216
217

218
219
220
221
222

223
224
225
226
227

228
229
230
231
232

233
234
235
236
237
238

239

240
241
242
243
244
245
246
247
248
249

250
251
252
253
254

255
256
257
258
259

260
261
262
263
264


265
266
267
268
269

270
271
272
273
274
275
276
277
278
279

280
281
282
283
284

285
286
287
288
289

290
291
292
293
294

295
296
297
298
299

300
301
302
303
304

305
306
307







+

-
+
+



















-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+





-
+
-










-
+




-
+




-
+




-
-
+




-
+
+
+
+
+
+




-
+




-
+




-
+




-
+




-
+




-
+


 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtAction.h"
#import "QtWidget.h"
#import "OFString+QString.h"

#import "helpers.h"
using ObjQt::toOF;
using ObjQt::toQt;

@implementation QtAction
- initWithQObject: (QObject*)qObject
{
	OF_INVALID_INIT_METHOD
}

- initWithQAction: (QAction*)qAction
{
	return [super initWithQObject: qAction];
}

- (QAction*)qAction
{
	return qobject_cast<QAction*>(_qObject);
}

- (bool)autoRepeat
{
	return [self qAction]->autoRepeat();
	return toQt(self)->autoRepeat();
}

- (void)setAutoRepeat: (bool)autoRepeat
{
	[self qAction]->setAutoRepeat(autoRepeat);
	toQt(self)->setAutoRepeat(autoRepeat);
}

- (bool)isCheckable
{
	return [self qAction]->isCheckable();
	return toQt(self)->isCheckable();
}

- (void)setCheckable: (bool)checkable
{
	[self qAction]->setCheckable(checkable);
	toQt(self)->setCheckable(checkable);
}

- (bool)isChecked
{
	return [self qAction]->isChecked();
	return toQt(self)->isChecked();
}

- (void)setChecked: (bool)checked
{
	[self qAction]->setChecked(checked);
	toQt(self)->setChecked(checked);
}

- (bool)isEnabled
{
	return [self qAction]->isEnabled();
	return toQt(self)->isEnabled();
}

- (void)setEnabled: (bool)enabled
{
	[self qAction]->setEnabled(enabled);
	toQt(self)->setEnabled(enabled);
}

- (QFont)font
{
	return [self qAction]->font();
	return toQt(self)->font();
}

- (void)setFont: (QFont)font
{
	[self qAction]->setFont(font);
	toQt(self)->setFont(font);
}

- (QIcon)icon
{
	return [self qAction]->icon();
	return toQt(self)->icon();
}

- (void)setIcon: (QIcon)icon
{
	[self qAction]->setIcon(icon);
	toQt(self)->setIcon(icon);
}

- (OFString*)iconText
{
	return toOF([self qAction]->iconText());
	return toOF(toQt(self)->iconText());
}

- (void)setIconText: (OFString*)iconText
{
	[self qAction]->setIconText(toQt(iconText));
	toQt(self)->setIconText(toQt(iconText));
}

- (bool)isIconVisibleInMenu
{
	return [self qAction]->isIconVisibleInMenu();
	return toQt(self)->isIconVisibleInMenu();
}

- (void)setIconVisibleInMenu: (bool)iconVisibleInMenu
{
	[self qAction]->setIconVisibleInMenu(iconVisibleInMenu);
	toQt(self)->setIconVisibleInMenu(iconVisibleInMenu);
}

- (QAction::MenuRole)menuRole
{
	return [self qAction]->menuRole();
	return toQt(self)->menuRole();
}

- (void)setMenuRole: (QAction::MenuRole)menuRole
{
	[self qAction]->setMenuRole(menuRole);
	toQt(self)->setMenuRole(menuRole);
}

- (QAction::Priority)priority
{
	return [self qAction]->priority();
	return toQt(self)->priority();
}

- (void)setPriority: (QAction::Priority)priority
{
	[self qAction]->setPriority(priority);
	toQt(self)->setPriority(priority);
}

- (QKeySequence)shortcut
{
	return [self qAction]->shortcut();
	return toQt(self)->shortcut();
}

- (void)setShortcut: (QKeySequence)shortcut
{
	[self qAction]->setShortcut(shortcut);
	toQt(self)->setShortcut(shortcut);
}

- (Qt::ShortcutContext)shortcutContext
{
	return [self qAction]->shortcutContext();
	return toQt(self)->shortcutContext();
}

- (void)setShortcutContext: (Qt::ShortcutContext)shortcutContext
{
	[self qAction]->setShortcutContext(shortcutContext);
	toQt(self)->setShortcutContext(shortcutContext);
}

- (OFString*)statusTip
{
	return toOF([self qAction]->statusTip());
	return toOF(toQt(self)->statusTip());
}

- (void)setStatusTip: (OFString*)statusTip
{
	[self qAction]->setStatusTip(toQt(statusTip));
	toQt(self)->setStatusTip(toQt(statusTip));
}

- (OFString*)text
{
	return toOF([self qAction]->text());
	return toOF(toQt(self)->text());
}

- (void)setText: (OFString*)text
{
	[self qAction]->setText(toQt(text));
	toQt(self)->setText(toQt(text));
}

- (OFString*)toolTip
{
	return toOF([self qAction]->toolTip());
	return toOF(toQt(self)->toolTip());
}

- (void)setToolTip: (OFString*)toolTip
{
	[self qAction]->setToolTip(toQt(toolTip));
	toQt(self)->setToolTip(toQt(toolTip));
}

- (bool)isVisible
{
	return [self qAction]->isVisible();
	return toQt(self)->isVisible();
}

- (void)setVisible: (bool)visible
{
	[self qAction]->setVisible(visible);
	toQt(self)->setVisible(visible);
}

- (OFString*)whatsThis
{
	return toOF([self qAction]->whatsThis());
	return toOF(toQt(self)->whatsThis());
}

- (void)setWhatsThis: (OFString*)whatsThis
{
	[self qAction]->setWhatsThis(toQt(whatsThis));
	toQt(self)->setWhatsThis(toQt(whatsThis));
}

- (QActionGroup*)actionGroup
{
	return [self qAction]->actionGroup();
	return toQt(self)->actionGroup();
}

- (void)activate: (QAction::ActionEvent)event
{
	[self qAction]->activate(event);
	toQt(self)->activate(event);
}

- (QList<QGraphicsWidget*>)associatedGraphicsWidgets
{
	return [self qAction]->associatedGraphicsWidgets();
	return toQt(self)->associatedGraphicsWidgets();
}

- (OFArray OF_GENERIC(QtWidget*)*)associatedWidgets
{
	const QList<QWidget*> &widgets = [self qAction]->associatedWidgets();
	const QList<QWidget*> &widgets = toQt(self)->associatedWidgets();
	OFMutableArray *ret =
	    [OFMutableArray arrayWithCapacity: widgets.count()];
	void *pool = objc_autoreleasePoolPush();

	for (QWidget *widget: widgets)
		[ret addObject:
		[ret addObject: toOF(widget)];
		    [[[QtWidget alloc] initWithQWidget: widget] autorelease]];

	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}

- (QVariant)data
{
	return [self qAction]->data();
	return toQt(self)->data();
}

- (bool)isSeparator
{
	return [self qAction]->isSeparator();
	return toQt(self)->isSeparator();
}

- (QMenu*)menu
{
	return [self qAction]->menu();
	return toQt(self)->menu();
}

- (QtWidget*)parentWidget
{
	return [[[QtWidget alloc] initWithQWidget:
	    [self qAction]->parentWidget()] autorelease];
	return toOF(toQt(self)->parentWidget());
}

- (void)setActionGroup: (QActionGroup*)group
{
	[self qAction]->setActionGroup(group);
	toQt(self)->setActionGroup(group);
}

- (void)setData: (const QVariant&)userData
{
	toQt(self)->setData(userData);
}

- (void)setMenu: (QMenu*)menu
{
	[self qAction]->setMenu(menu);
	toQt(self)->setMenu(menu);
}

- (void)setSeparator: (bool)isSeparator
{
	[self qAction]->setSeparator(isSeparator);
	toQt(self)->setSeparator(isSeparator);
}

- (void)setShortcuts: (const QList<QKeySequence>&)shortcuts
{
	[self qAction]->setShortcuts(shortcuts);
	toQt(self)->setShortcuts(shortcuts);
}

- (void)setShortcutsWithStandardKey: (QKeySequence::StandardKey)key
{
	[self qAction]->setShortcuts(key);
	toQt(self)->setShortcuts(key);
}

- (QList<QKeySequence>)shortcuts
{
	return [self qAction]->shortcuts();
	return toQt(self)->shortcuts();
}

- (bool)showStatusText: (QtWidget*)widget
{
	return [self qAction]->showStatusText([widget qWidget]);
	return toQt(self)->showStatusText(toQt(widget));
}
@end