Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
baseitem.h
Go to the documentation of this file.
1/*
2 * Sailfin: a Jellyfin client written using Qt
3 * Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library 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 GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19/*
20 * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
21 * OVERWRITTEN AT SOME POINT!
22 *
23 * If there is a bug in this file, please fix the code generator used to generate this file found in
24 * core/openapigenerator.d.
25 *
26 * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
27 * file with a newer file if needed instead of manually updating the files.
28 */
29
30#ifndef JELLYFIN_DTO_BASEITEM_H
31#define JELLYFIN_DTO_BASEITEM_H
32
33#include <QDateTime>
34#include <QJsonObject>
35#include <QJsonValue>
36#include <QList>
37#include <QString>
38#include <QStringList>
39#include <optional>
40
43
44namespace Jellyfin {
45// Forward declaration
46class ApiClient;
47}
48namespace Jellyfin {
49namespace DTO {
50
51
52class BaseItem {
53public:
54 BaseItem(
55 QDateTime dateLastSaved,
56 bool isHD,
57 bool isShortcut,
58 qint32 width,
59 qint32 height,
61 );
62
63 BaseItem(const BaseItem &other);
64
68 void replaceData(BaseItem &other);
69
70 static BaseItem fromJson(QJsonObject source);
71 void setFromJson(QJsonObject source);
72 QJsonObject toJson() const;
73
74 // Properties
75
76 std::optional<qint64> size() const;
77
78 void setSize(std::optional<qint64> newSize);
79 bool sizeNull() const;
80 void setSizeNull();
81
82
83 QString container() const;
84
85 void setContainer(QString newContainer);
86 bool containerNull() const;
87 void setContainerNull();
88
89
90 QDateTime dateLastSaved() const;
91
92 void setDateLastSaved(QDateTime newDateLastSaved);
93
101 void setRemoteTrailers(QList<MediaUrl> newRemoteTrailers);
102 bool remoteTrailersNull() const;
104
105
106 bool isHD() const;
107
108 void setIsHD(bool newIsHD);
109
110
111 bool isShortcut() const;
112
113 void setIsShortcut(bool newIsShortcut);
114
115
116 QString shortcutPath() const;
117
118 void setShortcutPath(QString newShortcutPath);
119 bool shortcutPathNull() const;
120 void setShortcutPathNull();
121
122
123 qint32 width() const;
124
125 void setWidth(qint32 newWidth);
126
127
128 qint32 height() const;
129
130 void setHeight(qint32 newHeight);
131
132
133 QStringList extraIds() const;
134
135 void setExtraIds(QStringList newExtraIds);
136 bool extraIdsNull() const;
137 void setExtraIdsNull();
138
139
140 bool supportsExternalTransfer() const;
141
142 void setSupportsExternalTransfer(bool newSupportsExternalTransfer);
143
144
145protected:
146 std::optional<qint64> m_size = std::nullopt;
147 QString m_container;
150 bool m_isHD;
153 qint32 m_width;
154 qint32 m_height;
155 QStringList m_extraIds;
157
158private:
159 // Private constructor which generates an invalid object, for use withing BaseItem::fromJson();
160 BaseItem();
161};
162
163
164} // NS DTO
165
166namespace Support {
167
169
170template <>
171BaseItem fromJsonValue(const QJsonValue &source, convertType<BaseItem>);
172
173template<>
174QJsonValue toJsonValue(const BaseItem &source, convertType<BaseItem>);
175
176} // NS DTO
177} // NS Jellyfin
178
179#endif // JELLYFIN_DTO_BASEITEM_H
Definition baseitem.h:52
bool m_isShortcut
Definition baseitem.h:151
void setSize(std::optional< qint64 > newSize)
Definition baseitem.cpp:143
void setWidth(qint32 newWidth)
Definition baseitem.cpp:213
bool isShortcut() const
Definition baseitem.cpp:192
QDateTime dateLastSaved() const
Definition baseitem.cpp:167
void setShortcutPath(QString newShortcutPath)
Definition baseitem.cpp:200
bool remoteTrailersNull() const
Definition baseitem.cpp:178
bool sizeNull() const
Definition baseitem.cpp:146
std::optional< qint64 > m_size
Definition baseitem.h:146
qint32 width() const
Definition baseitem.cpp:211
QStringList m_extraIds
Definition baseitem.h:155
qint32 m_height
Definition baseitem.h:154
bool isHD() const
Definition baseitem.cpp:186
bool containerNull() const
Definition baseitem.cpp:159
QJsonObject toJson() const
Definition baseitem.cpp:104
void setExtraIdsNull()
Definition baseitem.cpp:232
void setIsShortcut(bool newIsShortcut)
Definition baseitem.cpp:194
void replaceData(BaseItem &other)
Definition baseitem.cpp:68
void setSizeNull()
Definition baseitem.cpp:150
QString m_shortcutPath
Definition baseitem.h:152
std::optional< qint64 > size() const
Definition baseitem.cpp:141
void setFromJson(QJsonObject source)
Definition baseitem.cpp:89
bool m_isHD
Definition baseitem.h:150
void setContainerNull()
Definition baseitem.cpp:163
void setDateLastSaved(QDateTime newDateLastSaved)
Definition baseitem.cpp:169
void setSupportsExternalTransfer(bool newSupportsExternalTransfer)
Definition baseitem.cpp:238
bool m_supportsExternalTransfer
Definition baseitem.h:156
void setExtraIds(QStringList newExtraIds)
Definition baseitem.cpp:225
void setShortcutPathNull()
Definition baseitem.cpp:207
QString shortcutPath() const
Definition baseitem.cpp:198
void setRemoteTrailers(QList< MediaUrl > newRemoteTrailers)
Gets or sets the remote trailers.
Definition baseitem.cpp:175
QList< MediaUrl > remoteTrailers() const
Gets or sets the remote trailers.
Definition baseitem.cpp:173
void setIsHD(bool newIsHD)
Definition baseitem.cpp:188
qint32 m_width
Definition baseitem.h:153
QDateTime m_dateLastSaved
Definition baseitem.h:148
QString m_container
Definition baseitem.h:147
void setHeight(qint32 newHeight)
Definition baseitem.cpp:219
bool supportsExternalTransfer() const
Definition baseitem.cpp:236
bool extraIdsNull() const
Definition baseitem.cpp:228
static BaseItem fromJson(QJsonObject source)
Definition baseitem.cpp:82
void setRemoteTrailersNull()
Definition baseitem.cpp:182
QString container() const
Definition baseitem.cpp:154
QList< MediaUrl > m_remoteTrailers
Definition baseitem.h:149
QStringList extraIds() const
Definition baseitem.cpp:223
qint32 height() const
Definition baseitem.cpp:217
bool shortcutPathNull() const
Definition baseitem.cpp:203
void setContainer(QString newContainer)
Definition baseitem.cpp:156
Definition mediaplayer2.h:20
AccessSchedule fromJsonValue(const QJsonValue &source, convertType< AccessSchedule >)
Definition accessschedule.cpp:133
QJsonValue toJsonValue(const AccessSchedule &source, convertType< AccessSchedule >)
Definition accessschedule.cpp:139
Definition jsonconvimpl.h:45