LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
ijobholder.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QtPlugin>
13
14class QAbstractItemModel;
15class QWidget;
16
17namespace LC
18{
41
78
93 {
100 qlonglong Done_ = 0;
101
108 qlonglong Total_ = 0;
109
118 TaskParameters Params_ = {};
119
140
143 ProcessStateInfo () = default;
144
155 ProcessStateInfo (qlonglong done, qlonglong total, TaskParameters params)
156 : ProcessStateInfo { done, total, params, State::Unknown }
157 {
158 }
159
173 ProcessStateInfo (qlonglong done, qlonglong total, TaskParameters params, State state)
174 : Done_ { done }
175 , Total_ { total }
176 , Params_ { params }
177 , State_ { state }
178 {
179 }
180 };
181
200}
201
203using IJobHolderRepresentationHandler_ptr = std::shared_ptr<IJobHolderRepresentationHandler>;
204
229class Q_DECL_EXPORT IJobHolder
230{
231public:
261 virtual QAbstractItemModel* GetRepresentation () const = 0;
262
264
267 virtual ~IJobHolder () {}
268};
269
272
273Q_DECLARE_INTERFACE (IJobHolder, "org.Deviant.LeechCraft.IJobHolder/1.0")
Interface for plugins holding jobs or persistent notifications.
Definition ijobholder.h:230
virtual ~IJobHolder()
Virtual destructor.
Definition ijobholder.h:267
virtual QAbstractItemModel * GetRepresentation() const =0
Returns the item representation model.
virtual IJobHolderRepresentationHandler_ptr CreateRepresentationHandler()
Definition ijobholder.h:263
std::shared_ptr< IJobHolderRepresentationHandler > IJobHolderRepresentationHandler_ptr
Definition ijobholder.h:203
Definition constants.h:15
JobHolderColumn
Describes the columns in a job holder model.
Definition ijobholder.h:25
@ JobName
The column with the name of the task, like a torrent name or an RSS feed name.
Definition ijobholder.h:29
@ JobProgress
The column with the progress of the task, like the amount of data downloaded so far or last update.
Definition ijobholder.h:39
@ JobStatus
The column with the status of the task, like the download status or the unread items count of an RSS ...
Definition ijobholder.h:34
JobHolderRole
This enum contains roles that are used to query job states.
Definition ijobholder.h:185
@ JobHolderRoleMax
Definition ijobholder.h:198
@ ProcessState
Describes the state of a process.
Definition ijobholder.h:196
@ RoleMAX
Definition structures.h:211
JobHolderRow
Describes the semantics of a row in a job holder model.
Definition ijobholder.h:51
@ Other
Definition ijobholder.h:55
@ DownloadProgress
Definition ijobholder.h:68
@ ProcessProgress
Definition ijobholder.h:76
@ News
Definition ijobholder.h:60
State of a single process represented in a IJobHolder model.
Definition ijobholder.h:93
enum LC::ProcessStateInfo::State State_
ProcessStateInfo(qlonglong done, qlonglong total, TaskParameters params, State state)
Constructs the description with the given values and state.
Definition ijobholder.h:173
qlonglong Done_
The amount of items already processed or downloaded.
Definition ijobholder.h:100
State
Describes the state of the process.
Definition ijobholder.h:123
@ Running
The process is running just fine.
Definition ijobholder.h:130
@ Error
There was an error completing the process.
Definition ijobholder.h:138
@ Paused
The process is paused.
Definition ijobholder.h:134
ProcessStateInfo(qlonglong done, qlonglong total, TaskParameters params)
Constructs the description with the given values.
Definition ijobholder.h:155
qlonglong Total_
The total amount of items to be processed or downloaded.
Definition ijobholder.h:108
ProcessStateInfo()=default
Default-constructs a process description.
TaskParameters Params_
The flags of the task as it was originally added to the downloader, if relevant.
Definition ijobholder.h:118
Q_DECLARE_METATYPE(QVariantList *)