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 MOVIECONTROLLER_H
19 #define MOVIECONTROLLER_H
21 #include "data/scheduleentrykey.h"
22 #include "data/moviekey.h"
28 class ActionController;
29 class ItemModelSortController;
30 class MovieScheduleModel;
31 class QAbstractItemModel;
32 class QSortFilterProxyModel;
34 class MovieController : public QObject
38 MovieController(MovieWindow *movie_window, CinemaSchedule *cinema_schedule, ActionController *action_controller,
39 ItemModelSortController *sort_controller, QThread *search_worker);
42 Q_SLOT void ShowMovie(MovieKey movie_key);
47 Q_SLOT void ScheduleEntrySelected(ScheduleEntryKey schedule_entry_key);
48 Q_SLOT void SearchStarted(int search_task_id);
49 Q_SLOT void Reply(int search_task_id, bool intermediate);
50 Q_SLOT void Error(int search_task_id);
51 Q_SLOT void SearchFinished(int search_task_id, bool success);
53 void Sort(bool intermediate, const char *);
54 Q_SLOT void SortFinished(QAbstractItemModel *model, int search_task_id, bool intermediate);
55 Q_SLOT void SortErrorFinished(QAbstractItemModel *model, int search_task_id, bool intermediate);
56 void SetModel(QAbstractItemModel *model);
59 MovieWindow *_movie_window;
60 CinemaSchedule *_cinema_schedule;
61 ActionController *_action_controller;
62 ItemModelSortController *_sort_controller;
63 QThread *_search_worker;
64 int _current_search_task_id;
65 MovieScheduleModel *_movie_schedule_model;
66 QSortFilterProxyModel *_movie_schedule_proxy_model;
70 #endif // MOVIECONTROLLER_H