• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
DownloadPolicy.h
Go to the documentation of this file.
1 // Copyright 2009 Jens-Michael Hoffmann <jmho@c-xx.com>
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library. If not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef MARBLE_DOWNLOADPOLICY_H
17 #define MARBLE_DOWNLOADPOLICY_H
18 
19 #include <QString>
20 #include <QStringList>
21 
22 #include "MarbleGlobal.h"
23 
24 namespace Marble
25 {
26 
27 class DownloadPolicyKey
28 {
29  friend bool operator==( DownloadPolicyKey const & lhs, DownloadPolicyKey const & rhs );
30 
31  public:
32  DownloadPolicyKey();
33  DownloadPolicyKey( const QStringList & hostNames, const DownloadUsage usage );
34  DownloadPolicyKey( const QString & hostName, const DownloadUsage usage );
35 
36  QStringList hostNames() const;
37  void setHostNames( const QStringList & hostNames );
38 
39  DownloadUsage usage() const;
40  void setUsage( DownloadUsage const usage );
41 
42  bool matches( const QString & hostName, const DownloadUsage usage ) const;
43 
44  private:
45  QStringList m_hostNames;
46  DownloadUsage m_usage;
47 };
48 
49 inline bool operator==( const DownloadPolicyKey & lhs, const DownloadPolicyKey & rhs )
50 {
51  return lhs.m_hostNames == rhs.m_hostNames && lhs.m_usage == rhs.m_usage;
52 }
53 
54 
55 class DownloadPolicy
56 {
57  friend bool operator==( const DownloadPolicy & lhs, const DownloadPolicy & rhs );
58 
59  public:
60  DownloadPolicy();
61  explicit DownloadPolicy( const DownloadPolicyKey & key );
62 
63  int maximumConnections() const;
64  void setMaximumConnections( const int );
65 
66  DownloadPolicyKey key() const;
67 
68  private:
69  DownloadPolicyKey m_key;
70  int m_maximumConnections;
71 };
72 
73 inline bool operator==( const DownloadPolicy & lhs, const DownloadPolicy & rhs )
74 {
75  return lhs.m_key == rhs.m_key && lhs.m_maximumConnections == rhs.m_maximumConnections;
76 }
77 
78 }
79 
80 #endif
Marble::DownloadPolicy
Definition: DownloadPolicy.h:55
Marble::DownloadPolicy::setMaximumConnections
void setMaximumConnections(const int)
Definition: DownloadPolicy.cpp:84
Marble::DownloadPolicyKey::operator==
friend bool operator==(DownloadPolicyKey const &lhs, DownloadPolicyKey const &rhs)
Definition: DownloadPolicy.h:49
Marble::DownloadUsage
DownloadUsage
This enum is used to describe the type of download.
Definition: MarbleGlobal.h:164
Marble::DownloadPolicyKey
Definition: DownloadPolicy.h:27
Marble::operator==
bool operator==(const DownloadPolicyKey &lhs, const DownloadPolicyKey &rhs)
Definition: DownloadPolicy.h:49
Marble::DownloadPolicy::DownloadPolicy
DownloadPolicy()
Definition: DownloadPolicy.cpp:67
Marble::DownloadPolicyKey::hostNames
QStringList hostNames() const
Definition: DownloadPolicy.cpp:41
Marble::DownloadPolicy::key
DownloadPolicyKey key() const
Definition: DownloadPolicy.cpp:89
Marble::DownloadPolicy::maximumConnections
int maximumConnections() const
Definition: DownloadPolicy.cpp:79
Marble::DownloadPolicyKey::usage
DownloadUsage usage() const
Definition: DownloadPolicy.cpp:51
Marble::DownloadPolicy::operator==
friend bool operator==(const DownloadPolicy &lhs, const DownloadPolicy &rhs)
Definition: DownloadPolicy.h:73
QString
MarbleGlobal.h
Marble::DownloadPolicyKey::matches
bool matches(const QString &hostName, const DownloadUsage usage) const
Definition: DownloadPolicy.cpp:61
QStringList
Marble::DownloadPolicyKey::DownloadPolicyKey
DownloadPolicyKey()
Definition: DownloadPolicy.cpp:21
Marble::DownloadPolicyKey::setUsage
void setUsage(DownloadUsage const usage)
Definition: DownloadPolicy.cpp:56
Marble::DownloadPolicyKey::setHostNames
void setHostNames(const QStringList &hostNames)
Definition: DownloadPolicy.cpp:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal