@@ -94,11 +94,12 @@ struct ZipData {
9494
9595/* *
9696 * @struct ListItemData
97- * @brief Represents a Tomb Raider Level Entry Card.
97+ * @brief Represents a Tomb Raider Level Entry Card Info .
9898 *
9999 * This struct is designed to store a single TRLE (Tomb Raider Level Editor) level record.
100100 * Each record contains metadata and a cover image displayed as a card in the application.
101- * The struct includes properties to facilitate searching, filtering, and sorting.
101+ * The struct includes properties to facilitate searching, filtering, and sorting without
102+ * the cover image.
102103 */
103104struct ListItemData {
104105 /* *
@@ -111,29 +112,65 @@ struct ListItemData {
111112 /* *
112113 * @brief Parameterized constructor for `ListItemData`.
113114 *
114- * This constructor initializes a `ListItemData` object with metadata and a cover image.
115- * The image is converted from raw `QByteArray` to a `QIcon` after scaling it to
116- * fit within 640x480 dimensions. The scaling maintains the aspect ratio and
117- * smooths out pixels using `Qt::SmoothTransformation`. The image is centered
118- * within a transparent background if its aspect ratio does not perfectly match the target.
115+ * This constructor initializes a `ListItemData` object with metadata.
119116 *
120- * @param id The database numeric ID.
117+ * @param id The TRLE numeric level ID.
121118 * @param title The TRLE title. Expected to contain a single name.
122- * @param author The TRLE author(s). Can be a single name or multiple names separated by commas and spaces .
119+ * @param author The TRLE author(s). Can be a single name or multiple names.
123120 * @param type The TRLE type, represented by a numeric ID.
124121 * @param classInput The TRLE class, represented by a numeric ID.
125- * @param releaseDate The release date in the format "DD-MMM-YYYY " (e.g., "01-Jan-2000 ").
122+ * @param releaseDate The release date in the format "YYYY-MM-DD " (e.g., "2000- 01-01 ").
126123 * @param difficulty The TRLE difficulty, represented by a numeric ID.
127124 * @param duration The TRLE duration, represented by a numeric ID.
128- * @param imageData The cover image as a `QByteArray`. Supported formats include JPEG, PNG, and WEBP.
129125 */
130126 ListItemData (
131- qint64 id, const QString& title, const QString& author , qint64 type,
127+ qint64 id, const QString& title, const QStringList& authors , qint64 type,
132128 qint64 classInput, const QString& releaseDate, qint64 difficulty,
133- qint64 duration, QByteArray imageData ) :
134- m_id (id), m_title(title), m_author(author ), m_type(type),
129+ qint64 duration) :
130+ m_trle_id (id), m_title(title), m_authors(authors ), m_type(type),
135131 m_class (classInput), m_releaseDate(releaseDate),
136- m_difficulty (difficulty), m_duration(duration) {
132+ m_difficulty (difficulty), m_duration(duration) {}
133+
134+ // Data members
135+ qint64 m_trle_id; // /< The TRLE level id.
136+ QString m_title; // /< The TRLE level title.
137+ QStringList m_authors; // /< The TRLE author(s), as a string list.
138+ qint64 m_type; // /< ID of the type of level.
139+ qint64 m_class; // /< ID of the class of the level.
140+ QString m_releaseDate; // /< The release date in "YYYY-MM-DD" format.
141+ qint64 m_difficulty; // /< ID of the difficulty of the level.
142+ qint64 m_duration; // /< ID of the estimated duration of the level.
143+ };
144+
145+ /* *
146+ * @struct ListItemPicture
147+ * @brief Represents a Tomb Raider Level Entry Card Picture.
148+ *
149+ * This struct is designed to store a single TRLE (Tomb Raider Level Editor) level picture record.
150+ * Each record is a cover image displayed as a card in the application.
151+ */
152+ struct ListItemPicture {
153+ /* *
154+ * @brief Default constructor for `ListItemPicture`.
155+ *
156+ * Initializes an empty instance of `ListItemPicture`.
157+ */
158+ ListItemPicture () {}
159+
160+ /* *
161+ * @brief Parameterized constructor for `ListItemPicture`.
162+ *
163+ * This constructor initializes a `ListItemPicture` object with a cover image.
164+ * The image is converted from raw `QByteArray` to a `QIcon` after scaling it to
165+ * fit within 640x480 dimensions. The scaling maintains the aspect ratio and
166+ * smooths out pixels using `Qt::SmoothTransformation`. The image is centered
167+ * within a transparent background if its aspect ratio does not perfectly match the target.
168+ *
169+ * @param id The TRLE numeric level ID.
170+ * @param imageData The cover image as a `QByteArray`. Supported formats include JPEG, PNG, and WEBP.
171+ */
172+ ListItemPicture (
173+ qint64 id, QByteArray imageData) : m_trle_id(id) {
137174 // Load the image from the byte array
138175 QPixmap pixmap;
139176 pixmap.loadFromData (imageData, " WEBP" );
@@ -169,14 +206,7 @@ struct ListItemData {
169206 }
170207
171208 // Data members
172- qint64 m_id; // /< The database level id.
173- QString m_title; // /< The TRLE level title.
174- QString m_author; // /< The TRLE author(s), as a string.
175- qint64 m_type; // /< ID of the type of level.
176- qint64 m_class; // /< ID of the class of the level.
177- QString m_releaseDate; // /< The release date in "DD-MMM-YYYY" format.
178- qint64 m_difficulty; // /< ID of the difficulty of the level.
179- qint64 m_duration; // /< ID of the estimated duration of the level.
209+ qint64 m_trle_id; // /< The TRLE level id.
180210 QIcon m_picture; // /< The cover image.
181211};
182212
@@ -264,6 +294,7 @@ class Data : public QObject {
264294
265295 qint64 getListRowCount ();
266296 QVector<ListItemData> getListItems ();
297+ QVector<ListItemPicture> getPictures (QList<qint64> trle_ids);
267298 InfoData getInfo (int id);
268299 QString getWalkthrough (int id);
269300 int getType (int id);
0 commit comments