2 * Copyright (C) 2010 Ixonos Plc.
3 * Copyright (C) 2011 Philipp Spitzer, gregor herrmann
5 * This file is part of ConfClerk.
7 * ConfClerk is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation, either version 2 of the License, or (at your option)
12 * ConfClerk is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * ConfClerk. If not, see <http://www.gnu.org/licenses/>.
23 #include <QAbstractItemModel>
27 class EventModel : public QAbstractItemModel
30 static const QString COMMA_SEPARATOR; // ", "
33 QVariant data(const QModelIndex& index, int role) const;
34 QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
35 QModelIndex parent ( const QModelIndex & index ) const;
36 int columnCount ( const QModelIndex & parent = QModelIndex() ) const;
37 int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
38 void loadEvents(const QDate &aDate, int aConferenceId); // loads Events from the DB
39 void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB
40 void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events sorted by Track id and Event start from the DB
41 int loadSearchResultEvents(const QDate &aDate, int aConferenceId);
42 void loadEventsByRoom(const QDate &aDate, int aConferenceId);
43 void loadConflictEvents(int aEventId, int aConferenceId); // loads events in conflict
49 Group(const QString & title,
50 int firstEventIndex) :
52 mTitle(title), // e.g. "16:00 - 17:30"
53 mFirstEventIndex(firstEventIndex), // first index within mEvents
54 mChildCount(0) // number of events in mEvents
61 void setTitle(const QList<Event>& mEvents);
65 void createTimeGroups();
66 void createTrackGroups();
67 void createTrackGroupsNew();
68 void createRoomGroups();
71 void updateModel(int aEventId);
76 QHash<int, int> mParents; ///< eventId, groupId
79 #endif // EVENTMODEL_H