comparison src/include/anime.h @ 2:23d0d9319a00

Update Also converted everything to LF from CRLF
author Paper <mrpapersonic@gmail.com>
date Sat, 12 Aug 2023 03:16:26 -0400
parents 1ae666fdf9e2
children 5af270662505
comparison
equal deleted inserted replaced
1:1ae666fdf9e2 2:23d0d9319a00
1 #ifndef __anime_h 1 #ifndef __anime_h
2 #define __anime_h 2 #define __anime_h
3 #include <vector> 3 #include <vector>
4 #include <chrono>
5 #include <map> 4 #include <map>
5 #include "date.h"
6 #include "window.h" 6 #include "window.h"
7 7
8 enum AnimeWatchingStatus { 8 enum AnimeWatchingStatus {
9 CURRENT, 9 CURRENT,
10 PLANNING, 10 PLANNING,
34 NOVEL, 34 NOVEL,
35 ONE_SHOT 35 ONE_SHOT
36 }; 36 };
37 37
38 enum AnimeSeason { 38 enum AnimeSeason {
39 UNKNOWN,
39 WINTER, 40 WINTER,
40 SPRING, 41 SPRING,
41 SUMMER, 42 SUMMER,
42 FALL 43 FALL
43 }; 44 };
48 Anime(const Anime& a); 49 Anime(const Anime& a);
49 /* List-specific data */ 50 /* List-specific data */
50 enum AnimeWatchingStatus status; 51 enum AnimeWatchingStatus status;
51 int progress; 52 int progress;
52 int score; 53 int score;
53 std::chrono::year_month_day started; 54 Date started;
54 std::chrono::year_month_day completed; 55 Date completed;
56 int updated; /* this should be 64-bit */
55 std::wstring notes; 57 std::wstring notes;
56 58
57 /* Useful information */ 59 /* Useful information */
58 int id; 60 int id;
59 std::wstring title; 61 struct {
62 std::wstring romaji;
63 std::wstring english;
64 std::wstring native;
65 } title;
60 int episodes; 66 int episodes;
61 enum AnimeAiringStatus airing; 67 enum AnimeAiringStatus airing;
62 std::chrono::year_month_day air_date; 68 Date air_date;
63 std::vector<std::string> genres; 69 std::vector<std::string> genres;
64 std::vector<std::string> producers; 70 std::vector<std::string> producers;
65 enum AnimeFormat type; 71 enum AnimeFormat type;
66 enum AnimeSeason season; 72 enum AnimeSeason season;
67 int audience_score; 73 int audience_score;
84 std::vector<Anime>::iterator end() noexcept; 90 std::vector<Anime>::iterator end() noexcept;
85 std::vector<Anime>::const_iterator cbegin() noexcept; 91 std::vector<Anime>::const_iterator cbegin() noexcept;
86 std::vector<Anime>::const_iterator cend() noexcept; 92 std::vector<Anime>::const_iterator cend() noexcept;
87 size_t Size() const; 93 size_t Size() const;
88 Anime* AnimeById(int id); 94 Anime* AnimeById(int id);
95 int GetAnimeIndex(Anime& anime) const;
89 bool AnimeInList(int id); 96 bool AnimeInList(int id);
90 Anime& operator[](size_t index); 97 Anime& operator[](size_t index);
91 const Anime& operator[](size_t index) const; 98 const Anime& operator[](size_t index) const;
92 std::wstring name; 99 std::wstring name;
93 100
120 int rowCount(const QModelIndex& parent = QModelIndex()) const; 127 int rowCount(const QModelIndex& parent = QModelIndex()) const;
121 int columnCount(const QModelIndex& parent = QModelIndex()) const; 128 int columnCount(const QModelIndex& parent = QModelIndex()) const;
122 QVariant data(const QModelIndex& index, int role) const; 129 QVariant data(const QModelIndex& index, int role) const;
123 QVariant headerData(const int section, const Qt::Orientation orientation, const int role) const; 130 QVariant headerData(const int section, const Qt::Orientation orientation, const int role) const;
124 Anime* GetAnimeFromIndex(const QModelIndex& index); 131 Anime* GetAnimeFromIndex(const QModelIndex& index);
125 void Update(); 132 void UpdateAnime(Anime& anime);
126 133
127 private: 134 private:
128 //void AddAnime(AnimeList& list); 135 //void AddAnime(AnimeList& list);
129 AnimeList& list; 136 AnimeList& list;
130 }; 137 };