• 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
  • cloudsync
CloudRouteModel.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2013 Utku Aydın <utkuaydin34@gmail.com>
9 //
10 
11 #ifndef CLOUDROUTEMODEL_H
12 #define CLOUDROUTEMODEL_H
13 
14 #include "RouteItem.h"
15 
16 #include "marble_export.h"
17 
18 #include <QModelIndex>
19 #include <QNetworkReply>
20 #include <QAbstractListModel>
21 
22 namespace Marble
23 {
24 
25 class MARBLE_EXPORT CloudRouteModel : public QAbstractListModel
26 {
27  Q_OBJECT
28 
29 public:
30  enum RouteRoles {
31  Timestamp = Qt::UserRole + 1,
32  Name,
33  PreviewUrl,
34  Distance,
35  Duration,
36  IsCached,
37  IsDownloading,
38  IsOnCloud
39  };
40 
41  explicit CloudRouteModel( QObject *parent = 0 );
42 
43  QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
44  int rowCount( const QModelIndex& parent = QModelIndex() ) const;
45 
46 #if QT_VERSION >= 0x050000
47 
48  QHash<int, QByteArray> roleNames() const;
49 #endif
50 
55  void setItems( const QVector<RouteItem> &items );
56 
62  bool isCached( const QModelIndex &index ) const;
63 
68  QPersistentModelIndex downloadingItem() const;
69 
74  void setDownloadingItem( const QPersistentModelIndex &index );
75 
81  bool isDownloading( const QModelIndex &index ) const;
82 
87  qint64 totalSize() const;
88 
93  qint64 downloadedSize() const;
94 
101  QIcon preview( const QModelIndex &index ) const;
102 
103 public slots:
104  void updateProgress( qint64 currentSize, qint64 totalSize );
105  void setPreview( QNetworkReply *reply );
106 
107 private:
108  class Private;
109  Private *d;
110 };
111 }
112 
113 #endif // CLOUDROUTEMODEL_H
QModelIndex
Marble::CloudRouteModel
Definition: CloudRouteModel.h:25
RouteItem.h
QNetworkReply
Marble::CloudRouteModel::Distance
Definition: CloudRouteModel.h:34
Marble::CloudRouteModel::IsCached
Definition: CloudRouteModel.h:36
QHash
QObject
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
Marble::CloudRouteModel::RouteRoles
RouteRoles
Definition: CloudRouteModel.h:30
QAbstractListModel
Marble::CloudRouteModel::IsDownloading
Definition: CloudRouteModel.h:37
Marble::CloudRouteModel::Name
Definition: CloudRouteModel.h:32
QPersistentModelIndex
QVector
marble_export.h
Marble::CloudRouteModel::PreviewUrl
Definition: CloudRouteModel.h:33
Marble::CloudRouteModel::Duration
Definition: CloudRouteModel.h:35
QIcon
QVariant
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