1 #ifndef WORDCOMPLETION_H
2 #define WORDCOMPLETION_H
4 #include <kcompletion.h>
7 * This class does completion based on a dictionary of words.
9 class WordCompletion
: public KCompletion
{
10 friend class WordListWidget
;
14 virtual ~WordCompletion();
17 * Returns the names for the available word lists
19 QStringList
wordLists();
22 * Returns the names for those word lists that contain
23 * words of a given language.
25 QStringList
wordLists(const QString
&language
);
28 * Returns the language of a given word list.
30 QString
languageOfWordList(const QString
&wordlist
);
33 * Returns the name of the currently active word list.
35 QString
currentWordList();
38 * Finds completions to the given text.
40 virtual QString
makeCompletion(const QString
&);
42 static bool isConfigured();
45 * Adds the words from the given sentence to the list of words.
47 void addSentence (const QString
&sentence
);
51 * Re-reads the configuration.
56 * Specify which word list gets used for the actual word completion.
57 * If there is no word list with the given name the first configured
59 * The method returns true if the specified word list was found.
61 bool setWordList(const QString
&wordlist
);
64 * Saves the added words to disk.
69 void wordListsChanged (const QStringList
&wordLists
);
70 void currentListChanged (const QString
&wordList
);
73 class WordCompletionPrivate
;
74 WordCompletionPrivate
*d
;
77 #endif // KURLCOMPLETION_H