X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/blobdiff_plain/6f39595883e1d011cb9bf61a5eab264bd4b8d86e..080dc7d603d45ba0662aa731418993ddd45b5fe8:/src/mvc/eventmodel.h diff --git a/src/mvc/eventmodel.h b/src/mvc/eventmodel.h index b7fafdc..1439edb 100644 --- a/src/mvc/eventmodel.h +++ b/src/mvc/eventmodel.h @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2010 Ixonos Plc. + * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl + * + * This file is part of ConfClerk. + * + * 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. + * + * 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 + * ConfClerk. If not, see . + */ #ifndef EVENTMODEL_H #define EVENTMODEL_H @@ -7,6 +26,8 @@ class EventModel : public QAbstractItemModel { +public: + static const QString COMMA_SEPARATOR; // ", " public: EventModel(); QVariant data(const QModelIndex& index, int role) const; @@ -16,6 +37,11 @@ public: int rowCount ( const QModelIndex & parent = QModelIndex() ) const; void loadEvents(const QDate &aDate, int aConferenceId); // loads Events from the DB void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB + void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events sorted by Track id and Event start from the DB + int loadSearchResultEvents(const QDate &aDate, int aConferenceId); + void loadEventsByRoom(const QDate &aDate, int aConferenceId); + void loadConflictEvents(int aEventId, int aConferenceId); // loads events in conflict + void clearModel(); private: struct Group @@ -23,23 +49,31 @@ private: Group(const QString & title, int firstEventIndex) : - mTitle(title), - mFirstEventIndex(firstEventIndex), - mChildCount(0) + mTitle(title), // e.g. "16:00 - 17:30" + mFirstEventIndex(firstEventIndex), // first index within mEvents + mChildCount(0) // number of events in mEvents {} QString mTitle; int mFirstEventIndex; int mChildCount; + + void setTitle(const QList& mEvents); }; private: void createTimeGroups(); + void createTrackGroups(); + void createTrackGroupsNew(); + void createRoomGroups(); + +public slots: + void updateModel(int aEventId); private: QList mEvents; QList mGroups; - QHash mParents; + QHash mParents; ///< eventId, groupId }; #endif // EVENTMODEL_H