• 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
AbstractDataPluginModel.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 2009 Bastian Holst <bastianholst@gmx.de>
9 //
10 
11 #ifndef MARBLE_ABSTRACTDATAPLUGINMODEL_H
12 #define MARBLE_ABSTRACTDATAPLUGINMODEL_H
13 
14 #include <QObject>
15 #include <QList>
16 #include <QHash>
17 #include <QString>
18 
19 #include "marble_export.h"
20 #include "MarbleGlobal.h"
21 
22 class QPoint;
23 class QUrl;
24 class QAbstractItemModel;
25 
26 namespace Marble
27 {
28 
29 class AbstractDataPluginModelPrivate;
30 class AbstractDataPluginItem;
31 class GeoDataLatLonAltBox;
32 class MarbleModel;
33 class ViewportParams;
34 
45 class MARBLE_EXPORT AbstractDataPluginModel : public QObject
46 {
47  Q_OBJECT
48 
50  Q_PROPERTY( QObject* favoritesModel READ favoritesModel CONSTANT )
51 
52  public:
53  explicit AbstractDataPluginModel( const QString& name, const MarbleModel *marbleModel, QObject *parent = 0 );
54  virtual ~AbstractDataPluginModel();
55 
56  const MarbleModel *marbleModel() const;
57 
65  QList<AbstractDataPluginItem*> items( const ViewportParams *viewport,
66  qint32 number = 10 );
67 
72  QList<AbstractDataPluginItem *> whichItemAt( const QPoint& curpos );
73 
79  void setItemSettings( QHash<QString,QVariant> itemSettings );
80 
81  virtual void setFavoriteItems( const QStringList& list );
82  QStringList favoriteItems() const;
83 
84  void setFavoriteItemsOnly( bool favoriteOnly );
85  bool isFavoriteItemsOnly() const;
86 
87  QObject* favoritesModel();
88 
93  AbstractDataPluginItem *findItem( const QString& id ) const;
94 
98  bool itemExists( const QString& id ) const;
99 
100 public Q_SLOTS:
105  void addItemsToList( const QList<AbstractDataPluginItem*> &items );
106 
110  void addItemToList( AbstractDataPluginItem *item );
111 
115  void clear();
116 
117  protected:
123  virtual void getAdditionalItems( const GeoDataLatLonAltBox& box,
124  qint32 number = 10 ) = 0;
125 
130  virtual void getItem( const QString &id );
131 
137  virtual void parseFile( const QByteArray& file );
138 
144  void downloadItem( const QUrl& url, const QString& type, AbstractDataPluginItem *item );
145 
154  MARBLE_DEPRECATED( void downloadItemData( const QUrl& url, const QString& type, AbstractDataPluginItem *item ) );
155 
159  void downloadDescriptionFile( const QUrl& url );
160 
164  QString generateFilename( const QString& id, const QString& type ) const;
165 
169  QString generateFilepath( const QString& id, const QString& type ) const;
170 
174  bool fileExists( const QString& fileName ) const;
175 
179  bool fileExists( const QString& id, const QString& type ) const;
180 
181  void registerItemProperties( const QMetaObject& item );
182 
183  private Q_SLOTS:
187  void handleChangedViewport();
188 
195  void processFinishedJob( const QString& relativeUrlString, const QString& id );
196 
200  void removeItem( QObject *item );
201 
202  void favoriteItemChanged( const QString& id, bool isFavorite );
203 
204  void scheduleItemSort();
205 
206  Q_SIGNALS:
207  void itemsUpdated();
208  void favoriteItemsChanged( const QStringList& favoriteItems );
209  void favoriteItemsOnlyChanged();
210 
211  private:
212  AbstractDataPluginModelPrivate * const d;
213  friend class AbstractDataPluginModelPrivate;
214 };
215 
216 }
217 
218 #endif
QByteArray
Marble::AbstractDataPluginItem
Definition: AbstractDataPluginItem.h:28
Marble::AbstractDataPluginModel
An abstract data model (not based on QAbstractModel) for a AbstractDataPlugin.
Definition: AbstractDataPluginModel.h:45
QPoint
QMetaObject
QHash< QString, QVariant >
QObject
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QString
QList< AbstractDataPluginItem * >
MARBLE_DEPRECATED
#define MARBLE_DEPRECATED(func)
Definition: MarbleGlobal.h:274
MarbleGlobal.h
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
QUrl
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
marble_export.h
QAbstractItemModel
Marble::GeoDataLatLonAltBox
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
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