Krita Source Code Documentation
Loading...
Searching...
No Matches
KisMultiFeedRSSModel.h
Go to the documentation of this file.
1/**************************************************************************
2**
3** This file is part of Qt Creator
4**
5** SPDX-FileCopyrightText: 2011 Nokia Corporation and /or its subsidiary(-ies).
6**
7** Contact: Nokia Corporation (qt-info@nokia.com)
8**
9**
10** SPDX-License-Identifier: LGPL-2.1-only
11**
12** In addition, as a special exception, Nokia gives you certain additional
13** rights. These rights are described in the Nokia Qt LGPL Exception
14** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
15**
16** Other Usage
17**
18** Alternatively, this file may be used in accordance with the terms and
19** conditions contained in a signed written agreement between you and Nokia.
20**
21** If you have questions regarding the use of this file, please contact
22** Nokia at qt-info@nokia.com.
23**
24**************************************************************************/
25
26#ifndef MULTIFEEDRSSMODEL_H
27#define MULTIFEEDRSSMODEL_H
28
29#include <QAbstractListModel>
30#include <QStringList>
31#include <QDateTime>
32
33#include <KisRssReader.h>
34
35#include <kritaui_export.h>
36
37
38class QNetworkReply;
40
41class KRITAUI_EXPORT MultiFeedRssModel : public QAbstractListModel
42{
43 Q_OBJECT
44 Q_PROPERTY(int articleCount READ articleCount WRITE setArticleCount NOTIFY articleCountChanged)
45public:
46 explicit MultiFeedRssModel(QObject *parent = 0);
47 explicit MultiFeedRssModel(KisNetworkAccessManager* nam, QObject *parent = 0);
48 ~MultiFeedRssModel() override;
49
50 QHash<int, QByteArray> roleNames() const override;
51 virtual void addFeed(const QString& feed);
52 void removeFeed(const QString& feed);
53
54 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
55 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
56
57 int articleCount() const {
58 return m_articleCount;
59 }
60
61public Q_SLOTS:
62 void setArticleCount(int arg) {
63 if (m_articleCount != arg) {
64 m_articleCount = arg;
65 Q_EMIT articleCountChanged(arg);
66 }
67 }
68
69Q_SIGNALS:
70 void articleCountChanged(int arg);
72
73private Q_SLOTS:
74 void appendFeedData(QNetworkReply *reply);
75
76private:
81
82 void sortAggregatedFeed();
83 void initialize();
84
85 friend class MockMultiFeedRssModel;
86};
87
88#endif // MULTIFEEDRSSMODEL_H
89
90
Network Access Manager for use with Krita.
KisNetworkAccessManager * m_networkAccessManager
void articleCountChanged(int arg)
void setArticleCount(int arg)