support for view activities with their names added
[toast/confclerk.git] / src / mvc / activity.h
1 /*
2  * activity.h
3  *
4  *  Created on: Dec 27, 2009
5  *      Author: Pavol Korinek
6  */
7
8 #ifndef ACTIVITY_H_
9 #define ACTIVITY_H_
10
11 #include <ormrecord.h>
12
13 class Activity : public OrmRecord<Activity>
14 {
15 public:
16     static const QSqlRecord sColumns;
17     static QString const sTableName;
18     static const int sTableColCount;
19 public:
20     static QList<Activity> getAll();
21     int id() const { return value("id").toInt(); }
22     void setId(int id) { setValue("id", id); }
23     QString name() const { return value("name").toString(); }
24     void setName(const QString & type) { setValue("name", type); }
25 public:
26     static void updateActivityMap();
27     static QString getActivityName(int id);
28 private:
29     static QMap<int, Activity>* mIdToActivity;
30 };
31
32 #endif /* ACTIVITY_H_ */