Initial commit (software version 0.2.0)
[movie-schedule] / src / data / scheduleentrykey.h
1 // Copyright 2010 Jochen Becher
2 //
3 // This file is part of MovieSchedule.
4 //
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.
9 //
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.
14 //
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/>.
17
18 #ifndef SCHEDULEENTRYKEY_H
19 #define SCHEDULEENTRYKEY_H
20
21 #include "data/cinemakey.h"
22 #include "data/moviekey.h"
23
24 #include <QTime>
25 #include <QDate>
26 #include <QMetaType>
27
28 class ScheduleEntryKey
29 {
30 public:
31     ScheduleEntryKey() {}
32     ScheduleEntryKey(const CinemaKey &cinema_key, const MovieKey &movie_key, const QTime &start_time, const QDate &date);
33
34     CinemaKey GetCinemaKey() const { return _cinema_key; }
35     void SetCinemaKey(const CinemaKey &cinema_key) { _cinema_key = cinema_key; }
36
37     MovieKey GetMovieKey() const { return _movie_key; }
38     void SetMovieKey(const MovieKey &movie_key) { _movie_key = movie_key; }
39
40     QTime GetStartTime() const { return _start_time; }
41     void SetStartTime(const QTime &start_time) { _start_time = start_time; }
42
43     QDate GetDate() const { return _date; }
44     void SetDate(const QDate &date) { _date = date; }
45
46 private:
47     CinemaKey _cinema_key;
48     MovieKey _movie_key;
49     QTime _start_time;
50     QDate _date;
51 };
52
53 Q_DECLARE_METATYPE(ScheduleEntryKey);
54
55 bool operator==(const ScheduleEntryKey &lhs, const ScheduleEntryKey &rhs);
56
57 uint qHash(const ScheduleEntryKey &);
58
59 #endif // SCHEDULEENTRYKEY_H