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
 * 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 "helpers.h"



@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();
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}

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

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

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

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

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





}

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

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

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

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

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

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







>

<
>
>



















|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|




|





|
<










|




|




|




<
|




|
>
>
>
>
>




|




|




|




|




|




|


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"


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 toQt(self)->autoRepeat();
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	for (QWidget *widget: widgets)
		[ret addObject: toOF(widget)];


	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}

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

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

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

- (QtWidget*)parentWidget
{

	return toOF(toQt(self)->parentWidget());
}

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

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

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

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

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

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

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

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