summaryrefslogtreecommitdiff
path: root/src/dictionary/DictionaryReader.h
blob: ca2ff00f3c5c88ab3e30c84c88e6ec5ba1cf016d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef DICTIONARYREADER_H
#define DICTIONARYREADER_H

#include <QXmlStreamReader>
#include <QList>
#include <QString>

class Dictionary;
class CardPack;
class Field;

class DictionaryReader : public QXmlStreamReader
{
public:
    DictionaryReader( Dictionary* aDict );
    bool read( QIODevice* aDevice );

private:
    static const QString MinSupportedDictVersion;

private:
    void readDict();
    void notifyObsoleteVersion( const QString& aOldVersion );
    void readUnknownElement();
    void readDictCurrentVersion();
    void readFields();
    void readField();
    void readPacks();
    void readPack();
    void readEntries();
    void readE();
    void readDict04();
    void readDict03();
    void readE03();

private:
    Dictionary* m_dict;
    QString m_dictVersion;
    CardPack* m_curCardPack;    ///< For 0.4
    QList<const Field*> m_curAnsFieldList;    ///< For 0.4

};

#endif // DICTIONARYREADER_H