LeechCraft  0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
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>
12 #include "interfaces/structures.h"
13 
14 class QAbstractItemModel;
15 class QWidget;
16 
17 namespace LC
18 {
25  {
30 
35 
40  };
41 
51  {
56 
61 
69 
77  };
78 
93  {
100  qlonglong Done_ = 0;
101 
108  qlonglong Total_ = 0;
109 
118  TaskParameters Params_ = {};
119 
122  enum class State
123  {
126  Unknown,
127 
130  Running,
131 
134  Paused,
135 
138  Error
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 
185  {
197 
199  };
200 }
201 
203 using IJobHolderRepresentationHandler_ptr = std::shared_ptr<IJobHolderRepresentationHandler>;
204 
229 class Q_DECL_EXPORT IJobHolder
230 {
231 public:
261  virtual QAbstractItemModel* GetRepresentation () const = 0;
262 
264 
267  virtual ~IJobHolder () {}
268 };
269 
272 
273 Q_DECLARE_INTERFACE (IJobHolder, "org.Deviant.LeechCraft.IJobHolder/1.0")
The process is running just fine.
ProcessStateInfo(qlonglong done, qlonglong total, TaskParameters params, State state)
Constructs the description with the given values and state.
Definition: ijobholder.h:173
State
Describes the state of the process.
Definition: ijobholder.h:122
virtual ~IJobHolder()
Virtual destructor.
Definition: ijobholder.h:267
ProcessStateInfo(qlonglong done, qlonglong total, TaskParameters params)
Constructs the description with the given values.
Definition: ijobholder.h:155
JobHolderColumn
Describes the columns in a job holder model.
Definition: ijobholder.h:24
The column with the progress of the task, like the amount of data downloaded so far or last update...
Definition: ijobholder.h:39
The column with the name of the task, like a torrent name or an RSS feed name.
Definition: ijobholder.h:29
ProcessStateInfo()=default
Default-constructs a process description.
qlonglong Total_
The total amount of items to be processed or downloaded.
Definition: ijobholder.h:108
State of a single process represented in a IJobHolder model.
Definition: ijobholder.h:92
JobHolderRole
This enum contains roles that are used to query job states.
Definition: ijobholder.h:184
The column with the status of the task, like the download status or the unread items count of an RSS ...
Definition: ijobholder.h:34
Interface for plugins holding jobs or persistent notifications.
Definition: ijobholder.h:229
Q_DECLARE_METATYPE(QVariantList *)
There was an error completing the process.
qlonglong Done_
The amount of items already processed or downloaded.
Definition: ijobholder.h:100
JobHolderRow
Describes the semantics of a row in a job holder model.
Definition: ijobholder.h:50
virtual IJobHolderRepresentationHandler_ptr CreateRepresentationHandler()
Definition: ijobholder.h:263
enum LC::ProcessStateInfo::State State_
std::shared_ptr< IJobHolderRepresentationHandler > IJobHolderRepresentationHandler_ptr
Definition: ijobholder.h:203
TaskParameters Params_
The flags of the task as it was originally added to the downloader, if relevant.
Definition: ijobholder.h:118
Describes the state of a process.
Definition: ijobholder.h:196