source: src/mvc/conference.h @ ca90cb1

qt5
Last change on this file since ca90cb1 was ca90cb1, checked in by uzakmat <uzakmat@…>, 12 years ago

A header with the proper copyright/lincence statement was added into each source/header file.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 * Copyright (C) 2010 Ixonos Plc.
3 *
4 * This file is part of fosdem-schedule.
5 *
6 * fosdem-schedule is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 * fosdem-schedule is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef CONFERENCE_H
20#define CONFERENCE_H
21
22#include <QDateTime>
23#include <QVector>
24#include <QStringList>
25
26#include <ormrecord.h>
27
28class Conference : public OrmRecord<Conference>
29{
30public:
31    static QSqlRecord const sColumns;
32    static QString const sTableName;
33
34public:
35    static Conference getById(int id);
36    static QList<Conference> getAll();
37    static int activeConference();
38
39public:
40    int id() const { return value("id").toInt(); }
41    QString title() const { return value("title").toString(); }
42    QString subtitle() const { return value("subtitle").toString(); }
43    QString venue() const { return value("venue").toString(); }
44    QString city() const { return value("city").toString(); }
45    QDate start() const { return value("start").toDate(); }
46    QDate end() const { return value("end").toDate(); }
47    int days() const { return value("days").toInt(); }
48    int dayChange() const { return value("day_change").toInt(); } // in seconds from 00:00
49    int timeslotDuration() const { return value("timeslot_duration").toInt(); } // in seconds
50    bool isActive() const { return value("active").toBool(); }
51
52    void setId(int id) { setValue("id", id); }
53    void setTitle(const QString& title) { setValue("title", title); }
54    void setSubtitle(const QString& subtitle) { setValue("subtitle", subtitle); }
55    void setVenue(const QString& venue) { setValue("venue", venue); }
56    void setCity(const QString& city) { setValue("city", city); }
57    void setStart(const QDate& start) { setValue("start", start); }
58    void setEnd(const QDate& end) { setValue("end", end); }
59    void setDays(int days) { setValue("days", days); }
60    void setDayChange(int dayChange) { setValue("day_change", dayChange); }
61    void setTimeslotDuration(int timeslotDuration) { setValue("timeslot_duration", timeslotDuration); }
62    void setActive(bool active) { setValue("active", (int)((active))); }
63};
64
65#endif /* CONFERENCE_H */
66
Note: See TracBrowser for help on using the repository browser.