~ubuntu-branches/ubuntu/quantal/marble/quantal

« back to all changes in this revision

Viewing changes to src/plugins/render/earthquake/EarthquakeModel.h

  • Committer: Bazaar Package Importer
  • Author(s): Philip Muškovac
  • Date: 2011-07-11 15:43:02 UTC
  • Revision ID: james.westby@ubuntu.com-20110711154302-lq69ftcx125g1jx5
Tags: upstream-4.6.90+repack
Import upstream version 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 2010 Utku Aydin <utkuaydin34@gmail.com>
 
9
//
 
10
 
 
11
#ifndef EARTHQUAKEMODEL_H
 
12
#define EARTHQUAKEMODEL_H
 
13
 
 
14
#include "AbstractDataPluginModel.h"
 
15
#include <QtCore/QDateTime>
 
16
 
 
17
namespace Marble
 
18
{
 
19
 
 
20
class MarbleModel;
 
21
 
 
22
namespace {
 
23
// The maximum number of items we want to show on the screen.
 
24
const quint32 numberOfItemsOnScreen = 20;
 
25
}
 
26
 
 
27
class EarthquakeModel : public AbstractDataPluginModel
 
28
{
 
29
    Q_OBJECT
 
30
 
 
31
public:
 
32
    explicit EarthquakeModel( PluginManager *pluginManager, QObject *parent = 0 );
 
33
    ~EarthquakeModel();
 
34
 
 
35
    void setNumResults( int numResults );
 
36
    void setMinMagnitude( double minMagnitude );
 
37
    void setStartDate( const QDateTime& startDate );
 
38
    void setEndDate( const QDateTime& endDate );
 
39
 
 
40
protected:
 
41
    /**
 
42
     * Generates the download url for the description file from the web service depending on
 
43
     * the @p box surrounding the view and the @p number of files to show.
 
44
     **/
 
45
    virtual void getAdditionalItems( const GeoDataLatLonAltBox& box,
 
46
                                     const MarbleModel *model,
 
47
                                     qint32 number = 10 );
 
48
 
 
49
    /**
 
50
     * Parses the @p file which getAdditionalItems downloads and
 
51
     * prepares the data for usage.
 
52
     **/
 
53
    void parseFile( const QByteArray& file );
 
54
 
 
55
private:
 
56
    int m_numResults;
 
57
    double m_minMagnitude;
 
58
    QDateTime m_startDate;
 
59
    QDateTime m_endDate;
 
60
};
 
61
 
 
62
}
 
63
 
 
64
#endif // EARTHQUAKEMODEL_H