]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/mvc/event.h
Add .pro.user.* to svn:ignore and remove it in the release target.
[toast/confclerk.git] / src / mvc / event.h
index 4fcd3ed4b04d0bdfa57d1de825b79959f56f8c31..3dc6b8fd71aef4c6820c135b172a99f0424b282f 100644 (file)
@@ -1,20 +1,21 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
+ * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
- * This file is part of fosdem-schedule.
+ * This file is part of ConfClerk.
  *
- * fosdem-schedule is free software: you can redistribute it and/or modify it
+ * ConfClerk is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation, either version 2 of the License, or (at your option)
  * any later version.
  *
- * fosdem-schedule is distributed in the hope that it will be useful, but
+ * ConfClerk is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
+ * ConfClerk.  If not, see <http://www.gnu.org/licenses/>.
  */
 #ifndef EVENT_H
 #define EVENT_H
@@ -25,6 +26,8 @@
 
 #include <ormrecord.h>
 
+class Room;
+
 /**
   NoSuchEventException is thrown when required event does not exist.
 */
@@ -35,6 +38,7 @@ class NoSuchEventException
 class Event : public OrmRecord<Event>
 {
 public:
+    Event();
     static const QSqlRecord sColumns;
     static QString const sTableName;
 public:
@@ -42,7 +46,6 @@ public:
     static QList<Event> getByDate(const QDate & date, int conferenceId, QString orderBy);
     static QList<Event> getFavByDate(const QDate & date, int conferenceId); // get Favourities by Date
     static QList<Event> getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy);
-    static QList<Event> nowEvents(int conferenceId, QString orderBy); // get events scheduled NOW
     static QList<Event> getByTrack(int id);
     static QList<Event> getByDateAndRoom(const QDate& date, int conferenceId);
     static QList<Event> conflictEvents(int aEventId, int conferenceId);
@@ -50,6 +53,7 @@ public:
     int id() const { return value("id").toInt(); }
     int conferenceId() const { return value("xid_conference").toInt(); }
     QDateTime start() const { return value("start").toDateTime(); }
+    /// duration of the event in seconds
     int duration() const { return value("duration").toInt(); }
     int trackId() const { return value("xid_track").toInt(); }
     QString type() const { return value("type").toString(); }
@@ -63,10 +67,11 @@ public:
     QString abstract() const { return value("abstract").toString(); }
     QString description() const { return value("description").toString(); }
     // records from other tables associated with 'id'
-    QString room() const;
-    int roomId() const;
+    Room* room();
+    QString roomName();
+    int roomId();
     QStringList persons();
-    QMap<QString,QString> links() const;
+    QMap<QString,QString> links();
 
     void setId(int id) { setValue("id", id); }
     void setConferenceId(int conferenceId) { setValue("xid_conference", conferenceId); }
@@ -90,7 +95,11 @@ public:
 friend class EventTest;
 
 private:
-    QStringList personsList;
+    QStringList mPersonsList;
+    QMap<QString,QString> mLinksList;
+    int mRoomId;
+    QString mRoomName;
+    Room* room_;
 };
 
 #endif // EVENT_H