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
20 public:
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
33 private:
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
43
44class DownloadPolicy
45{
46 friend bool operator==( const DownloadPolicy & lhs, const DownloadPolicy & rhs );
47
48 public:
49 DownloadPolicy();
50 explicit DownloadPolicy( const DownloadPolicyKey & key );
51
52 int maximumConnections() const;
53 void setMaximumConnections( const int );
54
55 DownloadPolicyKey key() const;
56
57 private:
58 DownloadPolicyKey m_key;
59 int m_maximumConnections;
60};
61
62inline bool operator==( const DownloadPolicy & lhs, const DownloadPolicy & rhs )
63{
64 return lhs.m_key == rhs.m_key && lhs.m_maximumConnections == rhs.m_maximumConnections;
65}
66
67}
68
69#endif
Binds a QML item to a specific geodetic location in screen coordinates.
bool operator==(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.