RemoteList integration to SelectRemoteDlg
[irwi] / src / remotelist.h
1 #ifndef _REMOTELIST_H_
2 #define _REMOTELIST_H_
3
4 #include <QDomDocument>
5 #include <QStringList>
6 #include <QMap>
7 #include <QList>
8 #include "model.h"
9
10 class RemoteList
11 {
12 public:
13     RemoteList();
14     RemoteList(const RemoteList &);
15     RemoteList(QDomDocument &);
16     ~RemoteList();
17     
18     void setContent(QDomDocument &);
19
20     // Returns false if document is not set or it's invalid
21     bool isValid();
22
23     QStringList letters();
24     QStringList manufacturers(const QString &letter);
25     QList<Model> models(const QString &manufacturer);
26
27 private:
28     void parse(QDomDocument &doc);
29     QStringList parseMfgs(QDomElement &charEl);
30     QList<Model> parseModels(QDomElement &mfgEl);
31     
32 private:
33     bool valid;
34     QMap<QString, QStringList> mfgMap;
35     QMap<QString, QList<Model> > modelMap;
36 };
37
38 #endif // _REMOTELIST_H_
39
40
41