GCompris-qt
Inherits QtQuick.Item, and Item.
Signals | |
void | error (string msg) |
Public Member Functions | |
void | appendRandomWord (string word) |
void | getLevelWordList (int level) |
void | getMaxSubLevel (int level) |
void | getRandomWord () |
void | initRandomWord (int level) |
void | loadFromFile (string fname) |
Properties | |
string | defaultFilename |
string | filename |
bool | useDefault |
object | wordList |
Detailed Description
A Wordlist component loads and maintains GCompris wordlists.
It loads wordlists from json-files, validates its content and exposes wordlists and levels to activities.
It expects and returns the following wordlist format (UTF8 encoded):
- See also
- JsonParser
Definition at line 50 of file Wordlist.qml.
Member Function Documentation
void Wordlist::appendRandomWord | ( | string | word | ) |
|
signal |
Emitted if an error occurs.
- Parameters
-
msg Error message.
void Wordlist::getLevelWordList | ( | int | level | ) |
Get wordlist data for level
.
- Parameters
-
level Level.
- Returns
- type:object wordlist data.
void Wordlist::getMaxSubLevel | ( | int | level | ) |
Get number of sub-levels in level
.
- Parameters
-
level Level.
- Returns
- type:int Number of sublevels.
void Wordlist::getRandomWord | ( | ) |
Returns the next random word from a shuffled wordlist.
- See also
- initRandomWord
void Wordlist::initRandomWord | ( | int | level | ) |
Build a random word list for level
.
We don't want to propose several time the same word. First call initRandomWord(level) to create the initial shuffled list of words. Then call getRandomWord() to get the words one at a time. If a word was not found by the child, add it again to the list with appendRandomWord(word)
- Parameters
-
level Level.
void Wordlist::loadFromFile | ( | string | fname | ) |
Load Wordlist from file fname
.
- Parameters
-
fname Filename to load wordlist from.
Property Documentation
string Wordlist::defaultFilename |
Default filename to be used if the language specific wordlist file could not be loaded.
Default is emtpy.
Definition at line 58 of file Wordlist.qml.
string Wordlist::filename |
Name of the file to load the language specific wordlist from.
Default is empty. Can also be passed directly in loadFromFile(). If set in the QML definition, the wordlist is autoloaded onCompleted.
Definition at line 72 of file Wordlist.qml.
bool Wordlist::useDefault |
Whether to automatically fallback to the default filename if the language specific wordlist file could not be loaded.
Default is true.
Definition at line 65 of file Wordlist.qml.
object Wordlist::wordList |
Complete Wordlist content loaded.
You probably want to use one of the convenience accessors like getLevelWordList(). Default is empty.
Definition at line 79 of file Wordlist.qml.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:48 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.