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"
25 #include "data/settings.h"
27 #include <QModelIndex>
32 class QAbstractItemModel;
40 class MainWindow : public AbstractMainWindow {
43 explicit MainWindow(const CinemaSchedule *cinema_schedule, QWidget *parent = 0);
47 Q_SLOT void SetOrientation(Settings::OrientationMode orientation);
48 Q_SLOT void SetLocation(Location location);
49 Q_SLOT void SetTheaterModel(QAbstractItemModel *);
50 Q_SLOT void SetMovieModel(QAbstractItemModel *);
51 Q_SLOT void SetError(QString error_text);
54 Q_SIGNAL void SearchTheaters();
55 Q_SIGNAL void SearchMovies();
56 Q_SIGNAL void OpenLocationDialog();
57 Q_SIGNAL void OpenOptionsDialog();
58 Q_SIGNAL void OpenAboutDialog();
59 Q_SIGNAL void TheaterSelected(CinemaKey);
60 Q_SIGNAL void MovieSelected(MovieKey);
61 Q_SIGNAL void CallTheaterByPhone(CinemaKey);
62 Q_SIGNAL void FindRouteToTheater(CinemaKey);
63 Q_SIGNAL void SearchTheaterInWeb(CinemaKey);
64 Q_SIGNAL void SearchMovieInWeb(MovieKey);
67 Q_SLOT void TheaterClicked(QModelIndex);
68 Q_SLOT void TheaterContextMenuRequested(const QPoint &);
69 Q_SLOT void MovieClicked(QModelIndex);
70 Q_SLOT void MovieContextMenuRequested(const QPoint &);
71 Q_SLOT void CallTheaterByPhone();
72 Q_SLOT void FindRouteToTheater();
73 Q_SLOT void SearchTheaterInWeb();
74 Q_SLOT void SearchMovieInWeb();
77 void changeEvent(QEvent *e);
80 CinemaKey GetCinema(const QModelIndex &index);
81 MovieKey GetMovie(const QModelIndex &index);
82 void ShowContextMenu(const Cinema *, const QPoint &pos);
83 void ShowContextMenu(const Movie *, const QPoint &pos);
87 const CinemaSchedule *_cinema_schedule;
88 QMenu *_theater_context_menu;
89 QMenu *_movie_context_menu;
90 QAction *_theater_phone_call;
91 QAction *_theater_find_route;
92 QAction *_theater_search_web;
93 QAction *_movie_search_web;
95 QAbstractItemModel *_theater_model;
96 QAbstractItemModel *_movie_model;
99 #endif // MAINWINDOW_H