FlightMapSettings.h 1.82 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

#ifndef FlightMapSettings_H
#define FlightMapSettings_H

#include "SettingsGroup.h"

class FlightMapSettings : public SettingsGroup
{
    Q_OBJECT

public:
    FlightMapSettings(QObject* parent = NULL);

    // This enum must match the json meta data
    typedef enum {
        mapProviderBing,
        mapProviderGoogle,
Gus Grubba's avatar
Gus Grubba committed
26
        mapProviderStarkart,
Gus Grubba's avatar
Gus Grubba committed
27
        mapProviderMapbox,
28 29
        mapProviderEsri,
        mapProviderEniro
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    } MapProvider_t;

    // This enum must match the json meta data
    typedef enum {
        mapTypeStreet,
        mapTypeSatellite,
        mapTypeHybrid,
        mapTypeTerrain
    } MapType_t;

    Q_PROPERTY(Fact* mapProvider     READ mapProvider   CONSTANT)               ///< Currently selected map provider
    Q_PROPERTY(Fact* mapType         READ mapType       NOTIFY mapTypeChanged)  ///< Current selected map type

    Fact* mapProvider   (void);
    Fact* mapType       (void);

46 47 48
    static const char* name;
    static const char* settingsGroup;

49 50 51 52 53 54 55 56 57 58 59
    static const char* mapProviderSettingsName;
    static const char* mapTypeSettingsName;

signals:
    void mapTypeChanged(void);

private slots:
    void _newMapProvider(QVariant value);

private:
    void _removeEnumValue(int value, QStringList& enumStrings, QVariantList& enumValues);
Gus Grubba's avatar
Gus Grubba committed
60
    void _excludeProvider(MapProvider_t provider);
61 62 63 64 65 66 67 68

    SettingsFact*   _mapProviderFact;
    SettingsFact*   _mapTypeFact;
    QStringList     _savedMapTypeStrings;
    QVariantList    _savedMapTypeValues;
};

#endif