qBittorrent
rss_folder.h
Go to the documentation of this file.
1 /*
2  * Bittorrent Client using Qt and libtorrent.
3  * Copyright (C) 2017 Vladimir Golovnev <[email protected]>
4  * Copyright (C) 2010 Christophe Dumez <[email protected]>
5  * Copyright (C) 2010 Arnaud Demaiziere <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  * In addition, as a special exception, the copyright holders give permission to
22  * link this program with the OpenSSL project's "OpenSSL" library (or with
23  * modified versions of it that use the same license as the "OpenSSL" library),
24  * and distribute the linked executables. You must obey the GNU General Public
25  * License in all respects for all of the code used other than "OpenSSL". If you
26  * modify file(s), you may extend this exception to your version of the file(s),
27  * but you are not obligated to do so. If you do not wish to do so, delete this
28  * exception statement from your version.
29  */
30 
31 #pragma once
32 
33 #include <QList>
34 #include "rss_item.h"
35 
36 namespace RSS
37 {
38  class Session;
39 
40  class Folder final : public Item
41  {
42  Q_OBJECT
43  Q_DISABLE_COPY_MOVE(Folder)
44 
45  friend class Session;
46 
47  explicit Folder(const QString &path = "");
48  ~Folder() override;
49 
50  public:
51  QList<Article *> articles() const override;
52  int unreadCount() const override;
53  void markAsRead() override;
54  void refresh() override;
55 
56  QList<Item *> items() const;
57 
58  QJsonValue toJsonValue(bool withData = false) const override;
59 
60  private slots:
62 
63  private:
64  void cleanup() override;
65  void addItem(Item *item);
66  void removeItem(Item *item);
67 
68  QList<Item *> m_items;
69  };
70 }
Definition: rss_article.h:43
void cleanup() override
Definition: rss_folder.cpp:113
void markAsRead() override
Definition: rss_folder.cpp:82
void addItem(Item *item)
Definition: rss_folder.cpp:119
void removeItem(Item *item)
Definition: rss_folder.cpp:137
QList< Article * > articles() const override
Definition: rss_folder.cpp:56
void refresh() override
Definition: rss_folder.cpp:88
QList< Item * > items() const
Definition: rss_folder.cpp:94
void handleItemUnreadCountChanged()
Definition: rss_folder.cpp:108
QJsonValue toJsonValue(bool withData=false) const override
Definition: rss_folder.cpp:99
QList< Item * > m_items
Definition: rss_folder.h:68
int unreadCount() const override
Definition: rss_folder.cpp:73
QString path() const
Definition: rss_item.cpp:57