2 * Copyright (C) 2010 Ixonos Plc.
4 * This file is part of fosdem-schedule.
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)
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
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/>.
22 #include <QAbstractItemModel>
26 class EventModel : public QAbstractItemModel
29 static const QString COMMA_SEPARATOR;
32 QVariant data(const QModelIndex& index, int role) const;
33 QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
34 QModelIndex parent ( const QModelIndex & index ) const;
35 int columnCount ( const QModelIndex & parent = QModelIndex() ) const;
36 int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
37 void loadEvents(const QDate &aDate, int aConferenceId); // loads Events from the DB
38 void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB
39 void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events sorted by Track id and Event start from the DB
40 int loadSearchResultEvents(const QDate &aDate, int aConferenceId);
41 void loadNowEvents(int aConferenceId); // loads Now events from the DB
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) :
53 mFirstEventIndex(firstEventIndex),
63 void createTimeGroups();
64 void createTrackGroups();
65 void createTrackGroupsNew();
66 void createRoomGroups();
69 void updateModel(int aEventId);
74 QHash<int, int> mParents;
77 #endif // EVENTMODEL_H