summaryrefslogtreecommitdiffstats
path: root/sip/qt/qwidget.sip
blob: 07ceda7dd145a153f6edea3ec53fc08d82b0a6a7 (plain)
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
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
// This is the SIP interface definition for TQWidget.
//
// Copyright (c) 2007
// 	Riverbank Computing Limited <[email protected]>
// 
// This file is part of PyTQt.
// 
// This copy of PyTQt is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2, or (at your option) any later
// version.
// 
// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
// details.
// 
// You should have received a copy of the GNU General Public License along with
// PyTQt; see the file LICENSE.  If not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


%ExportedDoc
<Sect2><Title>TQWidget</Title>
<FuncSynopsis>
	<FuncDef>TQWExtra *<Function>extraData</Function></FuncDef>
	<ParamDef></ParamDef>
</FuncSynopsis>
<Para>
Not implemented.
</Para>

<FuncSynopsis>
	<FuncDef>TQFocusData *<Function>focusData</Function></FuncDef>
	<ParamDef></ParamDef>
</FuncSynopsis>
<Para>
Not implemented.
</Para>

<FuncSynopsis>
	<FuncDef>void <Function>lower</Function></FuncDef>
	<ParamDef></ParamDef>
</FuncSynopsis>
<Para>
This has been renamed to <Literal>lowerW</Literal> in Python.
</Para>

<FuncSynopsis>
	<FuncDef>void <Function>raise</Function></FuncDef>
	<ParamDef></ParamDef>
</FuncSynopsis>
<Para>
This has been renamed to <Literal>raiseW</Literal> in Python.
</Para>
</Sect2>
%End


class TQWidget : TQObject, TQPaintDevice
{
%TypeHeaderCode
#include <tqwidget.h>
%End

public:
	TQWidget(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0);

	WId winId() const;
	bool isTopLevel() const;
%If (TQt_3_0_0 -)
	bool isDialog() const;
%End
	bool isPopup() const;
	bool isDesktop() const;
	bool isModal() const;
	bool isEnabled() const;
	bool isEnabledTo(TQWidget *) const;
	bool isEnabledToTLW() const;
	const TQRect &geometry() const;
	int x() const;
	int y() const;
	TQPoint pos() const;
	TQSize size() const;
	int width() const;
	int height() const;
	TQRect rect() const;
	TQRect childrenRect() const;
	TQSize minimumSize() const;
	TQSize maximumSize() const;
	void setMinimumSize(const TQSize &);
	void setMaximumSize(const TQSize &);
	void setMinimumWidth(int);
	void setMinimumHeight(int);
	void setMaximumWidth(int);
	void setMaximumHeight(int);
	TQSize sizeIncrement() const;
	void setSizeIncrement(const TQSize &);
	void setFixedSize(const TQSize &);
	void setFixedSize(int,int);
	void setFixedWidth(int);
	void setFixedHeight(int);
	TQPoint mapToGlobal(const TQPoint &) const;
	TQPoint mapFromGlobal(const TQPoint &) const;
	TQPoint mapToParent(const TQPoint &) const;
	TQPoint mapFromParent(const TQPoint &) const;
%If (TQt_2_2_0 -)
	TQPoint mapTo(TQWidget *,const TQPoint &) const;
	TQPoint mapFrom(TQWidget *,const TQPoint &) const;
%End

	TQWidget *topLevelWidget() const;

	BackgroundMode backgroundMode() const;
%If (- TQt_3_0_0)
	const TQColor &backgroundColor() const;
	virtual void setBackgroundColor(const TQColor &);
	const TQPixmap *backgroundPixmap();
	virtual void setBackgroundPixmap(const TQPixmap &);
%End

	const TQColor &foregroundColor() const;

%If (TQt_3_0_0 -)
	const TQColor &eraseColor() const;
	virtual void setEraseColor(const TQColor &);

	const TQPixmap *erasePixmap() const;
	virtual void setErasePixmap(const TQPixmap &);
%End

	const TQColorGroup &colorGroup() const;
	const TQPalette &palette() const;
%If (TQt_2_2_0 -)
	bool ownPalette() const;
%End
	virtual void setPalette(const TQPalette &);
%If (TQt_2_1_0 -)
	void unsetPalette();
%End

%If (TQt_3_0_0 -)
	const TQColor &paletteForegroundColor() const;
	void setPaletteForegroundColor(const TQColor &);
 
	const TQColor &paletteBackgroundColor() const;
	virtual void setPaletteBackgroundColor(const TQColor &);
 
	const TQPixmap *paletteBackgroundPixmap() const;
	virtual void setPaletteBackgroundPixmap(const TQPixmap &);

	const TQBrush &backgroundBrush() const;
%End

%If (TQt_2_2_0 -)
	bool ownFont() const;
%End
	virtual void setFont(const TQFont &);
	TQFontMetrics fontMetrics() const;
	TQFontInfo fontInfo() const;

%If (- TQt_3_0_0)
	enum PropagationMode
	{
		NoChildren,
		AllChildren,
		SameFont,
		SamePalette = SameFont
	};

	PropagationMode fontPropagation() const;
	PropagationMode palettePropagation() const;
%End

	const TQCursor &cursor() const;
%If (TQt_2_2_0 -)
	bool ownCursor() const;
%End
	virtual void setCursor(const TQCursor &);
	const TQPixmap *icon() const;
	bool hasMouseTracking() const;
%If (TQt_3_0_0 -)
	bool hasMouse() const;
%End

	void clearMask();
	bool isActiveWindow() const;
	bool isFocusEnabled() const;
	FocusPolicy focusPolicy() const;
	bool hasFocus() const;
	static void setTabOrder(TQWidget *,TQWidget *);
	TQWidget *focusProxy() const;

%If (TQt_3_2_0 -)
	void setInputMethodEnabled(bool);
	bool isInputMethodEnabled() const;
%End

	void grabMouse();
	void grabMouse(const TQCursor &);
	void releaseMouse();
	void grabKeyboard();
	void releaseKeyboard();
	static TQWidget *mouseGrabber();
	static TQWidget *keyboardGrabber();
	bool isUpdatesEnabled() const;
	bool isVisible() const;
	bool isVisibleTo(TQWidget *) const;
	bool isVisibleToTLW() const;
	virtual TQSize sizeHint() const;
%If (- TQt_3_1_0)
	virtual void adjustSize();
%End
	void erase();
	void erase(int,int,int,int);
	void erase(const TQRect &);
	void scroll(int,int);
	TQWidget *focusWidget() const;
	bool acceptDrops() const;
%If (- TQt_3_0_0)
	TQWidget *parentWidget() const;
	bool testWFlags(WFlags) const;
%End
%If (TQt_3_0_0 -)
	TQWidget *parentWidget(bool = 0) const;
	WState testWState(WState) const;
	WFlags testWFlags(WFlags) const;
%End
	static TQWidget *find(WId);

%If (TQt_3_0_0 -)
	TQWidget *childAt(int,int,bool = 0) const;
	TQWidget *childAt(const TQPoint &,bool = 0) const;
%End

%If (TQt_3_3_0 -)
	void setWindowOpacity(double);
	double windowOpacity() const;
%End

%If (- TQt_2_00)
	GUIStyle style() const;
	virtual void setStyle(GUIStyle);
	const TQRect &frameGeometry() const;
	void setMinimumSize(int,int);
	void setMaximumSize(int,int);
	void setSizeIncrement(int,int);

	enum BackgroundMode
	{
		FixedColor,
		FixedPixmap,
		NoBackground,
		PaletteForeground,
		PaletteBackground,
		PaletteLight,
		PaletteMidlight,
		PaletteDark,
		PaletteMid,
		PaletteText,
		PaletteBase
	};

	void setBackgroundMode(BackgroundMode);
	const TQFont &font() const;
	void setFontPropagation(PropagationMode);
	void setPalettePropagation(PropagationMode);
	const char *caption() const;
	const char *iconText() const;
	void setMask(TQBitmap);
	void setMask(const TQRegion &);

	enum FocusPolicy
	{
		NoFocus = 0,
		TabFocus = 1,
		ClickFocus = 2,
		StrongFocus = 3
	};

	void setActiveWindow();
	void setFocusPolicy(FocusPolicy);
	void setFocus();
	void clearFocus();
	void setFocusProxy(TQWidget *);
	virtual bool close(bool = 0);
	void recreate(TQWidget *,WFlags,const TQPoint &,bool = 0);
	void drawText(int,int,const char *);
	void drawText(const TQPoint &,const char *);
	void setAcceptDrops(bool);
%End

%If (TQt_2_00 -)
	void setName(const char *);
	TQStyle &style() const;
	void setStyle(TQStyle *);
%If (TQt_3_0_0 -)
	TQStyle *setStyle(const TQString &);
%End
	TQRect frameGeometry() const;
	TQSize frameSize() const;
	TQRegion childrenRegion() const;
	int minimumWidth() const;
	int minimumHeight() const;
	int maximumWidth() const;
	int maximumHeight() const;
	virtual void setMinimumSize(int,int);
	virtual void setMaximumSize(int,int);
	virtual void setSizeIncrement(int,int);
	TQSize baseSize() const;
	void setBaseSize(const TQSize &);
	void setBaseSize(int,int);

%If (- TQt_2_2_0)
	enum BackgroundMode
	{
		FixedColor,
		FixedPixmap,
		NoBackground,
		PaletteForeground,
		PaletteButton,
		PaletteLight,
		PaletteMidlight,
		PaletteDark,
		PaletteMid,
		PaletteText,
		PaletteBrightText,
		PaletteBase,
		PaletteBackground,
		PaletteShadow,
		PaletteHighlight,
		PaletteHighlightedText
	};
%End
%If (TQt_2_2_0 - TQt_3_0_0)
	enum BackgroundMode
	{
		FixedColor,
		FixedPixmap,
		NoBackground,
		PaletteForeground,
		PaletteButton,
		PaletteLight,
		PaletteMidlight,
		PaletteDark,
		PaletteMid,
		PaletteText,
		PaletteBrightText,
		PaletteBase,
		PaletteBackground,
		PaletteShadow,
		PaletteHighlight,
		PaletteHighlightedText,
		PaletteButtonText,
		X11ParentRelative
	};
%End

	virtual void setBackgroundMode(BackgroundMode);
%If (TQt_3_0_0 -)
	void setBackgroundMode(BackgroundMode,BackgroundMode);
%End
	TQFont font() const;
%If (- TQt_3_0_0)
	void setPalette(const TQPalette &,bool);
	void setFont(const TQFont &,bool);
	virtual void setFontPropagation(PropagationMode);
	virtual void setPalettePropagation(PropagationMode);
%End
	virtual void unsetCursor();
	TQString caption() const;
	TQString iconText() const;
	virtual void setMask(const TQBitmap &);
	virtual void setMask(const TQRegion &);

	enum FocusPolicy
	{
		NoFocus = 0,
		TabFocus = 1,
		ClickFocus = 2,
		StrongFocus = 3,
		WheelFocus = 7
	};

	virtual void setActiveWindow();
	virtual void setFocusPolicy(FocusPolicy);
	virtual void setFocusProxy(TQWidget *);
	virtual bool close(bool);
	// Obsolete.
	TQRect visibleRect() const;
	bool isMinimized() const;
	virtual TQSize minimumSizeHint() const;
	virtual TQSizePolicy sizePolicy() const;
%If (TQt_2_2_0 -)
	bool isHidden() const;
	bool isMaximized() const;
%End
%If (TQt_3_1_0 -)
	bool isShown() const;
	bool isFullScreen() const;
%End

%If (TQt_3_3_0 -)
	uint windowState() const;
	void setWindowState(uint);
%End

%If (TQt_3_0_0 -)
	virtual void setSizePolicy(TQSizePolicy);
%End
%If (TQt_3_1_0 -)
	void setSizePolicy(TQSizePolicy::SizeType,TQSizePolicy::SizeType,
			   bool = 0);
%End
%If (TQt_2_2_0 - TQt_3_0_0)
	void setSizePolicy(TQSizePolicy);
%End
	virtual int heightForWidth(int) const;

%If (TQt_3_2_0 -)
	TQRegion clipRegion() const;
%End

	TQLayout *layout() const;
	void updateGeometry();

	virtual void reparent(TQWidget * /GetWrapper/,WFlags,const TQPoint &,
			      bool = 0);
%MethodCode
		if (sipCpp -> parent() != a0)
        {
			if (a0)
				sipTransferTo(sipSelf,a0Wrapper);
			else
				sipTransferBack(sipSelf);
        }

		Py_BEGIN_ALLOW_THREADS
		sipSelfWasArg ? sipCpp->TQWidget::reparent(a0, a1, *a2, a3) : sipCpp->reparent(a0, a1, *a2, a3);
		Py_END_ALLOW_THREADS
%End

%If (TQt_2_1_0 -)
	void reparent(TQWidget * /GetWrapper/,const TQPoint &,bool = 0);
%MethodCode
		if (sipCpp -> parent() != a0)
        {
			if (a0)
				sipTransferTo(sipSelf,a0Wrapper);
			else
				sipTransferBack(sipSelf);
        }

		Py_BEGIN_ALLOW_THREADS
		sipCpp->reparent(a0, *a1, a2);
		Py_END_ALLOW_THREADS
%End
%End

	void erase(const TQRegion &);
	void scroll(int,int,const TQRect &);
	void drawText(int,int,const TQString &);
	void drawText(const TQPoint &,const TQString &);
	virtual void setAcceptDrops(bool);
	virtual void setAutoMask(bool);
	bool autoMask() const;
	virtual bool customWhatsThis() const;
%If (- TQt_3_0_0)
	bool testWState(uint) const;
%End
%End

%If (TQt_2_1_0 -)
	TQRect microFocusHint() const;
	void unsetFont();
%End

%If (TQt_2_1_0 -)
	enum BackgroundOrigin {
		WidgetOrigin,
		ParentOrigin,
%If (TQt_3_0_0 -)
		WindowOrigin,
%End
%If (TQt_3_1_0 -)
		AncestorOrigin,
%End
	};
%End
 
%If (TQt_2_1_0 - TQt_3_0_0)
	void setBackgroundOrigin(BackgroundOrigin);
%End
%If (TQt_3_0_0 -)
	virtual void setBackgroundOrigin(BackgroundOrigin);
%End
%If (TQt_2_1_0 -)
	BackgroundOrigin backgroundOrigin() const;
%End

%If (TQt_3_1_0 -)
	TQPoint backgroundOffset() const;
%End

public slots:
%If (TQt_3_1_0 -)
	virtual void adjustSize();
%End
	virtual void setEnabled(bool);
%If (TQt_2_2_0 -)
	void setDisabled(bool);
%End
	void update();
	void update(int,int,int,int);
	void update(const TQRect &);
	void repaint(int,int,int,int,bool = 1);
	void repaint(const TQRect &,bool = 1);
	virtual void show();
	virtual void hide();
%If (TQt_3_1_0 -)
	void setShown(bool);
	void setHidden(bool);
%End
	void raise() /PyName=raiseW/;
	void lower() /PyName=lowerW/;
	virtual void move(int,int);
	void move(const TQPoint &);
	virtual void resize(int,int);
	void resize(const TQSize &);
	virtual void setGeometry(int,int,int,int);

%If (- TQt_2_00)
	void setCaption(const char *);
	void setIcon(const TQPixmap &);
	void setIconText(const char *);
	void setMouseTracking(bool);
	void setUpdatesEnabled(bool);
	void repaint(bool = 1);
	void iconify();
	void setGeometry(const TQRect &);
%End

%If (TQt_2_00 -)
	virtual void setCaption(const TQString &);
	virtual void setIcon(const TQPixmap &);
	virtual void setIconText(const TQString &);
	virtual void setMouseTracking(bool);
	virtual void setFocus();
	void clearFocus();
	virtual void setUpdatesEnabled(bool);
	void repaint();
	void repaint(bool);
	void repaint(const TQRegion &,bool = 1);
	virtual void showMinimized();
	virtual void showMaximized();
	virtual void showNormal();
	virtual void polish();
	bool close();
	virtual void setGeometry(const TQRect &);
%End

%If (TQt_2_1_0 -)
	void showFullScreen();
	void constPolish() const;
%End

%If (TQt_3_0_0 -)
    // This was added before v3 but I can't be bothered to work out exactly
    // when.
    void stackUnder(TQWidget *);
%End

protected:
	bool event(TQEvent *);
	virtual void mousePressEvent(TQMouseEvent *);
	virtual void mouseReleaseEvent(TQMouseEvent *);
	virtual void mouseDoubleClickEvent(TQMouseEvent *);
	virtual void mouseMoveEvent(TQMouseEvent *);
	virtual void keyPressEvent(TQKeyEvent *);
	virtual void keyReleaseEvent(TQKeyEvent *);
	virtual void focusInEvent(TQFocusEvent *);
	virtual void focusOutEvent(TQFocusEvent *);
	virtual void enterEvent(TQEvent *);
	virtual void leaveEvent(TQEvent *);
	virtual void paintEvent(TQPaintEvent *);
	virtual void moveEvent(TQMoveEvent *);
	virtual void resizeEvent(TQResizeEvent *);
	virtual void closeEvent(TQCloseEvent *);
%If (TQt_3_0_0 -)
	virtual void contextMenuEvent(TQContextMenuEvent *);
	virtual void imStartEvent(TQIMEvent *);
	virtual void imComposeEvent(TQIMEvent *);
	virtual void imEndEvent(TQIMEvent *);
	virtual void tabletEvent(TQTabletEvent *);
%End
	virtual void enabledChange(bool);
%If (- TQt_3_0_0)
	virtual void backgroundColorChange(const TQColor &);
	virtual void backgroundPixmapChange(const TQPixmap &);
%End
	virtual void paletteChange(const TQPalette &);
	virtual void fontChange(const TQFont &);
%If (TQt_3_0_0 -)
	virtual void windowActivationChange(bool);
	void resetInputContext();
%End
	WFlags getWFlags() const;
	void clearWFlags(WFlags);
	virtual bool focusNextPrevChild(bool);
//	TQWExtra *extraData();
//	TQFocusData *focusData();

%If (- TQt_2_00)
	virtual void styleChange(GUIStyle);
	void create(WId);
	void create(WId,bool,bool);
	void destroy(bool,bool);
	void setWFlags(WFlags);
	void setFRect(const TQRect &);
	void setCRect(const TQRect &);
	void setSizeGrip(bool);
%End

%If (TQt_2_00 -)
	virtual void wheelEvent(TQWheelEvent *);
%If (TQt_DRAGANDDROP)
	virtual void dragEnterEvent(TQDragEnterEvent *);
	virtual void dragMoveEvent(TQDragMoveEvent *);
	virtual void dragLeaveEvent(TQDragLeaveEvent *);
	virtual void dropEvent(TQDropEvent *);
%End
	virtual void showEvent(TQShowEvent *);
	virtual void hideEvent(TQHideEvent *);
%If (- TQt_3_0_0)
	virtual void customEvent(TQCustomEvent *);
%End


	virtual void updateMask();

	virtual void styleChange(TQStyle &);
	int metric(int) const;
	virtual void create(WId = 0,bool = 1,bool = 1);
	virtual void destroy(bool = 1,bool = 1);
	uint getWState() const;
	virtual void setWState(uint);
	void clearWState(uint);
	virtual void setWFlags(WFlags);
%If (- TQt_3_0_0)
	virtual void setFRect(const TQRect &);
	virtual void setCRect(const TQRect &);
%End
	virtual void setKeyCompression(bool);
%If (- TQt_3_0_0)
	virtual void setMicroFocusHint(int,int,int,int,bool = 1);
%End
%If (TQt_3_0_0 -)
	virtual void setMicroFocusHint(int,int,int,int,bool = 1,TQFont * = 0);
%End
%End

private:
	TQWidget(const TQWidget &);
};