File indexing completed on 2024-05-05 03:50:49

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2011 Valery Kharitonov <kharvd@gmail.com>
0004 //
0005 
0006 #ifndef POSTALCODEMODEL_H
0007 #define POSTALCODEMODEL_H
0008 
0009 #include "AbstractDataPluginModel.h"
0010 
0011 namespace Marble {
0012 
0013 class PostalCodeModel : public AbstractDataPluginModel
0014 {
0015     Q_OBJECT
0016 
0017  public:
0018     explicit PostalCodeModel( const MarbleModel *marbleModel, QObject *parent = nullptr );
0019     ~PostalCodeModel() override;
0020 
0021  protected:
0022     /**
0023      * Generates the download url for the description file from the web service depending on
0024      * the @p box surrounding the view and the @p number of files to show.
0025      **/
0026     void getAdditionalItems( const GeoDataLatLonAltBox& box,
0027                              qint32 number = 10 ) override;
0028 
0029     /**
0030      * Parses the @p file which getAdditionalItems downloads and
0031      * prepares the data for usage.
0032      **/
0033     void parseFile( const QByteArray& file ) override;
0034 
0035 private:
0036     static void addLine( QString* string, const QString &line );
0037 };
0038 
0039 }
0040 
0041 #endif // POSTALCODEMODEL_H