Messagelib

remotecontentmanager.h
1 /*
2  SPDX-FileCopyrightText: 2020-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "messageviewer_private_export.h"
10 #include <QObject>
11 #include <QUrl>
12 namespace MessageViewer
13 {
14 class RemoteContentInfo;
15 /**
16  * @brief The RemoteContentManager class
17  * @author Laurent Montel <[email protected]>
18  */
19 class MESSAGEVIEWER_TESTS_EXPORT RemoteContentManager : public QObject
20 {
21  Q_OBJECT
22 public:
23  explicit RemoteContentManager(QObject *parent = nullptr);
24  ~RemoteContentManager() override;
25  static RemoteContentManager *self();
26  void clear();
27 
28  Q_REQUIRED_RESULT bool isAutorized(const QString &url) const;
29  Q_REQUIRED_RESULT bool isAutorized(const QUrl &url, bool &contains) const;
30 
31  void addRemoteContent(const RemoteContentInfo &info);
32  Q_REQUIRED_RESULT QVector<RemoteContentInfo> removeContentInfo() const;
33 
34  void setRemoveContentInfo(const QVector<RemoteContentInfo> &removeContentInfo);
35 
36  Q_REQUIRED_RESULT bool isUnique(const RemoteContentInfo &newInfo) const;
37 
38  Q_REQUIRED_RESULT bool isBlocked(const QUrl &url, bool &contains) const;
39 
40 private:
41  void loadSettings();
42  void writeSettings();
43  QVector<RemoteContentInfo> mRemoveContentInfo;
44 };
45 }
46 
The RemoteContentInfo class.
The RemoteContentManager class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Dec 6 2021 23:04:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.