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/>.
21 #include "abstractmainwindow.h"
22 #include "data/location.h"
23 #include "data/cinemakey.h"
24 #include "data/moviekey.h"
26 #include <QModelIndex>
31 class QAbstractItemModel;
39 class MainWindow : public AbstractMainWindow {
42 explicit MainWindow(const CinemaSchedule *cinema_schedule, QWidget *parent = 0);
46 Q_SLOT void SetLocation(Location location);
47 Q_SLOT void SetTheaterModel(QAbstractItemModel *);
48 Q_SLOT void SetMovieModel(QAbstractItemModel *);
49 Q_SLOT void SetError(QString error_text);
52 Q_SIGNAL void SearchTheaters();
53 Q_SIGNAL void SearchMovies();
54 Q_SIGNAL void OpenLocationDialog();
55 Q_SIGNAL void OpenAboutDialog();
56 Q_SIGNAL void TheaterSelected(CinemaKey);
57 Q_SIGNAL void MovieSelected(MovieKey);
58 Q_SIGNAL void CallTheaterByPhone(CinemaKey);
59 Q_SIGNAL void FindRouteToTheater(CinemaKey);
60 Q_SIGNAL void SearchTheaterInWeb(CinemaKey);
61 Q_SIGNAL void SearchMovieInWeb(MovieKey);
64 Q_SLOT void TheaterClicked(QModelIndex);
65 Q_SLOT void TheaterContextMenuRequested(const QPoint &);
66 Q_SLOT void MovieClicked(QModelIndex);
67 Q_SLOT void MovieContextMenuRequested(const QPoint &);
68 Q_SLOT void CallTheaterByPhone();
69 Q_SLOT void FindRouteToTheater();
70 Q_SLOT void SearchTheaterInWeb();
71 Q_SLOT void SearchMovieInWeb();
74 void changeEvent(QEvent *e);
77 CinemaKey GetCinema(const QModelIndex &index);
78 MovieKey GetMovie(const QModelIndex &index);
79 void ShowContextMenu(const Cinema *, const QPoint &pos);
80 void ShowContextMenu(const Movie *, const QPoint &pos);
84 const CinemaSchedule *_cinema_schedule;
85 QMenu *_theater_context_menu;
86 QMenu *_movie_context_menu;
87 QAction *_theater_phone_call;
88 QAction *_theater_find_route;
89 QAction *_theater_search_web;
90 QAction *_movie_search_web;
92 QAbstractItemModel *_theater_model;
93 QAbstractItemModel *_movie_model;
96 #endif // MAINWINDOW_H