/
qmimedata.go
553 lines (441 loc) · 16.7 KB
/
qmimedata.go
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
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
package qtcore
// /usr/include/qt/QtCore/qmimedata.h
// #include <qmimedata.h>
// #include <QtCore>
// header block end
// main block begin
// main block end
// use block begin
// use block end
// ext block begin
/*
#include <stdlib.h>
// extern C begin: 4
*/
// import "C"
import "unsafe"
import "reflect"
import "fmt"
import "log"
import "github.com/kitech/qt.go/qtrt"
// ext block end
// body block begin
// QVariant retrieveData(const QString &, QVariant::Type)
func (this *QMimeData) InheritRetrieveData(f func(mimetype string, preferredType int) unsafe.Pointer) {
qtrt.SetAllInheritCallback(this, "retrieveData", f)
}
/*
*/
type QMimeData struct {
*QObject
}
type QMimeData_ITF interface {
QObject_ITF
QMimeData_PTR() *QMimeData
}
func (ptr *QMimeData) QMimeData_PTR() *QMimeData { return ptr }
func (this *QMimeData) GetCthis() unsafe.Pointer {
if this == nil {
return nil
} else {
return this.QObject.GetCthis()
}
}
func (this *QMimeData) SetCthis(cthis unsafe.Pointer) {
this.QObject = NewQObjectFromPointer(cthis)
}
func NewQMimeDataFromPointer(cthis unsafe.Pointer) *QMimeData {
bcthis0 := NewQObjectFromPointer(cthis)
return &QMimeData{bcthis0}
}
func (*QMimeData) NewFromPointer(cthis unsafe.Pointer) *QMimeData {
return NewQMimeDataFromPointer(cthis)
}
// /usr/include/qt/QtCore/qmimedata.h:54
// index:0
// Public virtual Visibility=Default Availability=Available
// [8] const QMetaObject * metaObject() const
/*
*/
func (this *QMimeData) MetaObject() *QMetaObject /*777 const QMetaObject **/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData10metaObjectEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return /*==*/ NewQMetaObjectFromPointer(unsafe.Pointer(uintptr(rv))) // 444
}
// /usr/include/qt/QtCore/qmimedata.h:56
// index:0
// Public Visibility=Default Availability=Available
// [-2] void QMimeData()
/*
Constructs a new MIME data object with no data in it.
*/
func (*QMimeData) NewForInherit() *QMimeData {
return NewQMimeData()
}
func NewQMimeData() *QMimeData {
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeDataC2Ev", qtrt.FFI_TYPE_POINTER)
qtrt.ErrPrint(err, rv)
gothis := NewQMimeDataFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.ConnectDestroyed(gothis, "QMimeData")
return gothis
}
// /usr/include/qt/QtCore/qmimedata.h:57
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void ~QMimeData()
/*
*/
func DeleteQMimeData(this *QMimeData) {
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeDataD2Ev", qtrt.FFI_TYPE_VOID, this.GetCthis())
qtrt.Cmemset(this.GetCthis(), 9, 16)
qtrt.ErrPrint(err, rv)
this.SetCthis(nil)
}
// /usr/include/qt/QtCore/qmimedata.h:59
// index:0
// Public Visibility=Default Availability=Available
// [-2] QList<QUrl> urls() const
/*
Returns a list of URLs contained within the MIME data object.
URLs correspond to the MIME type text/uri-list.
See also setUrls(), hasUrls(), and data().
*/
func (this *QMimeData) Urls() *QUrlList /*lll*/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData4urlsEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQUrlListFromPointer(unsafe.Pointer(uintptr(rv))) //5552
return rv2
}
// /usr/include/qt/QtCore/qmimedata.h:61
// index:0
// Public Visibility=Default Availability=Available
// [1] bool hasUrls() const
/*
Returns true if the object can return a list of urls; otherwise returns false.
URLs correspond to the MIME type text/uri-list.
See also setUrls(), urls(), and hasFormat().
*/
func (this *QMimeData) HasUrls() bool {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData7hasUrlsEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtCore/qmimedata.h:63
// index:0
// Public Visibility=Default Availability=Available
// [8] QString text() const
/*
Returns a plain text (MIME type text/plain) representation of the data.
See also setText(), hasText(), html(), and data().
*/
func (this *QMimeData) Text() string {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData4textEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
rv3 := rv2.ToUtf8().Data()
/*==*/ DeleteQString(rv2)
return rv3
}
// /usr/include/qt/QtCore/qmimedata.h:64
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setText(const QString &)
/*
Sets text as the plain text (MIME type text/plain) used to represent the data.
See also text(), hasText(), setHtml(), and setData().
*/
func (this *QMimeData) SetText(text string) {
var tmpArg0 = NewQString5(text)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeData7setTextERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmimedata.h:65
// index:0
// Public Visibility=Default Availability=Available
// [1] bool hasText() const
/*
Returns true if the object can return plain text (MIME type text/plain); otherwise returns false.
See also setText(), text(), hasHtml(), and hasFormat().
*/
func (this *QMimeData) HasText() bool {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData7hasTextEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtCore/qmimedata.h:67
// index:0
// Public Visibility=Default Availability=Available
// [8] QString html() const
/*
Returns a string if the data stored in the object is HTML (MIME type text/html); otherwise returns an empty string.
See also setHtml(), hasHtml(), and setData().
*/
func (this *QMimeData) Html() string {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData4htmlEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
rv3 := rv2.ToUtf8().Data()
/*==*/ DeleteQString(rv2)
return rv3
}
// /usr/include/qt/QtCore/qmimedata.h:68
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setHtml(const QString &)
/*
Sets html as the HTML (MIME type text/html) used to represent the data.
See also html(), hasHtml(), setText(), and setData().
*/
func (this *QMimeData) SetHtml(html string) {
var tmpArg0 = NewQString5(html)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeData7setHtmlERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmimedata.h:69
// index:0
// Public Visibility=Default Availability=Available
// [1] bool hasHtml() const
/*
Returns true if the object can return HTML (MIME type text/html); otherwise returns false.
See also setHtml(), html(), and hasFormat().
*/
func (this *QMimeData) HasHtml() bool {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData7hasHtmlEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtCore/qmimedata.h:71
// index:0
// Public Visibility=Default Availability=Available
// [16] QVariant imageData() const
/*
Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null variant.
A QVariant is used because QMimeData belongs to the Qt Core module, whereas QImage belongs to Qt GUI. To convert the QVariant to a QImage, simply use qvariant_cast(). For example:
if (event->mimeData()->hasImage()) {
QImage image = qvariant_cast<QImage>(event->mimeData()->imageData());
...
}
See also setImageData() and hasImage().
*/
func (this *QMimeData) ImageData() *QVariant /*123*/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData9imageDataEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQVariantFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2 /*==*/, DeleteQVariant)
return rv2
}
// /usr/include/qt/QtCore/qmimedata.h:72
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setImageData(const QVariant &)
/*
Sets the data in the object to the given image.
A QVariant is used because QMimeData belongs to the Qt Core module, whereas QImage belongs to Qt GUI. The conversion from QImage to QVariant is implicit. For example:
mimeData->setImageData(QImage("beautifulfjord.png"));
See also imageData(), hasImage(), and setData().
*/
func (this *QMimeData) SetImageData(image QVariant_ITF) {
var convArg0 unsafe.Pointer
if image != nil && image.QVariant_PTR() != nil {
convArg0 = image.QVariant_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeData12setImageDataERK8QVariant", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmimedata.h:73
// index:0
// Public Visibility=Default Availability=Available
// [1] bool hasImage() const
/*
Returns true if the object can return an image; otherwise returns false.
See also setImageData(), imageData(), and hasFormat().
*/
func (this *QMimeData) HasImage() bool {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData8hasImageEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtCore/qmimedata.h:75
// index:0
// Public Visibility=Default Availability=Available
// [16] QVariant colorData() const
/*
Returns a color if the data stored in the object represents a color (MIME type application/x-color); otherwise returns a null variant.
A QVariant is used because QMimeData belongs to the Qt Core module, whereas QColor belongs to Qt GUI. To convert the QVariant to a QColor, simply use qvariant_cast(). For example:
if (event->mimeData()->hasColor()) {
QColor color = qvariant_cast<QColor>(event->mimeData()->colorData());
...
}
See also hasColor(), setColorData(), and data().
*/
func (this *QMimeData) ColorData() *QVariant /*123*/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData9colorDataEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQVariantFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2 /*==*/, DeleteQVariant)
return rv2
}
// /usr/include/qt/QtCore/qmimedata.h:76
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setColorData(const QVariant &)
/*
Sets the color data in the object to the given color.
Colors correspond to the MIME type application/x-color.
See also colorData(), hasColor(), and setData().
*/
func (this *QMimeData) SetColorData(color QVariant_ITF) {
var convArg0 unsafe.Pointer
if color != nil && color.QVariant_PTR() != nil {
convArg0 = color.QVariant_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeData12setColorDataERK8QVariant", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmimedata.h:77
// index:0
// Public Visibility=Default Availability=Available
// [1] bool hasColor() const
/*
Returns true if the object can return a color (MIME type application/x-color); otherwise returns false.
See also setColorData(), colorData(), and hasFormat().
*/
func (this *QMimeData) HasColor() bool {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData8hasColorEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtCore/qmimedata.h:79
// index:0
// Public Visibility=Default Availability=Available
// [8] QByteArray data(const QString &) const
/*
Returns the data stored in the object in the format described by the MIME type specified by mimeType.
See also setData().
*/
func (this *QMimeData) Data(mimetype string) *QByteArray /*123*/ {
var tmpArg0 = NewQString5(mimetype)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData4dataERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQByteArrayFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2 /*==*/, DeleteQByteArray)
return rv2
}
// /usr/include/qt/QtCore/qmimedata.h:80
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setData(const QString &, const QByteArray &)
/*
Sets the data associated with the MIME type given by mimeType to the specified data.
For the most common types of data, you can call the higher-level functions setText(), setHtml(), setUrls(), setImageData(), and setColorData() instead.
Note that if you want to use a custom data type in an item view drag and drop operation, you must register it as a Qt meta type, using the Q_DECLARE_METATYPE() macro, and implement stream operators for it. The stream operators must then be registered with the qRegisterMetaTypeStreamOperators() function.
See also data(), hasFormat(), QMetaType, and qRegisterMetaTypeStreamOperators().
*/
func (this *QMimeData) SetData(mimetype string, data QByteArray_ITF) {
var tmpArg0 = NewQString5(mimetype)
var convArg0 = tmpArg0.GetCthis()
var convArg1 unsafe.Pointer
if data != nil && data.QByteArray_PTR() != nil {
convArg1 = data.QByteArray_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeData7setDataERK7QStringRK10QByteArray", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, convArg1)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmimedata.h:81
// index:0
// Public Visibility=Default Availability=Available
// [-2] void removeFormat(const QString &)
/*
Removes the data entry for mimeType in the object.
This function was introduced in Qt 4.4.
*/
func (this *QMimeData) RemoveFormat(mimetype string) {
var tmpArg0 = NewQString5(mimetype)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeData12removeFormatERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmimedata.h:83
// index:0
// Public virtual Visibility=Default Availability=Available
// [1] bool hasFormat(const QString &) const
/*
Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns false.
For the most common types of data, you can call the higher-level functions hasText(), hasHtml(), hasUrls(), hasImage(), and hasColor() instead.
See also formats(), setData(), and data().
*/
func (this *QMimeData) HasFormat(mimetype string) bool {
var tmpArg0 = NewQString5(mimetype)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData9hasFormatERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtCore/qmimedata.h:84
// index:0
// Public virtual Visibility=Default Availability=Available
// [8] QStringList formats() const
/*
Returns a list of formats supported by the object. This is a list of MIME types for which the object can return suitable data. The formats in the list are in a priority order.
For the most common types of data, you can call the higher-level functions hasText(), hasHtml(), hasUrls(), hasImage(), and hasColor() instead.
See also hasFormat(), setData(), and data().
*/
func (this *QMimeData) Formats() *QStringList /*123*/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData7formatsEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQStringListFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2 /*==*/, DeleteQStringList)
return rv2
}
// /usr/include/qt/QtCore/qmimedata.h:86
// index:0
// Public Visibility=Default Availability=Available
// [-2] void clear()
/*
Removes all the MIME type and data entries in the object.
*/
func (this *QMimeData) Clear() {
rv, err := qtrt.InvokeQtFunc6("_ZN9QMimeData5clearEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmimedata.h:88
// index:0
// Protected virtual Visibility=Default Availability=Available
// [16] QVariant retrieveData(const QString &, QVariant::Type) const
/*
Returns a variant with the given type containing data for the MIME type specified by mimeType. If the object does not support the MIME type or variant type given, a null variant is returned instead.
This function is called by the general data() getter and by the convenience getters (text(), html(), urls(), imageData(), and colorData()). You can reimplement it if you want to store your data using a custom data structure (instead of a QByteArray, which is what setData() provides). You would then also need to reimplement hasFormat() and formats().
See also data().
*/
func (this *QMimeData) RetrieveData(mimetype string, preferredType int) *QVariant /*123*/ {
var tmpArg0 = NewQString5(mimetype)
var convArg0 = tmpArg0.GetCthis()
rv, err := qtrt.InvokeQtFunc6("_ZNK9QMimeData12retrieveDataERK7QStringN8QVariant4TypeE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, preferredType)
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQVariantFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2 /*==*/, DeleteQVariant)
return rv2
}
// body block end
// keep block begin
func init_unused_10483() {
if false {
reflect.TypeOf(123)
}
if false {
reflect.TypeOf(unsafe.Sizeof(0))
}
if false {
fmt.Println(123)
}
if false {
log.Println(123)
}
if false {
qtrt.KeepMe()
}
}
// keep block end