diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 00bb99ac80741fc50ef8a289719373032f2391eb (patch) | |
tree | 3a5a9bf72f942784b38bf77dd66c534662fab5f2 /kmouth/wordcompletion/wordcompletion.h | |
download | tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.tar.gz tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmouth/wordcompletion/wordcompletion.h')
-rw-r--r-- | kmouth/wordcompletion/wordcompletion.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/kmouth/wordcompletion/wordcompletion.h b/kmouth/wordcompletion/wordcompletion.h new file mode 100644 index 0000000..f0cb812 --- /dev/null +++ b/kmouth/wordcompletion/wordcompletion.h @@ -0,0 +1,77 @@ +#ifndef WORDCOMPLETION_H +#define WORDCOMPLETION_H + +#include <kcompletion.h> + +/** + * This class does completion based on a dictionary of words. + */ +class WordCompletion : public KCompletion { + friend class WordListWidget; + Q_OBJECT +public: + WordCompletion(); + virtual ~WordCompletion(); + + /** + * Returns the names for the available word lists + */ + QStringList wordLists(); + + /** + * Returns the names for those word lists that contain + * words of a given language. + */ + QStringList wordLists(const QString &language); + + /** + * Returns the language of a given word list. + */ + QString languageOfWordList(const QString &wordlist); + + /** + * Returns the name of the currently active word list. + */ + QString currentWordList(); + + /** + * Finds completions to the given text. + */ + virtual QString makeCompletion(const QString&); + + static bool isConfigured(); + + /** + * Adds the words from the given sentence to the list of words. + */ + void addSentence (const QString &sentence); + +public slots: + /** + * Re-reads the configuration. + */ + void configure(); + + /** + * Specify which word list gets used for the actual word completion. + * If there is no word list with the given name the first configured + * list gets used. + * The method returns true if the specified word list was found. + */ + bool setWordList(const QString &wordlist); + + /** + * Saves the added words to disk. + */ + void save (); + +signals: + void wordListsChanged (const QStringList &wordLists); + void currentListChanged (const QString &wordList); + +private: + class WordCompletionPrivate; + WordCompletionPrivate *d; +}; + +#endif // KURLCOMPLETION_H |