Mercurial > projects > qtd
annotate generator/typesystem_gui-java.java @ 367:f69341b40588
Removed dependencies on qtd.Traits
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Thu, 24 Jun 2010 13:47:30 +0300 |
parents | 12cec2d14e1c |
children | a032df77b6ab |
rev | line source |
---|---|
71 | 1 /**************************************************************************** |
2 ** | |
3 ** Copyright (C) 1992-2008 Nokia. All rights reserved. | |
4 ** | |
5 ** This file is part of Qt Jambi. | |
6 ** | |
7 ** * Commercial Usage | |
8 * Licensees holding valid Qt Commercial licenses may use this file in | |
9 * accordance with the Qt Commercial License Agreement provided with the | |
10 * Software or, alternatively, in accordance with the terms contained in | |
11 * a written agreement between you and Nokia. | |
12 * | |
13 * | |
14 * GNU General Public License Usage | |
15 * Alternatively, this file may be used under the terms of the GNU | |
16 * General Public License versions 2.0 or 3.0 as published by the Free | |
17 * Software Foundation and appearing in the file LICENSE.GPL included in | |
18 * the packaging of this file. Please review the following information | |
19 * to ensure GNU General Public Licensing requirements will be met: | |
20 * http://www.fsf.org/licensing/licenses/info/GPLv2.html and | |
21 * http://www.gnu.org/copyleft/gpl.html. In addition, as a special | |
22 * exception, Nokia gives you certain additional rights. These rights | |
23 * are described in the Nokia Qt GPL Exception version 1.2, included in | |
24 * the file GPL_EXCEPTION.txt in this package. | |
25 * | |
26 * Qt for Windows(R) Licensees | |
27 * As a special exception, Nokia, as the sole copyright holder for Qt | |
28 * Designer, grants users of the Qt/Eclipse Integration plug-in the | |
29 * right for the Qt/Eclipse Integration to link to functionality | |
30 * provided by Qt Designer and its related libraries. | |
31 * | |
32 * | |
33 * If you are unsure which license is appropriate for your use, please | |
34 * contact the sales department at qt-sales@nokia.com. | |
35 | |
36 ** | |
37 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | |
38 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
39 ** | |
40 ****************************************************************************/ | |
41 | |
42 package generator; | |
43 | |
44 import qt.QNativePointer; | |
45 import qt.QtBlockedSlot; | |
46 import qt.core.QPoint; | |
47 import qt.core.QPointF; | |
48 import qt.gui.*; | |
49 | |
50 class QIconEngineV2___ extends QIconEngineV2 { | |
51 public QIconEngineV2 clone() { | |
52 return null; | |
53 } | |
54 }// class | |
55 | |
56 class QTransform___ extends QTransform { | |
57 | |
58 public final QTransform multiply(double d) { | |
59 operator_multiply_assign(d); | |
60 return this; | |
61 } | |
62 | |
63 public final QTransform multiply(QTransform matrix) { | |
64 operator_multiply_assign(matrix); | |
65 return this; | |
66 } | |
67 | |
68 public final QTransform add(double d) { | |
69 operator_add_assign(d); | |
70 return this; | |
71 } | |
72 | |
73 public final QTransform divide(double d) { | |
74 operator_divide_assign(d); | |
75 return this; | |
76 } | |
77 | |
78 public final QTransform subtract(double d) { | |
79 operator_subtract_assign(d); | |
80 return this; | |
81 } | |
82 | |
83 /** | |
84 * Returns an inverted copy of this transformation. | |
85 * | |
86 * @return The inverse of the transformation. | |
87 * @throws IllegalArgumentException | |
88 * If this transformation is not invertible. | |
89 */ | |
90 /* public final QTransform inverted() { | |
91 QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean); | |
92 QTransform returned = inverted(ok); | |
93 if (!ok.booleanValue()) | |
94 throw new IllegalArgumentException("Transformation is not invertible"); | |
95 return returned; | |
96 } | |
97 */ | |
98 /** | |
99 * Creates a transformation mapping one arbitrary quad into another. | |
100 * | |
101 * @return The transformation. | |
102 * @throws IllegalArgumentException | |
103 * If this transformation is not possible. | |
104 */ | |
105 /* public static final QTransform quadToQuad(QPolygonF from, QPolygonF to) { | |
106 QTransform res = new QTransform(); | |
107 QNativePointer resPointer = res.nativePointer(); | |
108 if (quadToQuadPrivate(from, to, resPointer)) { | |
109 return res; | |
110 } else | |
111 throw new IllegalArgumentException("Transformation is not possible"); | |
112 } | |
113 */ | |
114 /** | |
115 * Creates a transformation that maps a quad to a unit square. | |
116 * | |
117 * @return The transformation. | |
118 * @throws IllegalArgumentException If this transformation is not possible. | |
119 */ | |
120 /* public static final QTransform quadToSquare(QPolygonF quad) { | |
121 QTransform res = new QTransform(); | |
122 QNativePointer resPointer = res.nativePointer(); | |
123 if (quadToSquarePrivate(quad, resPointer)) { | |
124 return res; | |
125 } else | |
126 throw new IllegalArgumentException("Transformation is not possible"); | |
127 } | |
128 */ | |
129 /** | |
130 * Creates a transformation that maps a unit square to a the given quad. | |
131 * | |
132 * @return The transformation. | |
133 * @throws IllegalArgumentException | |
134 * If this transformation is not possible. | |
135 */ | |
136 /* public static final QTransform squareToQuad(QPolygonF quad) { | |
137 QTransform res = new QTransform(); | |
138 QNativePointer resPointer = res.nativePointer(); | |
139 if (squareToQuadPrivate(quad, resPointer)) { | |
140 return res; | |
141 } else | |
142 throw new IllegalArgumentException("Transformation is not possible"); | |
143 } | |
144 */ | |
145 }// class | |
146 | |
147 class QBitmap___ extends QBitmap { | |
148 /* | |
149 public QBitmap(String fileName, String format) { | |
150 this(fileName, format == null ? null : qt.QNativePointer.createCharPointer(format)); | |
151 } | |
152 | |
153 public QBitmap(String fileName) { | |
154 this(fileName, (String) null); | |
155 } | |
156 | |
157 public static QBitmap fromData(qt.core.QSize size, byte bits[], QImage.Format monoFormat) { | |
158 return fromData(size, qt.internal.QtJambiInternal.byteArrayToNativePointer(bits), monoFormat); | |
159 } | |
160 | |
161 public static QBitmap fromData(qt.core.QSize size, byte bits[]) { | |
162 return fromData(size, bits, QImage.Format.Format_MonoLSB); | |
163 } | |
164 */ | |
165 }// class | |
166 | |
167 class QPolygon___ extends QPolygon { | |
168 /* | |
169 private native void add_private(long nid, int x, int y); | |
170 | |
171 @QtBlockedSlot | |
172 public final QPolygon add(int x, int y) { | |
254 | 173 add_private(__nativeId(), x, y); |
71 | 174 return this; |
175 } | |
176 | |
177 @QtBlockedSlot | |
178 public final QPolygon add(QPoint pt) { | |
254 | 179 add_private(__nativeId(), pt.x(), pt.y()); |
71 | 180 return this; |
181 } | |
182 | |
183 @QtBlockedSlot | |
184 public final QPolygon add(QPolygon p) { | |
185 int size = p.size(); | |
254 | 186 long nid = __nativeId(); |
71 | 187 for (int i = 0; i < size; ++i) { |
188 QPoint pt = p.at(i); | |
189 add_private(nid, pt.x(), pt.y()); | |
190 } | |
191 return this; | |
192 } | |
193 */ | |
194 }// class | |
195 | |
196 class QPolygonF___ extends QPolygonF { | |
197 /* | |
198 private native void add_private(long nid, double x, double y); | |
199 | |
200 @QtBlockedSlot | |
201 public final QPolygonF add(double x, double y) { | |
254 | 202 add_private(__nativeId(), x, y); |
71 | 203 return this; |
204 } | |
205 | |
206 @QtBlockedSlot | |
207 public final QPolygonF add(QPointF pt) { | |
254 | 208 add_private(__nativeId(), pt.x(), pt.y()); |
71 | 209 return this; |
210 } | |
211 | |
212 @QtBlockedSlot | |
213 public final QPolygonF add(QPolygonF p) { | |
214 int size = p.size(); | |
254 | 215 long nid = __nativeId(); |
71 | 216 for (int i = 0; i < size; ++i) { |
217 QPointF pt = p.at(i); | |
218 add_private(nid, pt.x(), pt.y()); | |
219 } | |
220 return this; | |
221 } | |
222 */ | |
223 }// class | |
224 | |
225 class QTreeWidgetItemIterator___ extends QTreeWidgetItemIterator { | |
226 public final QTreeWidgetItemIterator opAddAssign(int i) { | |
227 return operator_add_assign(i); | |
228 } | |
229 | |
230 public final QTreeWidgetItemIterator opSubAssign(int i) { | |
231 return operator_subtract_assign(i); | |
232 } | |
233 | |
234 public final QTreeWidgetItemIterator next() { | |
235 return operator_increment(); | |
236 } | |
237 | |
238 public final QTreeWidgetItemIterator previous() { | |
239 return operator_decrement(); | |
240 } | |
241 | |
242 public final QTreeWidgetItem current() { | |
243 return operator_multiply(); | |
244 } | |
245 }// class | |
246 | |
247 class QTextCursor___ extends QTextCursor { | |
248 /* public final QTableArea selectedTableCells() { | |
249 QNativePointer firstRow = new QNativePointer(QNativePointer.Type.Int); | |
250 QNativePointer numRows = new QNativePointer(QNativePointer.Type.Int); | |
251 QNativePointer firstColumn = new QNativePointer(QNativePointer.Type.Int); | |
252 QNativePointer numColumns = new QNativePointer(QNativePointer.Type.Int); | |
253 | |
254 selectedTableCells(firstRow, numRows, firstColumn, numColumns); | |
255 | |
256 return new QTableArea(firstRow.intValue(), firstColumn.intValue(), numRows.intValue(), numColumns.intValue()); | |
257 }*/ | |
258 }// class | |
259 | |
260 class QComboBox___ extends QComboBox { | |
261 | |
262 }// class | |
263 | |
264 class QMatrix___ extends QMatrix { | |
265 /** | |
266 * Returns an inverted copy of this matrix. | |
267 * | |
268 * @return The inverse of the matrix. | |
269 * @throws IllegalArgumentException | |
270 * If this matrix is not invertible. | |
271 */ | |
272 /* public final QMatrix inverted() { | |
273 QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean); | |
274 QMatrix returned = inverted(ok); | |
275 if (!ok.booleanValue()) | |
276 throw new IllegalArgumentException("Matrix is not invertible"); | |
277 return returned; | |
278 } | |
279 | |
280 @QtBlockedSlot | |
281 public final QMatrix multiply(QMatrix other) { | |
282 operator_multiply_assign(other); | |
283 return this; | |
284 } | |
285 | |
286 @QtBlockedSlot | |
287 public final QMatrix multiplied(QMatrix other) { | |
288 return operator_multiply(other); | |
289 } | |
290 */ | |
291 }// class | |
292 | |
293 class QImage___ extends QImage { | |
356 | 294 private import qtd.String; |
71 | 295 |
190 | 296 public this(string[] xpm) { |
71 | 297 this(toStringzArray(xpm)); |
298 } | |
299 /* | |
300 public final byte[] copyOfBytes() { | |
301 QNativePointer bits = bits(); | |
302 byte bytes[] = new byte[numBytes()]; | |
303 for (int i = 0; i < bytes.length; ++i) | |
304 bytes[i] = bits.byteAt(i); | |
305 return bytes; | |
306 } | |
307 */ | |
308 public this(ubyte[] data, int width, int height, Format format) { | |
309 this(data.ptr, width, height, format); | |
310 } | |
311 | |
312 public this(string fileName, string format = null) { | |
313 this(fileName, format == null ? null : toStringz(format)); | |
314 } | |
315 }// class | |
316 | |
317 class QPen___ extends QPen { | |
318 /* | |
319 public QPen(QColor color, double width, qt.core.Qt.PenStyle s, qt.core.Qt.PenCapStyle c, qt.core.Qt.PenJoinStyle j) { | |
320 this(new QBrush(color), width, s, c, j); | |
321 } | |
322 | |
323 public QPen(QColor color, double width, qt.core.Qt.PenStyle s, qt.core.Qt.PenCapStyle c) { | |
324 this(new QBrush(color), width, s, c); | |
325 } | |
326 | |
327 public QPen(QColor color, double width, qt.core.Qt.PenStyle s) { | |
328 this(new QBrush(color), width, s); | |
329 } | |
330 | |
331 public QPen(QColor color, double width) { | |
332 this(new QBrush(color), width); | |
333 } | |
334 | |
335 public static final QPen NoPen = new QPen(qt.core.Qt.PenStyle.NoPen); | |
336 */ | |
337 }// class | |
338 | |
339 class QColor___ extends QColor { | |
340 static this() { | |
341 White = new QColor(Qt.GlobalColor.white); | |
342 Black = new QColor(Qt.GlobalColor.black); | |
343 Red = new QColor(Qt.GlobalColor.red); | |
344 DarkRed = new QColor(Qt.GlobalColor.darkRed); | |
345 Green = new QColor(Qt.GlobalColor.green); | |
346 DarkGreen = new QColor(Qt.GlobalColor.darkGreen); | |
347 Blue = new QColor(Qt.GlobalColor.blue); | |
348 DarkBlue = new QColor(Qt.GlobalColor.darkBlue); | |
349 Cyan = new QColor(Qt.GlobalColor.cyan); | |
350 DarkCyan = new QColor(Qt.GlobalColor.darkCyan); | |
351 Magenta = new QColor(Qt.GlobalColor.magenta); | |
352 DarkMagenta = new QColor(Qt.GlobalColor.darkMagenta); | |
353 Yellow = new QColor(Qt.GlobalColor.yellow); | |
354 DarkYellow = new QColor(Qt.GlobalColor.darkYellow); | |
355 Gray = new QColor(Qt.GlobalColor.gray); | |
356 DarkGray = new QColor(Qt.GlobalColor.darkGray); | |
357 LightGray = new QColor(Qt.GlobalColor.lightGray); | |
358 Transparent = new QColor(Qt.GlobalColor.transparent); | |
359 Color0 = new QColor(Qt.GlobalColor.color0); | |
360 Color1 = new QColor(Qt.GlobalColor.color1); | |
361 } | |
362 | |
363 public static const QColor White; | |
364 public static const QColor Black; | |
365 public static const QColor Red; | |
366 public static const QColor DarkRed; | |
367 public static const QColor Green; | |
368 public static const QColor DarkGreen; | |
369 public static const QColor Blue; | |
370 public static const QColor DarkBlue; | |
371 public static const QColor Cyan; | |
372 public static const QColor DarkCyan; | |
373 public static const QColor Magenta; | |
374 public static const QColor DarkMagenta; | |
375 public static const QColor Yellow; | |
376 public static const QColor DarkYellow; | |
377 public static const QColor Gray; | |
378 public static const QColor DarkGray; | |
379 public static const QColor LightGray; | |
380 public static const QColor Transparent; | |
381 public static const QColor Color0; | |
382 public static const QColor Color1; | |
383 | |
384 }// class | |
385 | |
386 class QTextLine___ extends QTextLine { | |
387 | |
388 public final void draw(QPainter painter, QPointF position) { | |
389 draw(painter, position, null); | |
390 } | |
391 | |
392 }// class | |
393 | |
394 class QKeySequence___ extends QKeySequence { | |
395 /* | |
396 @QtBlockedSlot | |
397 public final int toInt() { | |
398 return operator_cast_int(); | |
399 } | |
400 | |
401 @QtBlockedSlot | |
402 public final int at(int i) { | |
403 return operator_subscript(i); | |
404 } | |
405 */ | |
406 }// class | |
407 | |
408 class QPicture___ extends QPicture { | |
409 /* | |
410 public final boolean load(QIODevice dev) { | |
411 return load(dev, (QNativePointer) null); | |
412 } | |
413 | |
414 public final boolean load(String fileName) { | |
415 return load(fileName, (qt.QNativePointer) null); | |
416 } | |
417 | |
418 public final boolean save(QIODevice dev) { | |
419 return save(dev, (qt.QNativePointer) null); | |
420 } | |
421 | |
422 public final boolean save(String fileName) { | |
423 return save(fileName, (qt.QNativePointer) null); | |
424 } | |
425 | |
426 public final byte[] data() { | |
427 QNativePointer npData = data_private(); | |
428 if (npData == null) | |
429 return null; | |
430 byte returned[] = new byte[size()]; | |
431 for (int i = 0; i < returned.length; ++i) | |
432 returned[i] = npData.byteAt(i); | |
433 return returned; | |
434 } | |
435 */ | |
436 }// class | |
437 | |
438 class QRegion___ extends QRegion { | |
439 /* | |
440 public void setRects(qt.core.QRect[] rects) { | |
441 setRects(qt.core.QRect.nativePointerArray(rects), rects.length); | |
442 } | |
443 */ | |
444 }// class | |
445 | |
446 class QPolygon___ extends QPolygon { | |
447 | |
448 }// class | |
449 | |
450 class QPolygonF___ extends QPolygonF { | |
451 | |
452 }// class | |
453 | |
454 class QTextFrame_iterator___ extends QTextFrame_iterator { | |
455 | |
456 public final void opPostInc() { | |
457 operator_increment(); | |
458 } | |
459 | |
460 public final void opPostDec() { | |
461 operator_decrement(); | |
462 } | |
463 | |
464 }// class | |
465 | |
466 class QTextBlock_iterator___ extends QTextBlock_iterator { | |
467 | |
468 public final void opPostInc() { | |
469 operator_increment(); | |
470 } | |
471 | |
472 public final void opPostDec() { | |
473 operator_decrement(); | |
474 } | |
475 | |
476 }// class | |
477 | |
478 class QPixmap___ extends QPixmap { | |
479 | |
356 | 480 private import qtd.String; |
71 | 481 |
190 | 482 public this(string[] xpm) { |
71 | 483 this(toStringzArray(xpm)); |
484 } | |
485 | |
486 public this(string fileName, string format = null, int flags = Qt.ImageConversionFlag.AutoColor) { | |
487 this(fileName, toStringz(format), flags); | |
488 } | |
489 | |
490 /* | |
491 public this(string fileName, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | |
492 this(fileName, toStringz(format), flags); | |
493 } | |
494 */ | |
495 | |
496 public final bool load(string fileName, string format, int flags = Qt.ImageConversionFlag.AutoColor) { | |
497 return load(fileName, toStringz(format), flags); | |
498 } | |
499 /* | |
500 public final bool load(string fileName, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | |
501 return load(fileName, toStringz(format), flags); | |
502 } | |
503 */ | |
504 /* | |
505 public final bool loadFromData(ubyte[] data, string format, int flags = Qt.ImageConversionFlag.AutoColor) { | |
506 return loadFromData(data.ptr, data.length, toStringz(format), flags); | |
507 } | |
508 | |
509 public final bool loadFromData(ubyte[] data, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | |
510 return loadFromData(qdata.ptr, data.length, toStringz(format), flags); | |
511 } | |
512 */ | |
513 | |
514 public final bool loadFromData(QByteArray data, string format, int flags = Qt.ImageConversionFlag.AutoColor) { | |
515 return loadFromData(data, toStringz(format), flags); | |
516 } | |
517 | |
518 /* public final bool loadFromData(QByteArray data, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | |
519 return loadFromData(data, toStringz(format), flags); | |
520 } | |
521 */ | |
522 | |
523 public final bool save(string fileName, string format, int quality = -1) { | |
524 return private_save(fileName, toStringz(format), quality); | |
525 } | |
526 | |
527 public final bool save(QIODevice dev, string format, int quality = -1) { | |
528 return private_save(dev, toStringz(format), quality); | |
529 } | |
530 }// class | |
531 | |
532 class QItemSelection___ extends QItemSelection { | |
533 | |
534 public static void split(QItemSelectionRange range, QItemSelectionRange other, QItemSelection result) { | |
535 qt.QNativePointer np = result.nativePointer(); | |
536 split(range, other, np); | |
537 } | |
538 | |
539 }// class | |
540 | |
541 class QPainterPath_Element___ extends QPainterPath_Element { | |
542 /* | |
543 @QtBlockedSlot | |
544 public final qt.core.QPointF toPoint() { | |
545 return operator_cast_QPointF(); | |
546 } | |
547 */ | |
548 }// class | |
549 | |
550 class QBrush___ extends QBrush { | |
551 /* | |
552 public static final QBrush NoBrush = new QBrush(qt.core.Qt.BrushStyle.NoBrush); | |
553 */ | |
554 }// class | |
555 | |
556 class QAbstractItemView___ extends QAbstractItemView { | |
557 | |
558 private QAbstractItemDelegate[int] __rcDelegatesForColumns; | |
559 private QAbstractItemDelegate[int] __rcDelegatesForRows; | |
560 | |
561 }// class | |
562 | |
563 class QAccessibleTableInterface___ extends QAccessibleTableInterface { | |
564 | |
565 public static class CellAtIndex extends QTableArea { | |
566 public CellAtIndex(int row, int column, int rowSpan, int columnSpan, boolean isSelected) { | |
567 super(row, column, rowSpan, columnSpan); | |
568 this.isSelected = isSelected; | |
569 } | |
570 | |
571 public boolean isSelected; | |
572 } | |
573 | |
574 }// class | |
575 | |
576 class QAccessibleInterface___ extends QAccessibleInterface { | |
577 | |
578 public static class Target { | |
579 public Target(int childIndex, QAccessibleInterface target) { | |
580 this.childIndex = childIndex; | |
581 this.target = target; | |
582 } | |
583 | |
584 public QAccessibleInterface target; | |
585 public int childIndex; | |
586 } | |
587 | |
588 }// class | |
589 | |
590 class QDesktopServices___ extends QDesktopServices { | |
225 | 591 /* |
149 | 592 private static UrlHandler[string] __rcUrlHandlers; |
593 public static void setUrlHandler(string scheme, void delegate(QUrl) dg) { | |
594 UrlHandler receiver = dg !is null ? new UrlHandler(dg) : null; | |
71 | 595 |
149 | 596 if (receiver is null) |
71 | 597 __rcUrlHandlers.remove(scheme); |
598 else | |
149 | 599 __rcUrlHandlers[scheme] = receiver; |
600 | |
601 setUrlHandler(scheme, receiver, "handleUrl"); | |
225 | 602 }*/ |
71 | 603 }// class |
604 | |
605 class QWizardPage___ extends QWizardPage { | |
606 | |
607 protected final void registerField(string name, QWidget widget, string property = null) { | |
608 registerField(name, widget, property is null ? null : toStringz(property), null); | |
609 } | |
610 | |
611 /** | |
612 * Creates a field called <code>name</code> associated with the given | |
613 * property of the given widget. From then on, that property becomes | |
614 * accessible using <code>field()</code> and <code>setField()</code>. | |
615 * Fields are global to the entire wizard and make it easy for any single | |
616 * page to access information stored by another page, without having to put | |
617 * all the logic in <code>QWizard</code> or having the pages know | |
618 * explicitly about each other. If name ends with an asterisk (*), the field | |
619 * is a mandatory field. When a page has mandatory fields, the Next and/or | |
620 * Finish buttons are enabled only when all mandatory fields are filled. | |
621 * This requires a <code>changedSignal</code> to be specified, to tell | |
622 * QWizard to recheck the value stored by the mandatory field. | |
623 * | |
624 * QWizard knows the most common Qt widgets. For these (or their | |
625 * subclasses), you don't need to specify a <code>property</code> or a | |
626 * <code>changedSignal</code>. The table below lists these widgets: | |
627 * | |
628 * <code>QAbstractButton</code> (for which the relevant property is the | |
629 * <code>checked</code> property), <code>QAbstractSlider</code> (the | |
630 * <code>value</code> property), <code>QComboBox</code> (<code>currentIndex</code> | |
631 * property), <code>QDateTimeEdit</code>(<code>dateTime</code> | |
632 * property), <code>QLineEdit</code>(<code>text</code> property), | |
633 * <code>QListWidget</code>(<code>currentRow</code> property), or | |
634 * <code>QSpinBox</code>(<code>value</code> property). | |
635 * | |
636 * @param name | |
637 * The name which will be used to access the field. Names ending | |
638 * with an asterisk signify mandatory fields. | |
639 * @param widget | |
640 * The widget whose property will be accessed using this field. | |
641 * @param property | |
642 * The name of the property associated with the field. | |
643 * @param changedSignal | |
644 * The name of a signal which is emitted when the associated | |
645 * property's value changes. | |
646 * | |
647 * @see qt.gui.QWizardPage#field | |
648 * @see qt.gui.QWizardPage#setField | |
649 */ | |
650 /* protected final void registerField(String name, QWidget widget, String property, String changedSignal) { | |
651 String signalSignature = qt.internal.MetaObjectTools.cppSignalSignature(widget, changedSignal); | |
652 if (signalSignature.length() == 0) | |
653 throw new QNoSuchSignalException("Signal '" + changedSignal | |
654 + "' does not exist or has argument types that cannot be converted to Qt Jambi or java.lang types."); | |
655 registerField(name, widget, qt.QNativePointer.createCharPointer(property), qt.QNativePointer | |
656 .createCharPointer(qt.internal.QtJambiInternal.SignalPrefix + signalSignature)); | |
657 } | |
658 */ | |
659 }// class | |
660 | |
661 class QFontDialog___ extends QFontDialog { | |
662 | |
663 public static final class Result { | |
664 public Result(QFont font, boolean ok) { | |
665 this.font = font; | |
666 this.ok = ok; | |
667 } | |
668 | |
669 public QFont font; | |
670 public boolean ok; | |
671 } | |
672 | |
673 }// class | |
674 | |
675 class QMenu___ extends QMenu { | |
676 /* | |
677 protected final void initStyleOption(qt.gui.QStyleOptionMenuItem option, QAction action) { | |
678 initStyleOption(option.nativePointer(), action); | |
679 } | |
680 */ | |
681 alias QWidget.addAction addAction; | |
682 }// class | |
683 | |
684 class QMenuBar___ extends QMenuBar { | |
685 alias QWidget.addAction addAction; | |
686 | |
687 }// class | |
688 | |
689 class QToolBar___ extends QToolBar { | |
690 /* | |
691 protected final void initStyleOption(qt.gui.QStyleOptionMenuItem option, QAction action) { | |
692 initStyleOption(option.nativePointer(), action); | |
693 } | |
694 */ | |
695 alias QWidget.addAction addAction; | |
696 }// class | |
697 | |
698 class QPixmapCache___ extends QPixmapCache { | |
699 | |
700 public static boolean find(String key, QPixmap pm) { | |
701 return find(key, pm.nativePointer()); | |
702 } | |
703 | |
704 }// class | |
705 | |
706 class QShortcut___ extends QShortcut { | |
707 | |
708 public this(QKeySequence key, QWidget parent, Qt.ShortcutContext context = Qt.WindowShortcut) { | |
709 this(key, parent, null, null, context); | |
710 } | |
711 | |
712 }// class | |
713 | |
714 class QValidator___ extends QValidator { | |
715 | |
716 public static class QValidationData { | |
717 public QValidationData(String input, int pos) { | |
718 string = input; | |
719 position = pos; | |
720 } | |
721 | |
722 public String string; | |
723 public int position; | |
724 } | |
725 | |
726 }// class | |
727 | |
728 class QAbstractButton___ extends QAbstractButton { | |
729 | |
730 /** | |
731 * Sets the shortcut to the key sequence for the given key string. For | |
732 * example "Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and | |
733 * "Meta" are recognized, as well as their translated equivalents in the | |
734 * "QShortcut" context (using QObject::tr()). Up to four key codes may be | |
735 * entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q". | |
736 * | |
737 * @param key | |
738 * The description of the key sequence. Typically used with tr() | |
739 * so key sequences can be locale aware. | |
740 */ | |
741 public final void setShortcut(string key) { | |
742 setShortcut(new QKeySequence(key)); | |
743 } | |
744 | |
745 /** | |
746 * Sets the shortcut to the key sequence for the given key. The result will | |
747 * depend on the currently running platform. The key sequence will be based | |
748 * on the first element in the list of key bindings for the key. | |
749 * | |
750 * @param key | |
751 * The key for which to select a key sequence | |
752 */ | |
753 public final void setShortcut(QKeySequence.StandardKey key) { | |
754 setShortcut(new QKeySequence(key)); | |
755 } | |
756 | |
757 }// class | |
758 | |
759 class QStyle___ extends QStyle { | |
760 /* | |
761 @QtBlockedSlot | |
762 public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2, | |
763 qt.core.Qt.Orientation orientation, QStyleOption option, QWidget widget) { | |
764 return combinedLayoutSpacing(controls1, controls2, orientation, option == null ? null : option.nativePointer(), widget); | |
765 } | |
766 | |
767 @QtBlockedSlot | |
768 public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2, | |
769 qt.core.Qt.Orientation orientation, QStyleOption option) { | |
770 return combinedLayoutSpacing(controls1, controls2, orientation, option, null); | |
771 } | |
772 | |
773 @QtBlockedSlot | |
774 public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2, | |
775 qt.core.Qt.Orientation orientation) { | |
776 return combinedLayoutSpacing(controls1, controls2, orientation, null); | |
777 } | |
778 | |
779 @QtBlockedSlot | |
780 public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation, | |
781 QStyleOption option, QWidget widget) { | |
782 return layoutSpacing(control1, control2, orientation, option == null ? null : option.nativePointer(), widget); | |
783 } | |
784 | |
785 @QtBlockedSlot | |
786 public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation, | |
787 QStyleOption option) { | |
788 return layoutSpacing(control1, control2, orientation, option, null); | |
789 } | |
790 | |
791 @QtBlockedSlot | |
792 public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation) { | |
793 return layoutSpacing(control1, control2, orientation, null); | |
794 } | |
795 */ | |
796 }// class | |
797 | |
798 class QLayout___ extends QLayout { | |
799 /* | |
800 @QtBlockedSlot | |
801 public final QContentsMargins getContentsMargins() { | |
802 QNativePointer left = new QNativePointer(QNativePointer.Type.Int); | |
803 QNativePointer top = new QNativePointer(QNativePointer.Type.Int); | |
804 QNativePointer right = new QNativePointer(QNativePointer.Type.Int); | |
805 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Int); | |
806 | |
807 getContentsMargins(left, top, right, bottom); | |
808 return new QContentsMargins(left.intValue(), top.intValue(), right.intValue(), bottom.intValue()); | |
809 } | |
810 | |
811 @QtBlockedSlot | |
812 public final void setContentsMargins(QContentsMargins margins) { | |
813 setContentsMargins(margins.left, margins.top, margins.right, margins.bottom); | |
814 } | |
815 */ | |
816 }// class | |
817 | |
818 class QGridLayout___ extends QGridLayout { | |
819 /* | |
820 public final QTableArea getItemPosition(int index) { | |
821 QNativePointer row = new QNativePointer(QNativePointer.Type.Int); | |
822 QNativePointer column = new QNativePointer(QNativePointer.Type.Int); | |
823 QNativePointer rowSpan = new QNativePointer(QNativePointer.Type.Int); | |
824 QNativePointer columnSpan = new QNativePointer(QNativePointer.Type.Int); | |
825 | |
826 getItemPosition(index, row, column, rowSpan, columnSpan); | |
827 | |
828 return new QTableArea(row.intValue(), column.intValue(), rowSpan.intValue(), columnSpan.intValue()); | |
829 } | |
830 */ | |
831 }// class | |
832 | |
833 class QWidget___ extends QWidget { | |
834 /* | |
835 private native static void __qt_QMessageBox_setWindowTitle(long native_id, String windowTitle); | |
836 | |
837 private native static void __qt_QMessageBox_setWindowModality(long native_id, int modality); | |
838 | |
839 @QtBlockedSlot | |
840 public final QContentsMargins getContentsMargins() { | |
841 QNativePointer left = new QNativePointer(QNativePointer.Type.Int); | |
842 QNativePointer top = new QNativePointer(QNativePointer.Type.Int); | |
843 QNativePointer right = new QNativePointer(QNativePointer.Type.Int); | |
844 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Int); | |
845 | |
846 getContentsMargins(left, top, right, bottom); | |
847 return new QContentsMargins(left.intValue(), top.intValue(), right.intValue(), bottom.intValue()); | |
848 } | |
849 | |
850 @QtBlockedSlot | |
851 public final void setContentsMargins(QContentsMargins margins) { | |
852 setContentsMargins(margins.left, margins.top, margins.right, margins.bottom); | |
853 } | |
854 */ | |
855 }// class | |
856 | |
857 class QFileDialog___ extends QFileDialog { | |
858 | |
859 public static string getOpenFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) { | |
860 string res; | |
861 string _selectedFilter = ""; | |
254 | 862 qtd_QFileDialog_getOpenFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.__nativeId, caption, dir, filter, _selectedFilter, 0); |
71 | 863 return res; |
864 } | |
865 | |
866 public static string getSaveFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) { | |
867 string res; | |
868 string _selectedFilter = ""; | |
254 | 869 qtd_QFileDialog_getSaveFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.__nativeId, caption, dir, filter, _selectedFilter, 0); |
71 | 870 return res; |
871 } | |
872 | |
873 public static class Filter { | |
874 public this(string filter) { | |
875 this.filter = filter; | |
876 } | |
877 | |
878 public string filter; | |
879 public string selectedFilter = ""; | |
880 } | |
881 | |
882 }// class | |
883 | |
884 class QTabBar___ extends QTabBar { | |
885 | |
886 public final void initStyleOption(QStyleOptionTab option, int tabIndex) { | |
887 initStyleOption(option.nativePointer(), tabIndex); | |
888 } | |
889 | |
890 }// class | |
891 | |
892 class QClipboard___ extends QClipboard { | |
893 /* | |
894 public static class Text { | |
895 public String text; | |
896 public String subtype; | |
897 } | |
898 | |
899 public final Text text(String subtype, Mode mode) { | |
900 QNativePointer np = new QNativePointer(QNativePointer.Type.String); | |
901 np.setStringValue(subtype != null ? subtype : ""); | |
902 | |
903 Text returned = new Text(); | |
904 returned.text = text(np, mode); | |
905 returned.subtype = np.stringValue(); | |
906 return returned; | |
907 } | |
908 | |
909 public final Text text(String subtype) { | |
910 return text(subtype, Mode.Clipboard); | |
911 } | |
912 */ | |
913 }// class | |
914 | |
915 class QAbstractScrollArea___ extends QAbstractScrollArea { | |
916 /* | |
917 public QPaintEngine paintEngine() { | |
918 throw new RuntimeException("Cannot open a painter directly on a QAbstractScrollArea, open QPainter on its viewport instead..."); | |
919 } | |
920 */ | |
921 }// class | |
922 | |
923 class QTextDocument___ extends QTextDocument { | |
924 | |
925 public final void redo(QTextCursor cursor) { | |
926 redo(cursor.nativePointer()); | |
927 } | |
928 | |
929 public final void undo(QTextCursor cursor) { | |
930 undo(cursor.nativePointer()); | |
931 } | |
932 | |
933 }// class | |
934 | |
935 class QSplitter___ extends QSplitter { | |
936 | |
937 public struct Range { | |
346 | 938 public static Range opCall(int min, int max) { |
71 | 939 Range rng; |
346 | 940 rng.minimum = min; |
71 | 941 rng.maximum = max; |
346 | 942 return rng; |
71 | 943 } |
944 | |
945 public int minimum; | |
946 public int maximum; | |
947 } | |
948 | |
949 public final Range getRange(int index) { | |
346 | 950 Range range; |
951 getRange(index, &range.minimum, &range.maximum); | |
952 return range; | |
71 | 953 } |
954 | |
955 }// class | |
956 | |
957 class QAction___ extends QAction { | |
958 | |
959 public final void setShortcut(string key) { | |
960 setShortcut(new QKeySequence(key)); | |
961 } | |
962 /* | |
963 private QActionGroup __rcActionGroup = null; | |
964 */ | |
965 /** | |
966 * Sets the shortcut to the key sequence for the given key string. For | |
967 * example "Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and | |
968 * "Meta" are recognized, as well as their translated equivalents in the | |
969 * "QShortcut" context (using QObject::tr()). Up to four key codes may be | |
970 * entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q". | |
971 * | |
972 * @param key | |
973 * The description of the key sequence. Typically used with tr() | |
974 * so key sequences can be locale aware. | |
975 */ | |
976 /* public final void setShortcut(String key) { | |
977 setShortcut(new QKeySequence(key)); | |
978 } | |
979 */ | |
980 /** | |
981 * Sets the shortcut to the key sequence for the given key. The result will | |
982 * depend on the currently running platform. The key sequence will be based | |
983 * on the first element in the list of key bindings for the key. | |
984 * | |
985 * @param key | |
986 * The key for which to select a key sequence | |
987 */ | |
988 /* public final void setShortcut(QKeySequence.StandardKey key) { | |
989 setShortcut(new QKeySequence(key)); | |
990 } | |
991 | |
992 public final void setIcon(QPixmap pm) { | |
993 setIcon(new QIcon(pm)); | |
994 } | |
995 */ | |
996 }// class | |
997 | |
998 class QPainter___ extends QPainter { | |
999 | |
1000 public final void setBrush(QColor color) { | |
1001 setBrush(new QBrush(color)); | |
1002 } | |
1003 | |
1004 public final void setBrush(QGradient gradient) { | |
1005 setBrush(new QBrush(gradient)); | |
1006 } | |
1007 | |
1008 public final void setBrush(QPixmap pm) { | |
1009 setBrush(new QBrush(pm)); | |
1010 } | |
1011 | |
192 | 1012 public final void drawConvexPolygon(in QPoint[] points) { |
254 | 1013 qtd_QPainter_drawConvexPolygon_nativepointerQPoint_int(__nativeId, points.ptr, points.length); |
71 | 1014 } |
1015 | |
192 | 1016 public final void drawConvexPolygon(in QPointF[] points) { |
254 | 1017 qtd_QPainter_drawConvexPolygon_nativepointerQPointF_int(__nativeId, points.ptr, points.length); |
71 | 1018 } |
1019 | |
192 | 1020 public final void drawLines(in QLine[] lines) { |
254 | 1021 qtd_QPainter_drawLines_nativepointerQLine_int(__nativeId, lines.ptr, lines.length); |
71 | 1022 } |
1023 | |
192 | 1024 public final void drawLines(in QLineF[] lines) { |
254 | 1025 qtd_QPainter_drawLines_nativepointerQLineF_int(__nativeId, lines.ptr, lines.length); |
71 | 1026 } |
1027 | |
337 | 1028 public final void drawPolygon(in QPoint[] points, Qt.FillRule fillRule = Qt.FillRule.OddEvenFill) { |
254 | 1029 qtd_QPainter_drawPolygon_nativepointerQPoint_int_FillRule(__nativeId, points.ptr, points.length, fillRule); |
71 | 1030 } |
1031 | |
337 | 1032 public final void drawPolygon(in QPointF[] points, Qt.FillRule fillRule = Qt.FillRule.OddEvenFill) { |
254 | 1033 qtd_QPainter_drawPolygon_nativepointerQPointF_int_FillRule(__nativeId, points.ptr, points.length, fillRule); |
71 | 1034 } |
1035 | |
192 | 1036 public final void drawPolyline(in QPoint[] points) { |
254 | 1037 qtd_QPainter_drawPolyline_nativepointerQPoint_int(__nativeId, points.ptr, points.length); |
71 | 1038 } |
1039 | |
192 | 1040 public final void drawPolyline(in QPointF[] points) { |
254 | 1041 qtd_QPainter_drawPolyline_nativepointerQPointF_int(__nativeId, points.ptr, points.length); |
71 | 1042 } |
1043 | |
192 | 1044 public final void drawPoints(in QPoint[] points) { |
254 | 1045 qtd_QPainter_drawPoints_nativepointerQPoint_int(__nativeId, points.ptr, points.length); |
71 | 1046 } |
1047 | |
192 | 1048 public final void drawPoints(in QPointF[] points) { |
254 | 1049 qtd_QPainter_drawPoints_nativepointerQPointF_int(__nativeId, points.ptr, points.length); |
71 | 1050 } |
1051 | |
192 | 1052 public final void drawRects(in QRect[] rects) { |
254 | 1053 qtd_QPainter_drawRects_nativepointerQRect_int(__nativeId, rects.ptr, rects.length); |
71 | 1054 } |
1055 | |
192 | 1056 public final void drawRects(in QRectF[] rects) { |
254 | 1057 qtd_QPainter_drawRects_nativepointerQRectF_int(__nativeId, rects.ptr, rects.length); |
71 | 1058 } |
1059 /* | |
1060 public static QPaintDeviceInterface redirected(QPaintDeviceInterface device, qt.core.QPoint offset) { | |
1061 return redirected(device, offset == null ? null : offset.nativePointer()); | |
1062 } | |
1063 | |
1064 public QPainter(QWidget widget) { | |
1065 this(); | |
1066 begin(widget); | |
1067 } | |
1068 | |
1069 public boolean begin(QWidget widget) { // can't be final because of QStylePainter | |
1070 return qt.QtJambiGuiInternal.beginPaint(widget, this); | |
1071 } | |
1072 | |
1073 private static java.util.Stack<QPaintDeviceInterface> __rcRedirections = new java.util.Stack<QPaintDeviceInterface>(); | |
1074 */ | |
1075 }// class | |
1076 | |
1077 class QApplication___ extends QApplication { | |
1078 | |
188 | 1079 this(string[] args) |
71 | 1080 { |
1081 // if (m_instance != null) | |
1082 // throw new RuntimeException("QCoreApplication can only be initialized once"); | |
1083 | |
1084 argc = args.length; | |
1085 argv = toStringzArray(args); | |
1086 this(&argc, argv); | |
1087 | |
1088 // m_instance.aboutToQuit.connect(m_instance, "disposeOfMyself()"); | |
1089 } | |
1090 | |
1091 private int argc; | |
1092 private char **argv; | |
1093 | |
1094 /* public static QApplication instance() { | |
1095 if (type() != Type.Tty) | |
1096 return (QApplication) qt.core.QCoreApplication.instance(); | |
1097 return null; | |
1098 } | |
1099 | |
1100 public QApplication(String args[]) { | |
1101 this(argc(args), argv(args)); | |
154 | 1102 }*/ |
1103 | |
1104 public static void setFont(QFont font, string className = null) { | |
1105 setFont_private(font, className !is null ? toStringz(className) : null); | |
71 | 1106 } |
1107 | |
154 | 1108 public static void setPalette(QPalette palette, string className = null) { |
1109 setPalette_private(palette, className !is null ? toStringz(className) : null); | |
71 | 1110 } |
154 | 1111 /* |
71 | 1112 public static QCursor overrideCursor() { |
1113 QNativePointer np = overrideCursor_private(); | |
1114 return np == null ? null : QCursor.fromNativePointer(np); | |
1115 } | |
1116 */ | |
1117 }// class | |
1118 | |
1119 class QFormLayout___ extends QFormLayout { | |
1120 | |
1121 /** | |
1122 * Retrieves the row and role (column) of the item at the specified index. | |
1123 * If index is out of bounds, -1 is returned in place of the row. | |
1124 * | |
1125 * @param index The index of the item for which to retrieve the position. | |
1126 * @return A pair of an int (row of item) and an ItemRole (role of the item.) | |
1127 **/ | |
1128 /* @QtBlockedSlot | |
1129 public final qt.QPair<Integer, ItemRole> getItemPosition(int index) { | |
1130 qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1131 qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1132 | |
1133 getItemPosition(index, row, role); | |
1134 | |
1135 return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue())); | |
1136 } | |
1137 */ | |
1138 /** | |
1139 * Retrieves the row and role (column) of the specified child layout. | |
1140 * If the layout is not in the form layout, -1 is returned in place of the row. | |
1141 * | |
1142 * @param layout The layout for which to retrieve the position. | |
1143 * @return A pair of an int (row of item) and an ItemRole (role of the item.) | |
1144 */ | |
1145 /* @QtBlockedSlot | |
1146 public final qt.QPair<Integer, ItemRole> getLayoutPosition(QLayout layout) { | |
1147 qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1148 qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1149 | |
1150 getLayoutPosition(layout, row, role); | |
1151 | |
1152 return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue())); | |
1153 } | |
1154 */ | |
1155 /** | |
1156 * Retrieves the row and role (column) of the specified widget in the layout. | |
1157 * If the widget is not in the form layout, -1 is returned in place of the row. | |
1158 * | |
1159 * @param widget The widget for which to retrieve the position. | |
1160 * @return A pair of an int (row of item) and an ItemRole (role of the item.) | |
1161 */ | |
1162 /* @QtBlockedSlot | |
1163 public final qt.QPair<Integer, ItemRole> getWidgetPosition(QWidget widget) { | |
1164 qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1165 qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1166 | |
1167 getWidgetPosition(widget, row, role); | |
1168 | |
1169 return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue())); | |
1170 } | |
1171 */ | |
1172 /** | |
1173 * Sets the item in the given row for the given role to item, extending the layout with empty rows if necessary. | |
1174 * If the cell is already occupied, the item is not inserted and a IllegalArgumentException is thrown. | |
1175 */ | |
1176 /* @QtBlockedSlot | |
1177 public final void setItem(int row, ItemRole role, QLayoutItem item) { | |
1178 if (itemAt(row, role) == null) | |
1179 setItem_private(row, role, item); | |
1180 else | |
1181 throw new IllegalArgumentException("Cell in form layout is already occupied"); | |
1182 } | |
1183 */ | |
1184 }// class | |
1185 | |
1186 class Subclass_of_QGraphicsLayoutItem___ extends QGraphicsLayoutItem { | |
1187 /* | |
1188 @QtBlockedSlot | |
1189 public final QMarginsF getContentsMargins() { | |
1190 QNativePointer left = new QNativePointer(QNativePointer.Type.Double); | |
1191 QNativePointer top = new QNativePointer(QNativePointer.Type.Double); | |
1192 QNativePointer right = new QNativePointer(QNativePointer.Type.Double); | |
1193 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double); | |
1194 | |
1195 getContentsMargins(left, top, right, bottom); | |
1196 return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue()); | |
1197 }*/ | |
1198 }// class | |
1199 | |
1200 class QGraphicsWidget___ extends QGraphicsWidget { | |
1201 | |
1202 /* | |
1203 * Gets the widget's window frame margins. | |
1204 * | |
1205 * @returns An object containing the margins in left, right, top and bottom coordinates. | |
1206 | |
1207 @QtBlockedSlot | |
1208 public final QMarginsF getWindowFrameMargins() { | |
1209 QNativePointer left = new QNativePointer(QNativePointer.Type.Double); | |
1210 QNativePointer top = new QNativePointer(QNativePointer.Type.Double); | |
1211 QNativePointer right = new QNativePointer(QNativePointer.Type.Double); | |
1212 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double); | |
1213 | |
1214 getWindowFrameMargins(left, top, right, bottom); | |
1215 return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue()); | |
1216 } | |
1217 */ | |
1218 | |
1219 }// class | |
1220 | |
1221 class QPrinter___ extends QPrinter { | |
1222 | |
1223 /** | |
1224 * Returns the page margins for this printer. | |
1225 * The unit of the returned margins are specified with the unit parameter. | |
1226 * This function was introduced in Qt 4.4. | |
1227 * | |
1228 * @param unit Specifies the unit of the returned margins. | |
1229 * @return The page margins for this printer. | |
1230 */ | |
1231 /* public final QMarginsF getPageMargins(QPrinter.Unit unit) { | |
1232 QNativePointer left = new QNativePointer(QNativePointer.Type.Double); | |
1233 QNativePointer top = new QNativePointer(QNativePointer.Type.Double); | |
1234 QNativePointer right = new QNativePointer(QNativePointer.Type.Double); | |
1235 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double); | |
1236 | |
1237 getPageMargins(left, top, right, bottom, unit); | |
1238 return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue()); | |
1239 }*/ | |
1240 | |
1241 }// class | |
1242 | |
1243 class QListWidget___ extends QListWidget { | |
1244 | |
1245 /** | |
1246 * Inserts items with the text labels at the end of the list widget. | |
1247 * | |
1248 * @param labels The collection of labels for the new items. | |
1249 */ | |
1250 public final void addItems(string[] labels) { | |
1251 foreach (label; labels) | |
1252 addItem(label); | |
1253 } | |
1254 | |
1255 /** | |
1256 * This is an overloaded member function, provided for convenience. | |
1257 * Inserts an item with the text label in the list widget at the position given by row. | |
1258 * | |
1259 * @param row The position in which to insert the new item. | |
1260 * @param label The text of the new item. | |
1261 */ | |
1262 public final void insertItem(int row, string label) { | |
1263 insertItem(row, new QListWidgetItem(label, this)); | |
1264 } | |
1265 | |
1266 /** | |
1267 * Inserts items from the list of labels into the list, starting at the given row. | |
1268 * | |
1269 * @param row The position in which to insert the new items. | |
1270 * @param labels The collection of labels for the new items. | |
1271 */ | |
1272 public final void insertItems(int row, string[] labels) { | |
1273 foreach (label; labels) | |
1274 insertItem(row++, label); | |
1275 } | |
1276 }// class | |
1277 | |
1278 | |
1279 class QGraphicsScene___ extends QGraphicsScene { | |
1280 /** | |
1281 * Equivalent to addEllipse(rect, null, null) | |
1282 */ | |
1283 /*public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect) | |
1284 { | |
1285 return addEllipse(rect, null); | |
1286 }*/ | |
1287 | |
1288 /** | |
1289 * Equivalent to addEllipse(rect, pen, null) | |
1290 */ | |
1291 /* public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect, QPen pen) | |
1292 { | |
1293 return addEllipse(rect, pen, null); | |
1294 }*/ | |
1295 | |
1296 | |
1297 /** | |
1298 * Creates and adds an ellipse item to the scene, and returns the item | |
1299 * reference. The geometry of the ellipse is defined by rect, and its pen | |
1300 * and brush are initialized to pen and brush. | |
1301 * | |
1302 * Note that the item's geometry is provided in item coordinates, and its | |
1303 * position is initialized to (0, 0). | |
1304 * | |
1305 * If the item is visible (i.e., QGraphicsItem::isVisible() returns true), | |
1306 * QGraphicsScene will emit changed() once control goes back to the event | |
1307 * loop. | |
1308 * | |
1309 * @param rect The bounding rectangle of the ellipse. | |
1310 * @param pen The pen for the resulting QGraphicsEllipseItem. | |
1311 * @param brush The brush for the resulting QGraphicsEllipseItem. | |
1312 * @return The resulting item. | |
1313 */ | |
1314 /* public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect, QPen pen, QBrush brush) | |
1315 { | |
1316 return addEllipse(rect.x(), rect.y(), rect.width(), rect.height(), pen, brush); | |
1317 }*/ | |
1318 | |
1319 /** | |
1320 * Equivalent to addEllipse(x, y, w, h, null, null) | |
1321 */ | |
1322 /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h) { | |
1323 return addEllipse(x, y, w, h, null); | |
1324 }*/ | |
1325 | |
1326 /** | |
1327 * Equivalent to addEllipse(x, y, w, h, pen, null) | |
1328 */ | |
1329 /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h, QPen pen) | |
1330 { | |
1331 return addEllipse(x, y, w, h, pen, null); | |
1332 }*/ | |
1333 | |
1334 /** | |
1335 * Creates and adds an ellipse item to the scene, and returns the item | |
1336 * reference. The geometry of the ellipse is defined by x, y, w, h, and its pen | |
1337 * and brush are initialized to pen and brush. | |
1338 * | |
1339 * Note that the item's geometry is provided in item coordinates, and its | |
1340 * position is initialized to (0, 0). | |
1341 * | |
1342 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1343 * QGraphicsScene will emit changed once control goes back to the event | |
1344 * loop. | |
1345 * | |
1346 * @param x The left horizontal coordinate of the ellipse's bounding rectangle. | |
1347 * @param y The top vertical coordinate of the ellipse's bounding rectangle. | |
1348 * @param w The width of the ellipse's bounding rectangle. | |
1349 * @param h The height of the ellipse's bounding rectangle. | |
1350 * @param pen The pen for the resulting QGraphicsEllipseItem. | |
1351 * @param brush The brush for the resulting QGraphicsEllipseItem. | |
1352 * @return The resulting item. | |
1353 */ | |
1354 /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h, QPen pen, QBrush brush) | |
1355 { | |
1356 QGraphicsEllipseItem item = new QGraphicsEllipseItem(x, y, w, h); | |
1357 item.setPen(pen); | |
1358 item.setBrush(brush); | |
1359 | |
1360 addItem(item); | |
1361 | |
1362 return item; | |
1363 }*/ | |
1364 | |
1365 /** | |
1366 * Equivalent to addLine(line, null) | |
1367 */ | |
1368 /* public final QGraphicsLineItem addLine(QLineF line) { | |
1369 return addLine(line, null); | |
1370 }*/ | |
1371 | |
1372 /** | |
1373 * Creates and adds a line item to the scene, and returns the item | |
1374 * reference. The geometry of the line is defined by line, and its pen | |
1375 * is initialized to pen. | |
1376 * | |
1377 * Note that the item's geometry is provided in item coordinates, and its | |
1378 * position is initialized to (0, 0). | |
1379 * | |
1380 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1381 * QGraphicsScene will emit changed once control goes back to the event | |
1382 * loop. | |
1383 * | |
1384 * @param line The definition of the line. | |
1385 * @param pen The pen with which to draw the line. | |
1386 * @return The resulting item. | |
1387 */ | |
1388 /* public final QGraphicsLineItem addLine(QLineF line, QPen pen) | |
1389 { | |
1390 return addLine(line.x1(), line.y1(), line.x2(), line.y2(), pen); | |
1391 }*/ | |
1392 | |
1393 /** | |
1394 * Equivalent to addLine(x1, y1, x2, y2, null) | |
1395 */ | |
1396 /* public final QGraphicsLineItem addLine(double x1, double y1, double x2, double y2) { | |
1397 return addLine(x1, y1, x2, y2, null); | |
1398 }*/ | |
1399 | |
1400 /** | |
1401 * Creates and adds a line item to the scene, and returns the item | |
1402 * reference. The geometry of the line is defined by x1, y1, x2, y2, and its pen | |
1403 * is initialized to pen. | |
1404 * | |
1405 * Note that the item's geometry is provided in item coordinates, and its | |
1406 * position is initialized to (0, 0). | |
1407 * | |
1408 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1409 * QGraphicsScene will emit changed once control goes back to the event | |
1410 * loop. | |
1411 * | |
1412 * @param x1 The first horizontal coordinate of the line. | |
1413 * @param y1 The first vertical coordinate of the line. | |
1414 * @param x2 The second horizontal coordinate of the line. | |
1415 * @param y2 The second vertical coordinate of the line. | |
1416 * @param pen The pen with which to draw the line. | |
1417 * @return The resulting item. | |
1418 */ | |
1419 /* public final QGraphicsLineItem addLine(double x1, double y1, double x2, double y2, QPen pen) | |
1420 { | |
1421 QGraphicsLineItem item = new QGraphicsLineItem(x1, y1, x2, y2); | |
1422 item.setPen(pen); | |
1423 | |
1424 addItem(item); | |
1425 | |
1426 return item; | |
1427 }*/ | |
1428 | |
1429 | |
1430 /** | |
1431 * Equivalent to addPath(path, null, null) | |
1432 */ | |
1433 /*public final QGraphicsPathItem addPath(QPainterPath path) { | |
1434 return addPath(path, null); | |
1435 }*/ | |
1436 | |
1437 /** | |
1438 * Equivalent to addPath(path, pen, null) | |
1439 */ | |
1440 /*public final QGraphicsPathItem addPath(QPainterPath path, QPen pen) | |
1441 { | |
1442 return addPath(path, pen, null); | |
1443 }*/ | |
1444 /** | |
1445 * Creates and adds a path item to the scene, and returns the item | |
1446 * reference. The geometry of the path is defined by path, and its pen and | |
1447 * brush are initialized to pen and brush. | |
1448 * | |
1449 * Note that the item's geometry is provided in item coordinates, and its | |
1450 * position is initialized to (0, 0). | |
1451 * | |
1452 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1453 * QGraphicsScene will emit changed once control goes back to the event | |
1454 * loop. | |
1455 * | |
1456 * @param path The definition of the path. | |
1457 * @param pen The pen for drawing the path. | |
1458 * @param brush The brush for drawing the path. | |
1459 * @return The resulting item. | |
1460 */ | |
1461 /* public final QGraphicsPathItem addPath(QPainterPath path, QPen pen, QBrush brush) | |
1462 { | |
1463 QGraphicsPathItem item = new QGraphicsPathItem(path); | |
1464 item.setPen(pen); | |
1465 item.setBrush(brush); | |
1466 | |
1467 addItem(item); | |
1468 | |
1469 return item; | |
1470 }*/ | |
1471 | |
1472 /** | |
1473 * Creates and adds a pixmap item to the scene, and returns the item | |
1474 * reference. The pixmap is defined by pixmap. | |
1475 * | |
1476 * Note that the item's geometry is provided in item coordinates, and its | |
1477 * position is initialized to (0, 0). | |
1478 * | |
1479 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1480 * QGraphicsScene will emit changed once control goes back to the event | |
1481 * loop. | |
1482 * | |
1483 * @param pixmap The pixmap for which to create a graphics item. | |
1484 * @return The resulting item. | |
1485 */ | |
1486 /* public final QGraphicsPixmapItem addPixmap(QPixmap pixmap) | |
1487 { | |
1488 QGraphicsPixmapItem item = new QGraphicsPixmapItem(pixmap); | |
1489 | |
1490 addItem(item); | |
1491 | |
1492 return item; | |
1493 }*/ | |
1494 | |
1495 /** | |
1496 * Equivalent to addPolygon(polygon, null, null) | |
1497 */ | |
1498 /* public final QGraphicsPolygonItem addPolygon(QPolygonF polygon) { | |
1499 return addPolygon(polygon, null); | |
1500 }*/ | |
1501 | |
1502 /** | |
1503 * Equivalent to addPolygon(polygon, pen, null) | |
1504 */ | |
1505 /* public final QGraphicsPolygonItem addPolygon(QPolygonF polygon, QPen pen) { | |
1506 return addPolygon(polygon, pen, null); | |
1507 }*/ | |
1508 | |
1509 /** | |
1510 * Creates and adds a polygon item to the scene, and returns the item | |
1511 * reference. The polygon is defined by polygon, and its pen and | |
1512 * brush are initialized to pen and brush. | |
1513 * | |
1514 * Note that the item's geometry is provided in item coordinates, and its | |
1515 * position is initialized to (0, 0). | |
1516 * | |
1517 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1518 * QGraphicsScene will emit changed once control goes back to the event | |
1519 * loop. | |
1520 * | |
1521 * @param polygon The definition of the polygon. | |
1522 * @param pen The pen with which to draw the polygon. | |
1523 * @param brush The brush with which to draw the polygon. | |
1524 * @return The resulting item. | |
1525 */ | |
1526 /* public final QGraphicsPolygonItem addPolygon(QPolygonF polygon, QPen pen, QBrush brush) | |
1527 { | |
1528 QGraphicsPolygonItem item = new QGraphicsPolygonItem(polygon); | |
1529 item.setPen(pen); | |
1530 item.setBrush(brush); | |
1531 | |
1532 addItem(item); | |
1533 | |
1534 return item; | |
1535 }*/ | |
1536 | |
1537 /** | |
1538 * Equivalent to addRect(rect, null, null) | |
1539 */ | |
1540 /* public final QGraphicsRectItem addRect(qt.core.QRectF rect) { | |
1541 return addRect(rect, null); | |
1542 }*/ | |
1543 | |
1544 /** | |
1545 * Equivalent to addRect(rect, pen, null) | |
1546 */ | |
1547 /* public final QGraphicsRectItem addRect(qt.core.QRectF rect, QPen pen) | |
1548 { | |
1549 return addRect(rect, pen, null); | |
1550 }*/ | |
1551 | |
1552 /** | |
1553 * Creates and adds a rectangle item to the scene, and returns the item | |
1554 * reference. The geometry of the rectangle is defined by rect, and its pen | |
1555 * and brush are initialized to pen and brush. | |
1556 * | |
1557 * Note that the item's geometry is provided in item coordinates, and its | |
1558 * position is initialized to (0, 0). For example, if a QRect(50, 50, 100, | |
1559 * 100) is added, its top-left corner will be at (50, 50) relative to the | |
1560 * origin in the item's coordinate system. | |
1561 * | |
1562 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1563 * QGraphicsScene will emit changed once control goes back to the event | |
1564 * loop. | |
1565 * | |
1566 * @param rect The definition of the rectangle. | |
1567 * @param pen The pen with which to draw the rectangle. | |
1568 * @param brush The brush with which to draw the rectangle. | |
1569 * @return The resulting item. | |
1570 */ | |
1571 /* public final QGraphicsRectItem addRect(qt.core.QRectF rect, QPen pen, QBrush brush) | |
1572 { | |
1573 return addRect(rect.x(), rect.y(), rect.width(), rect.height(), pen, brush); | |
1574 }*/ | |
1575 | |
1576 /** | |
1577 * Equivalent to addRect(x, y, w, h, null, null) | |
1578 */ | |
1579 /* public final QGraphicsRectItem addRect(double x, double y, double w, double h) { | |
1580 return addRect(x, y, w, h, null); | |
1581 }*/ | |
1582 | |
1583 /** | |
1584 * Equivalent to addRect(x, y, w, h, pen, null) | |
1585 */ | |
1586 /* public final QGraphicsRectItem addRect(double x, double y, double w, double h, QPen pen) { | |
1587 return addRect(x, y, w, h, pen, null); | |
1588 }*/ | |
1589 | |
1590 /** | |
1591 * Creates and adds a rectangle item to the scene, and returns the item | |
1592 * reference. The geometry of the rectangle is defined by x, y, w, h, and its pen | |
1593 * and brush are initialized to pen and brush. | |
1594 * | |
1595 * Note that the item's geometry is provided in item coordinates, and its | |
1596 * position is initialized to (0, 0). | |
1597 * | |
1598 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1599 * QGraphicsScene will emit changed once control goes back to the event | |
1600 * loop. | |
1601 * | |
1602 * @param x The left horizontal coordinate of the rectangle. | |
1603 * @param y The top vertical coordinate of the rectangle. | |
1604 * @param w The width of the rectangle. | |
1605 * @param h The height of the rectangle. | |
1606 * @param pen The pen with which to draw the rectangle. | |
1607 * @param brush The brush with which to draw the rectangle. | |
1608 * @return The resulting item. | |
1609 */ | |
1610 /* public final QGraphicsRectItem addRect(double x, double y, double w, double h, QPen pen, QBrush brush) | |
1611 { | |
1612 QGraphicsRectItem item = new QGraphicsRectItem(x, y, w, h); | |
1613 item.setPen(pen); | |
1614 item.setBrush(brush); | |
1615 | |
1616 addItem(item); | |
1617 | |
1618 return item; | |
1619 }*/ | |
1620 | |
1621 /** | |
1622 * Equivalent to addSimpleText(text, null) | |
1623 */ | |
1624 /*public final QGraphicsSimpleTextItem addSimpleText(String text) { | |
1625 return addSimpleText(text, null); | |
1626 }*/ | |
1627 | |
1628 /** | |
1629 * Creates and adds a QGraphicsSimpleTextItem to the scene, and returns the | |
1630 * item reference. The text string is initialized to text, and its font is | |
1631 * initialized to font. | |
1632 * | |
1633 * The item's position is initialized to (0, 0). | |
1634 * | |
1635 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1636 * QGraphicsScene will emit changed once control goes back to the event | |
1637 * loop. | |
1638 * | |
1639 * @param text The text to add to the scene. | |
1640 * @param font The font to use for displaying the text. | |
1641 * @return The resulting item. | |
1642 */ | |
1643 /* public final QGraphicsSimpleTextItem addSimpleText(String text, QFont font) | |
1644 { | |
1645 QGraphicsSimpleTextItem item = new QGraphicsSimpleTextItem(text); | |
1646 item.setFont(font); | |
1647 | |
1648 addItem(item); | |
1649 | |
1650 return item; | |
1651 }*/ | |
1652 | |
1653 /** | |
1654 * Equivalent to addText(text, null) | |
1655 */ | |
1656 /* public final QGraphicsTextItem addText(String text) { | |
1657 return addText(text, null); | |
1658 }*/ | |
1659 | |
1660 /** | |
1661 * Creates and adds a text item to the scene, and returns the item | |
1662 * reference. The text string is initialized to text, and its font | |
1663 * is initialized to font. | |
1664 * | |
1665 * The item's position is initialized to (0, 0). | |
1666 * | |
1667 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1668 * QGraphicsScene will emit changed once control goes back to the event | |
1669 * loop. | |
1670 * | |
1671 * @param text The text to add to the scene. | |
1672 * @param font The font to use for displaying the text. | |
1673 * @return The resulting item. | |
1674 */ | |
1675 /* public final QGraphicsTextItem addText(String text, QFont font) | |
1676 { | |
1677 QGraphicsTextItem item = new QGraphicsTextItem(text); | |
1678 item.setFont(font); | |
1679 | |
1680 addItem(item); | |
1681 | |
1682 return item; | |
1683 }*/ | |
1684 | |
1685 }// class | |
1686 | |
1687 class QInputDialog___ extends QInputDialog { | |
1688 public static double getDouble(QWidget _parent, string title, string label, double value = 0, double minValue = -2147483647, double maxValue = 2147483647, int decimals = 1, ref bool ok = false, int flags = 0) { | |
254 | 1689 return qtd_QInputDialog_getDouble_private_QWidget_string_string_double_double_double_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.__nativeId, title, label, value, minValue, maxValue, decimals, &ok, flags); |
71 | 1690 } |
137 | 1691 |
1692 static if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0)) | |
1693 { | |
298
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
1694 public static int getInt(QWidget _parent, string title, string label, int value = 0, int minValue = -2147483647, int maxValue = 2147483647, int step = 1, ref bool ok = false, int flags = 0) { |
254 | 1695 return qtd_QInputDialog_getInt_private_QWidget_string_string_int_int_int_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.__nativeId, title, label, value, minValue, maxValue, step, &ok, flags); |
298
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
1696 } |
71 | 1697 } |
1698 | |
298
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
1699 public static string getItem(QWidget _parent, string title, string label, QList!(string) items, int current = 0, bool editable = true, ref bool ok = false, int flags = 0) { |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
254
diff
changeset
|
1700 return getItem_private(_parent, title, label, items, current, editable, &ok, flags); |
71 | 1701 } |
1702 | |
337 | 1703 public static string getText(QWidget _parent, string title, string label, QLineEdit.EchoMode echo = QLineEdit.EchoMode.Normal, string text = null, ref bool ok = false, int flags = 0) { |
71 | 1704 string res; |
254 | 1705 qtd_QInputDialog_getText_private_QWidget_string_string_EchoMode_string_nativepointerbool_WindowFlags(&res, _parent is null ? null : _parent.__nativeId, title, label, echo, text, &ok, flags); |
71 | 1706 return res; |
1707 } | |
1708 }// class | |
210 | 1709 |
1710 class QFont___ extends QFont { | |
1711 version(D_Version2) | |
1712 { | |
1713 void opAssign(in QFont arg__1) { | |
254 | 1714 this.__nativeId = qtd_QFont_QFont_QFont(arg__1 is null ? null : (cast(QFont)arg__1).__nativeId); |
210 | 1715 } |
1716 } | |
1717 }// class" |