summaryrefslogtreecommitdiffstats
path: root/sip/qt/qlineedit.sip
blob: e7f6372ed1f9f95e37e030ccb5a8846792b8bc8a (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
// This is the SIP interface definition for TQLineEdit.
//
// 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>TQLineEdit</Title>
<FuncSynopsis>
	<FuncDef>int <Function>characterAt</Function></FuncDef>
	<ParamDef>int <Parameter>xpos</Parameter></ParamDef>
	<ParamDef>TQChar *<Parameter>chr</Parameter></ParamDef>
</FuncSynopsis>
<Para>
This takes only the <Literal>xpos</Literal> parameter and returns the int
result and the <Literal>chr</Literal> value as a tuple.  (TQt v3+)
</Para>

<FuncSynopsis>
	<FuncDef>void <Function>del</Function></FuncDef>
	<ParamDef></ParamDef>
</FuncSynopsis>
<Para>
This has been renamed <Literal>delChar</Literal> in Python.  (TQt v2+)
</Para>

<FuncSynopsis>
	<FuncDef>bool <Function>getSelection</Function></FuncDef>
	<ParamDef>int *<Parameter>start</Parameter></ParamDef>
	<ParamDef>int *<Parameter>end</Parameter></ParamDef>
</FuncSynopsis>
<Para>
This takes no parameters and returns the bool result and the
<Literal>start</Literal> and <Literal>end</Literal> values as a tuple.
(TQt v3+)
</Para>
</Sect2>
%End


%If (TQt_3_0_0 -)

class TQLineEdit : TQFrame
{
%TypeHeaderCode
#include <tqlineedit.h>
%End

public:
	TQLineEdit(TQWidget * /TransferThis/,const char * = 0);
	TQLineEdit(const TQString &,TQWidget * /TransferThis/,const char * = 0);
%If (TQt_3_2_0 -)
	TQLineEdit(const TQString &,const TQString &,TQWidget * /TransferThis/,
		  const char * = 0);
%End

	TQString text() const;

	TQString displayText() const;

	int maxLength() const;

	bool frame() const;

	enum EchoMode {
		Normal,
		NoEcho,
		Password
	};

	EchoMode echoMode() const;

	bool isReadOnly() const;

	const TQValidator *validator() const;

	TQSize sizeHint() const;
	TQSize minimumSizeHint() const;

	int cursorPosition() const;
	// Obsolete.
	bool validateAndSet(const TQString &,int,int,int);

	int alignment() const;

	void cursorForward(bool,int = 1);
	void cursorBackward(bool,int = 1);
	void cursorWordForward(bool);
	void cursorWordBackward(bool);
	void backspace();
	void del() /PyName=delChar/;
	void home(bool);
	void end(bool);

%If (TQt_3_2_0 -)
	bool isModified() const;
	void clearModified();
%End

	// Obsolete.
	bool edited() const;
	// Obsolete.
	void setEdited(bool);

	bool hasSelectedText() const;
	TQString selectedText() const;
%If (TQt_3_2_0 -)
	int selectionStart() const;
%End

	bool isUndoAvailable() const;
	bool isRedoAvailable() const;

	bool dragEnabled() const;

%If (TQt_3_2_0 -)
	TQString inputMask() const;
	void setInputMask(const TQString &);
	bool hasAcceptableInput() const;
%End

public slots:
	virtual void setText(const TQString &);
	virtual void selectAll();
	virtual void deselect();
	virtual void clearValidator();
	virtual void insert(const TQString &);
	virtual void clear();
	virtual void undo();
	virtual void redo();
	virtual void setMaxLength(int);
	virtual void setFrame(bool);
	virtual void setEchoMode(EchoMode);
	virtual void setReadOnly(bool);
	virtual void setValidator(const TQValidator *);
	virtual void setFont(const TQFont &);
	virtual void setPalette(const TQPalette &);
	virtual void setSelection(int,int);
	virtual void setCursorPosition(int);
	virtual void setAlignment(int);
%If (TQt_CLIPBOARD)
	virtual void cut();
	virtual void copy() const;
	virtual void paste();
%End
	virtual void setDragEnabled(bool);

signals:
	void textChanged(const TQString &);
	void returnPressed();
%If (TQt_3_1_0 -)
	void lostFocus();
%End
	void selectionChanged();

protected:
	bool event(TQEvent *);
	void mousePressEvent(TQMouseEvent *);
	void mouseMoveEvent(TQMouseEvent *);
	void mouseReleaseEvent(TQMouseEvent *);
	void mouseDoubleClickEvent(TQMouseEvent *);
	void keyPressEvent(TQKeyEvent *);
	void imStartEvent(TQIMEvent *);
	void imComposeEvent(TQIMEvent *);
	void imEndEvent(TQIMEvent *);
	void focusInEvent(TQFocusEvent *);
	void focusOutEvent(TQFocusEvent *);
	void resizeEvent(TQResizeEvent *);
	void drawContents(TQPainter *);
%If (TQt_DRAGANDDROP)
	void dragEnterEvent(TQDragEnterEvent *);
	void dragMoveEvent(TQDragMoveEvent *);
	void dragLeaveEvent(TQDragLeaveEvent *);
	void dropEvent(TQDropEvent *);
%End
	void contextMenuEvent(TQContextMenuEvent *);
	virtual TQPopupMenu *createPopupMenu() /Factory/;
	void windowActivationChange(bool);

public:
	// These appeared in v3.0.2 but defined as incompatible 3.0 addons,
	// until v3.1.0.  v3.2.0 then defined them as internal and obsolete.
%If (TQt_3_1_0 -)
	void setPasswordChar(TQChar);
	TQChar passwordChar() const;
%End

	// Obsolete.
	SIP_PYTUPLE characterAt(int) const;
%MethodCode
		int res;
		TQChar *chr;
 
		Py_BEGIN_ALLOW_THREADS
		chr = new TQChar();
		res = sipCpp -> characterAt(a0,chr);
		Py_END_ALLOW_THREADS
 
		sipRes = sipBuildResult(&sipIsErr,"(iB)",res,chr,sipClass_TQChar,NULL);
%End

	// Obsolete.
	bool getSelection(int *,int *);

private:
	TQLineEdit(const TQLineEdit &);
};

%End


%If (- TQt_3_0_0)

class TQLineEdit : TQWidget
{
%TypeHeaderCode
#include <tqlineedit.h>
%End

public:
%If (- TQt_2_00)
	TQLineEdit(TQWidget * /TransferThis/ = 0,const char * = 0);
%End
%If (TQt_2_00 -)
	TQLineEdit(TQWidget * /TransferThis/,const char * = 0);
	TQLineEdit(const TQString &,TQWidget * /TransferThis/,const char * = 0);
%End

%If (- TQt_2_00)
	const char *text() const;
%End
%If (TQt_2_00 -)
	TQString text() const;

	TQString displayText() const;
%End

%If (- TQt_2_00)
	void setMaxLength(int);
%End
%If (TQt_2_00 -)
	virtual void setMaxLength(int);
%End
	int maxLength() const;

%If (- TQt_2_00)
	void setFrame(bool);
%End
%If (TQt_2_00 -)
	virtual void setFrame(bool);
%End
	bool frame() const;

	enum EchoMode {
		Normal,
		NoEcho,
		Password
	};

%If (- TQt_2_00)
	void setEchoMode(EchoMode);
%End
%If (TQt_2_00 -)
	virtual void setEchoMode(EchoMode);
%End
	EchoMode echoMode() const;

%If (TQt_2_1_0 -)
	void setReadOnly(bool);
%End
%If (TQt_2_1_0 -)
	bool isReadOnly() const;
%End

%If (- TQt_2_00)
	void setValidator(TQValidator *);
	TQValidator *validator() const;
%End
%If (TQt_2_00 -)
	virtual void setValidator(TQValidator *);
%End
%If (TQt_2_00 -)
	const TQValidator *validator() const;
%End

	TQSize sizeHint() const;
%If (TQt_2_00 -)
	TQSize minimumSizeHint() const;
%End
%If (TQt_2_00 -)
	TQSizePolicy sizePolicy() const;
%End

%If (- TQt_2_00)
	void setCursorPosition(int);
%End
%If (TQt_2_00 -)
	virtual void setCursorPosition(int);
%End
	int cursorPosition() const;
%If (- TQt_2_00)
	bool validateAndSet(const char *,int,int,int);
%End
%If (TQt_2_00 -)
	bool validateAndSet(const TQString &,int,int,int);
%End

%If (TQt_2_00 -)
	int alignment() const;
%End

%If (TQt_2_00 -)
	void cursorLeft(bool,int = 1);
	void cursorRight(bool,int = 1);
	void cursorWordForward(bool);
	void cursorWordBackward(bool);
	void backspace();
	void del() /PyName=delChar/;
	void home(bool);
	void end(bool);

	void setEdited(bool);
	bool edited() const;
%End

%If (TQt_2_00 -)
	bool hasMarkedText() const;
	TQString markedText() const;
%End

%If (TQt_CLIPBOARD)
	void cut();
	void copy() const;
	void paste();
%End

%If (- TQt_2_00)
	void setEnabled(bool);
	void setFont(const TQFont &);
	void setPalette(const TQPalette &);
	void setSelection(int,int);
%End
%If (TQt_2_00 -)
	virtual void setEnabled(bool);
	virtual void setFont(const TQFont &);
	virtual void setPalette(const TQPalette &);
	virtual void setSelection(int,int);

	void setAlignment(int);
%End

public slots:
%If (- TQt_2_00)
	void setText(const char *);
%End
%If (TQt_2_00 -)
	virtual void setText(const TQString &);
%End
	void selectAll();
	void deselect();
	void clearValidator();
%If (- TQt_2_00)
	void insert(const char *);
%End
%If (TQt_2_00 -)
	void insert(const TQString &);
%End
	void clear();

signals:
%If (- TQt_2_00)
	void textChanged(const char *);
%End
%If (TQt_2_00 -)
	void textChanged(const TQString &);
%End
	void returnPressed();

protected:
%If (TQt_2_2_0 -)
	bool event(TQEvent *);
%End
	void mousePressEvent(TQMouseEvent *);
	void mouseMoveEvent(TQMouseEvent *);
	void mouseReleaseEvent(TQMouseEvent *);
	void mouseDoubleClickEvent(TQMouseEvent *);
	void keyPressEvent(TQKeyEvent *);
	void focusInEvent(TQFocusEvent *);
	void focusOutEvent(TQFocusEvent *);
	void paintEvent(TQPaintEvent *);
	void resizeEvent(TQResizeEvent *);
	void leaveEvent(TQEvent *);
	void repaintArea(int,int);
%If (- TQt_2_00)
	void timerEvent(TQTimerEvent *);
	bool event(TQEvent *);
	bool hasMarkedText() const;
	TQString markedText() const;
%End
%If (TQt_2_00 -)
%If (TQt_DRAGANDDROP)
	void dragEnterEvent(TQDragEnterEvent *);
	void dropEvent(TQDropEvent *);
%End
%End

private:
	TQLineEdit(const TQLineEdit &);
};

%End