1 // Copyright 2010 Jochen Becher
3 // This file is part of MovieSchedule.
5 // MovieSchedule is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // MovieSchedule is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with MovieSchedule. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef THEATERCONTROLLER_H
19 #define THEATERCONTROLLER_H
21 #include "data/scheduleentrykey.h"
22 #include "data/cinemakey.h"
28 class TheaterScheduleModel;
29 class ItemModelSortController;
31 class ActionController;
32 class QAbstractItemModel;
33 class QSortFilterProxyModel;
35 class TheaterController : public QObject
39 TheaterController(TheaterWindow *theater_window, CinemaSchedule *cinema_schedule, ActionController *action_controller,
40 ItemModelSortController *sort_controller, QThread *search_worker);
43 Q_SLOT void ShowTheater(CinemaKey cinema_key);
48 Q_SLOT void ScheduleEntrySelected(ScheduleEntryKey schedule_entry_key);
49 Q_SLOT void SearchStarted(int search_task_id);
50 Q_SLOT void Reply(int search_task_id, bool intermediate);
51 Q_SLOT void Error(int search_task_id);
52 Q_SLOT void SearchFinished(int search_task_id, bool success);
54 void Sort(bool intermediate, const char *);
55 Q_SLOT void SortFinished(QAbstractItemModel *model, int search_task_id, bool intermediate);
56 Q_SLOT void SortErrorFinished(QAbstractItemModel *model, int search_task_id, bool intermediate);
57 void SetModel(QAbstractItemModel *model);
60 TheaterWindow *_theater_window;
61 CinemaSchedule *_cinema_schedule;
62 ActionController *_action_controller;
63 ItemModelSortController *_sort_controller;
64 QThread *_search_worker;
65 int _current_search_task_id;
66 TheaterScheduleModel *_theater_schedule_model;
67 QSortFilterProxyModel *_theater_schedule_proxy_model;
68 CinemaKey _cinema_key;
71 #endif // THEATERCONTROLLER_H