A few new icons...
[kdeaccessibility.git] / kmouth / wordcompletion / wordcompletion.h
blobf0cb812e9e815fa323796fce6940ea1cee110302
1 #ifndef WORDCOMPLETION_H
2 #define WORDCOMPLETION_H
4 #include <kcompletion.h>
6 /**
7 * This class does completion based on a dictionary of words.
8 */
9 class WordCompletion : public KCompletion {
10 friend class WordListWidget;
11 Q_OBJECT
12 public:
13 WordCompletion();
14 virtual ~WordCompletion();
16 /**
17 * Returns the names for the available word lists
19 QStringList wordLists();
21 /**
22 * Returns the names for those word lists that contain
23 * words of a given language.
25 QStringList wordLists(const QString &language);
27 /**
28 * Returns the language of a given word list.
30 QString languageOfWordList(const QString &wordlist);
32 /**
33 * Returns the name of the currently active word list.
35 QString currentWordList();
37 /**
38 * Finds completions to the given text.
40 virtual QString makeCompletion(const QString&);
42 static bool isConfigured();
44 /**
45 * Adds the words from the given sentence to the list of words.
47 void addSentence (const QString &sentence);
49 public slots:
50 /**
51 * Re-reads the configuration.
53 void configure();
55 /**
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
58 * list gets used.
59 * The method returns true if the specified word list was found.
61 bool setWordList(const QString &wordlist);
63 /**
64 * Saves the added words to disk.
66 void save ();
68 signals:
69 void wordListsChanged (const QStringList &wordLists);
70 void currentListChanged (const QString &wordList);
72 private:
73 class WordCompletionPrivate;
74 WordCompletionPrivate *d;
77 #endif // KURLCOMPLETION_H