#ifndef QLINEEDIT_H_
#define QLINEEDIT_H_
#include "KWQString.h"
#include "KWQWidget.h"
#ifdef __OBJC__
@class KWQTextFieldController;
#else
class KWQTextFieldController;
#endif
class QLineEdit : public QWidget {
public:
enum Type { Normal, Password, Search };
QLineEdit(Type);
~QLineEdit();
virtual void setPalette(const QPalette &);
void setAlignment(AlignmentFlags);
void setCursorPosition(int);
int cursorPosition() const;
void setEdited(bool);
bool edited() const;
void setFont(const QFont &);
void setMaxLength(int);
int maxLength() const;
void setReadOnly(bool);
bool isReadOnly() const;
void setText(const QString &);
QString text() const;
void setWritingDirection(QPainter::TextDirection);
void selectAll();
QSize sizeForCharacterWidth(int numCharacters) const;
int baselinePosition(int height) const;
void returnPressed() { m_returnPressed.call(); }
void textChanged() { m_textChanged.call(text()); }
void performSearch() { m_performSearch.call(); }
void clicked();
virtual FocusPolicy focusPolicy() const;
virtual bool checksDescendantsForFocus() const;
Type type() const { return m_type; }
void setLiveSearch(bool liveSearch);
void setAutoSaveName(const QString& name);
void setMaxResults(int maxResults);
void setPlaceholderString(const QString& placeholder);
void addSearchResult();
private:
KWQSignal m_returnPressed;
KWQSignal m_textChanged;
KWQSignal m_clicked;
KWQSignal m_performSearch;
Type m_type;
KWQTextFieldController *m_controller;
};
#ifdef __OBJC__
NSTextAlignment KWQNSTextAlignmentForAlignmentFlags(Qt::AlignmentFlags);
#endif
#endif