diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-01 19:17:32 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-01 19:17:32 +0000 |
commit | e38d2351b83fa65c66ccde443777647ef5cb6cff (patch) | |
tree | 1897fc20e9f73a81c520a5b9f76f8ed042124883 /src/gui/lineedit.h | |
download | tellico-e38d2351b83fa65c66ccde443777647ef5cb6cff.tar.gz tellico-e38d2351b83fa65c66ccde443777647ef5cb6cff.zip |
Added KDE3 version of Tellico
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1097620 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/lineedit.h')
-rw-r--r-- | src/gui/lineedit.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/gui/lineedit.h b/src/gui/lineedit.h new file mode 100644 index 0000000..af7d81b --- /dev/null +++ b/src/gui/lineedit.h @@ -0,0 +1,72 @@ +/*************************************************************************** + copyright : (C) 2005-2006 by Robby Stephenson + email : robby@periapsis.org + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of version 2 of the GNU General Public License as * + * published by the Free Software Foundation; * + * * + ***************************************************************************/ + +#ifndef TELLICO_GUILINEEDIT_H +#define TELLICO_GUILINEEDIT_H + +#include <klineedit.h> + +#include <qstring.h> + +class KAction; +class KSpell; + +namespace Tellico { + namespace GUI { + +/** + * @author Robby Stephenson + */ +class LineEdit : public KLineEdit { +Q_OBJECT + +public: + LineEdit(QWidget* parent = 0, const char* name = 0); + + virtual void setText(const QString& text); + void setHint(const QString& hint); + + // by default, spell check is not allowed, and no popupmenu item is created + void setAllowSpellCheck(bool b) { m_allowSpellCheck = b; } + // spell check may be allowed but disabled + void setEnableSpellCheck(bool b) { m_enableSpellCheck = b; } + +public slots: + void clear(); + +protected: + virtual void focusInEvent(QFocusEvent* event); + virtual void focusOutEvent(QFocusEvent* event); + virtual void drawContents(QPainter* painter); + virtual QPopupMenu* createPopupMenu(); + +private slots: + void slotCheckSpelling(); + void slotSpellCheckReady(KSpell* spell); + void slotSpellCheckDone(const QString& text); + void spellCheckerMisspelling(const QString& text, const QStringList&, unsigned int pos); + void spellCheckerCorrected(const QString& oldText, const QString& newText, unsigned int pos); + void spellCheckerFinished(); + +private: + QString m_hint; + bool m_drawHint; + KAction* m_spellAction; + bool m_allowSpellCheck; + bool m_enableSpellCheck; + KSpell* m_spell; +}; + + } // end namespace +} // end namespace +#endif |