FlightMapSettings.h 1.72 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
/****************************************************************************
 *
 *   (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,
        mapProviderStarkart
    } 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);

    static const char* flightMapSettingsGroupName;
    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);

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

    static const char* _settingsGroupName;
};

#endif