Marble

DownloadPolicy.h
1// SPDX-FileCopyrightText: 2009 Jens-Michael Hoffmann <jmho@c-xx.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef MARBLE_DOWNLOADPOLICY_H
6#define MARBLE_DOWNLOADPOLICY_H
7
8#include <QString>
9#include <QStringList>
10
11#include "MarbleGlobal.h"
12
13namespace Marble
14{
15
16class DownloadPolicyKey
17{
18 friend bool operator==(DownloadPolicyKey const &lhs, DownloadPolicyKey const &rhs);
19
20public:
21 DownloadPolicyKey();
22 DownloadPolicyKey(const QStringList &hostNames, const DownloadUsage usage);
23 DownloadPolicyKey(const QString &hostName, const DownloadUsage usage);
24
25 QStringList hostNames() const;
26 void setHostNames(const QStringList &hostNames);
27
28 DownloadUsage usage() const;
29 void setUsage(DownloadUsage const usage);
30
31 bool matches(const QString &hostName, const DownloadUsage usage) const;
32
33private:
34 QStringList m_hostNames;
35 DownloadUsage m_usage;
36};
37
38inline bool operator==(const DownloadPolicyKey &lhs, const DownloadPolicyKey &rhs)
39{
40 return lhs.m_hostNames == rhs.m_hostNames && lhs.m_usage == rhs.m_usage;
41}
42
43class DownloadPolicy
44{
45 friend bool operator==(const DownloadPolicy &lhs, const DownloadPolicy &rhs);
46
47public:
48 DownloadPolicy();
49 explicit DownloadPolicy(const DownloadPolicyKey &key);
50
51 int maximumConnections() const;
52 void setMaximumConnections(const int);
53
54 DownloadPolicyKey key() const;
55
56private:
57 DownloadPolicyKey m_key;
58 int m_maximumConnections;
59};
60
61inline bool operator==(const DownloadPolicy &lhs, const DownloadPolicy &rhs)
62{
63 return lhs.m_key == rhs.m_key && lhs.m_maximumConnections == rhs.m_maximumConnections;
64}
65
66}
67
68#endif
bool operator==(const StyleDelim &l, const StyleDelim &r)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.