// This is the SIP interface definition for TQLineEdit.
//
// Copyright (c) 2007
// 	Riverbank Computing Limited <info@riverbankcomputing.co.uk>
// 
// 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
