GPLv2 license
[scorecard] / src / tree-item.h
1 /*
2  * Copyright (C) 2009 Sakari Poussa
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, version 2.
7  */
8
9 #include <QList>
10 #include <QVariant>
11 #include <QStringList>
12
13 #include "data.h"
14
15 class TreeItem
16 {
17
18  public:
19   enum Type { TypeRoot, TypeScore, TypeDate };
20
21   TreeItem();
22   TreeItem(const QString &str);
23   TreeItem(Score *score);
24   ~TreeItem();
25
26 #if 1
27   void appendChild(TreeItem *item);
28   int childCount() const;
29   int columnCount() const;
30   TreeItem *child(int row);
31   QVariant data(int column) const;
32   int row() const;
33 #endif
34
35   Type type;
36   QString str;
37   Score *score;
38
39   QList<TreeItem *> children;
40
41   TreeItem *parent;
42
43 };