Marble

DownloadPolicy.h
1 // SPDX-FileCopyrightText: 2009 Jens-Michael Hoffmann <[email protected]>
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 
13 namespace Marble
14 {
15 
16 class 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 
38 inline 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 
44 class 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 
62 inline 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
DownloadUsage
This enum is used to describe the type of download.
Definition: MarbleGlobal.h:153
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Sep 25 2023 03:50:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.