Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
taskinfo.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_TASKINFO_H
31#define JELLYFIN_DTO_TASKINFO_H
32
33#include <QJsonObject>
34#include <QJsonValue>
35#include <QList>
36#include <QSharedPointer>
37#include <QString>
38#include <QStringList>
39#include <optional>
40
45
46namespace Jellyfin {
47// Forward declaration
48class ApiClient;
49}
50namespace Jellyfin {
51namespace DTO {
52
53
54class TaskInfo {
55public:
56 TaskInfo(
58 QSharedPointer<TaskResult> lastExecutionResult,
59 bool isHidden
60 );
61
62 TaskInfo(const TaskInfo &other);
63
67 void replaceData(TaskInfo &other);
68
69 static TaskInfo fromJson(QJsonObject source);
70 void setFromJson(QJsonObject source);
71 QJsonObject toJson() const;
72
73 // Properties
77 QString name() const;
81 void setName(QString newName);
82 bool nameNull() const;
83 void setNameNull();
84
85
86 TaskState state() const;
87
88 void setState(TaskState newState);
89
93 std::optional<double> currentProgressPercentage() const;
97 void setCurrentProgressPercentage(std::optional<double> newCurrentProgressPercentage);
100
104 QString jellyfinId() const;
108 void setJellyfinId(QString newJellyfinId);
109 bool jellyfinIdNull() const;
110 void setJellyfinIdNull();
111
112
113 QSharedPointer<TaskResult> lastExecutionResult() const;
114
115 void setLastExecutionResult(QSharedPointer<TaskResult> newLastExecutionResult);
116
124 void setTriggers(QList<TaskTriggerInfo> newTriggers);
125 bool triggersNull() const;
126 void setTriggersNull();
127
131 QString description() const;
135 void setDescription(QString newDescription);
136 bool descriptionNull() const;
137 void setDescriptionNull();
138
142 QString category() const;
146 void setCategory(QString newCategory);
147 bool categoryNull() const;
148 void setCategoryNull();
149
153 bool isHidden() const;
157 void setIsHidden(bool newIsHidden);
158
162 QString key() const;
166 void setKey(QString newKey);
167 bool keyNull() const;
168 void setKeyNull();
169
170
171protected:
172 QString m_name;
174 std::optional<double> m_currentProgressPercentage = std::nullopt;
176 QSharedPointer<TaskResult> m_lastExecutionResult = QSharedPointer<TaskResult>();
179 QString m_category;
181 QString m_key;
182
183private:
184 // Private constructor which generates an invalid object, for use withing TaskInfo::fromJson();
185 TaskInfo();
186};
187
188
189} // NS DTO
190
191namespace Support {
192
194
195template <>
196TaskInfo fromJsonValue(const QJsonValue &source, convertType<TaskInfo>);
197
198template<>
199QJsonValue toJsonValue(const TaskInfo &source, convertType<TaskInfo>);
200
201} // NS DTO
202} // NS Jellyfin
203
204#endif // JELLYFIN_DTO_TASKINFO_H
Definition taskinfo.h:54
bool isHidden() const
Gets or sets a value indicating whether this instance is hidden.
Definition taskinfo.cpp:229
bool nameNull() const
Definition taskinfo.cpp:144
void setLastExecutionResult(QSharedPointer< TaskResult > newLastExecutionResult)
Definition taskinfo.cpp:186
QSharedPointer< TaskResult > m_lastExecutionResult
Definition taskinfo.h:176
TaskState state() const
Definition taskinfo.cpp:152
static TaskInfo fromJson(QJsonObject source)
Definition taskinfo.cpp:74
void replaceData(TaskInfo &other)
Definition taskinfo.cpp:61
std::optional< double > m_currentProgressPercentage
Definition taskinfo.h:174
QString m_description
Definition taskinfo.h:178
QString jellyfinId() const
Gets or sets the id.
Definition taskinfo.cpp:171
void setJellyfinId(QString newJellyfinId)
Gets or sets the id.
Definition taskinfo.cpp:173
QSharedPointer< TaskResult > lastExecutionResult() const
Definition taskinfo.cpp:184
bool categoryNull() const
Definition taskinfo.cpp:221
QString m_category
Definition taskinfo.h:179
void setDescription(QString newDescription)
Gets or sets the description.
Definition taskinfo.cpp:205
void setCategoryNull()
Definition taskinfo.cpp:225
QString key() const
Gets or sets the key.
Definition taskinfo.cpp:235
bool triggersNull() const
Definition taskinfo.cpp:195
void setCurrentProgressPercentage(std::optional< double > newCurrentProgressPercentage)
Gets or sets the progress.
Definition taskinfo.cpp:160
QList< TaskTriggerInfo > m_triggers
Definition taskinfo.h:177
TaskState m_state
Definition taskinfo.h:173
void setKeyNull()
Definition taskinfo.cpp:244
void setDescriptionNull()
Definition taskinfo.cpp:212
void setTriggers(QList< TaskTriggerInfo > newTriggers)
Gets or sets the triggers.
Definition taskinfo.cpp:192
void setState(TaskState newState)
Definition taskinfo.cpp:154
bool m_isHidden
Definition taskinfo.h:180
QString description() const
Gets or sets the description.
Definition taskinfo.cpp:203
void setFromJson(QJsonObject source)
Definition taskinfo.cpp:81
void setIsHidden(bool newIsHidden)
Gets or sets a value indicating whether this instance is hidden.
Definition taskinfo.cpp:231
QString name() const
Gets or sets the name.
Definition taskinfo.cpp:139
void setName(QString newName)
Gets or sets the name.
Definition taskinfo.cpp:141
QList< TaskTriggerInfo > triggers() const
Gets or sets the triggers.
Definition taskinfo.cpp:190
void setNameNull()
Definition taskinfo.cpp:148
void setCurrentProgressPercentageNull()
Definition taskinfo.cpp:167
QString m_name
Definition taskinfo.h:172
QString m_jellyfinId
Definition taskinfo.h:175
QString category() const
Gets or sets the category.
Definition taskinfo.cpp:216
void setKey(QString newKey)
Gets or sets the key.
Definition taskinfo.cpp:237
void setCategory(QString newCategory)
Gets or sets the category.
Definition taskinfo.cpp:218
void setTriggersNull()
Definition taskinfo.cpp:199
void setJellyfinIdNull()
Definition taskinfo.cpp:180
bool jellyfinIdNull() const
Definition taskinfo.cpp:176
QString m_key
Definition taskinfo.h:181
QJsonObject toJson() const
Definition taskinfo.cpp:95
bool keyNull() const
Definition taskinfo.cpp:240
bool descriptionNull() const
Definition taskinfo.cpp:208
std::optional< double > currentProgressPercentage() const
Gets or sets the progress.
Definition taskinfo.cpp:158
bool currentProgressPercentageNull() const
Definition taskinfo.cpp:163
Value
Definition taskstate.h:49
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