summaryrefslogtreecommitdiffstats
path: root/sip/tqt/tqlineedit.sip
blob: 23488c371845e426c60c5801b1f80da23b573bed (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
// 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


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

public:
	TQLineEdit(TQWidget * /TransferThis/,const char * = 0);
	TQLineEdit(const TQString &,TQWidget * /TransferThis/,const char * = 0);
	TQLineEdit(const TQString &,const TQString &,TQWidget * /TransferThis/,
		  const char * = 0);

	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);

	bool isModified() const;
	void clearModified();

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

	bool hasSelectedText() const;
	TQString selectedText() const;
	int selectionStart() const;

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

	bool dragEnabled() const;

	TQString inputMask() const;
	void setInputMask(const TQString &);
	bool hasAcceptableInput() const;

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();
	void lostFocus();
	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.
	void setPasswordChar(TQChar);
	TQChar passwordChar() const;

	// 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 &);
};