-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.h
72 lines (61 loc) · 1.67 KB
/
feed.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright 2020-2023 VMware, Inc.
// SPDX-License-Identifier: MIT
#ifndef FEED_H
#define FEED_H
#include <QWidget>
#include <QJsonValue>
#include <QDateTime>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include "report.h"
#include "reportobject.h"
namespace Ui {
class Feed;
}
class Feed : public QWidget
{
Q_OBJECT
public:
explicit Feed(QWidget *parent = nullptr);
~Feed();
void setName(const QString &);
void setDescription(const QString &);
void setAlerts(bool b);
void setLastUpdate(const QDateTime & dateTime);
void setReports(int num);
void setPixmap(const QPixmap & pix);
void fetch_reports();
QString name;
QString description;
QDateTime timestamp_create;
QDateTime timestamp_last_update;
QString server_url;
QString auth, org_key;
QString feed_id; // Link to feed
bool isFeed; // If true, it's a feed, if false is a Watchlist
QStringList report_ids; // For custom watchlist -> links to report
QStringList reports;
QList<ReportObject *> reportList;
int IOC_count;
private:
Ui::Feed *ui;
int reportNumber;
QNetworkAccessManager *manager;
QNetworkReply *reply;
bool network_error;
bool alerts_enabled;
QByteArray jsonReports;
private slots:
void slotError(QNetworkReply::NetworkError);
void slotSslErrors(QList<QSslError>);
void slotFinished();
void on_pushButton_json_view_clicked();
void on_pushButton_download_clicked();
void on_pushButton_expand_clicked();
signals:
void downloadFinished(const QString &);
void new_report(ReportObject *r);
void expand(Feed * f);
void contract(Feed * f);
};
#endif // FEED_H