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

#ifndef SettingsManager_H
#define SettingsManager_H

#include "QGCLoggingCategory.h"
#include "Joystick.h"
#include "MultiVehicleManager.h"
#include "QGCToolbox.h"
#include "AppSettings.h"
#include "UnitsSettings.h"
#include "AutoConnectSettings.h"
#include "VideoSettings.h"
21
#include "FlightMapSettings.h"
Don Gagne's avatar
Don Gagne committed
22
#include "RTKSettings.h"
23 24
#include "FlyViewSettings.h"
#include "PlanViewSettings.h"
25
#include "BrandImageSettings.h"
26
#include "OfflineMapsSettings.h"
27
#include "APMMavlinkStreamRateSettings.h"
28 29
#include "FirmwareUpgradeSettings.h"
#include "ADSBVehicleManagerSettings.h"
30
#include "WimaSettings.h"
31
#if defined(QGC_AIRMAP_ENABLED)
32
#include "AirMapSettings.h"
33
#endif
34 35 36 37 38 39 40 41
#include <QVariantList>

/// Provides access to all app settings
class SettingsManager : public QGCTool
{
    Q_OBJECT
    
public:
42
    SettingsManager(QGCApplication* app, QGCToolbox* toolbox);
43

44
#if defined(QGC_AIRMAP_ENABLED)
45
    Q_PROPERTY(QObject* airMapSettings                  READ airMapSettings                 CONSTANT)
46
#endif
47 48 49 50 51 52 53 54 55
    Q_PROPERTY(QObject* appSettings                     READ appSettings                    CONSTANT)
    Q_PROPERTY(QObject* unitsSettings                   READ unitsSettings                  CONSTANT)
    Q_PROPERTY(QObject* autoConnectSettings             READ autoConnectSettings            CONSTANT)
    Q_PROPERTY(QObject* videoSettings                   READ videoSettings                  CONSTANT)
    Q_PROPERTY(QObject* flightMapSettings               READ flightMapSettings              CONSTANT)
    Q_PROPERTY(QObject* rtkSettings                     READ rtkSettings                    CONSTANT)
    Q_PROPERTY(QObject* flyViewSettings                 READ flyViewSettings                CONSTANT)
    Q_PROPERTY(QObject* planViewSettings                READ planViewSettings               CONSTANT)
    Q_PROPERTY(QObject* brandImageSettings              READ brandImageSettings             CONSTANT)
56
    Q_PROPERTY(QObject* offlineMapsSettings             READ offlineMapsSettings            CONSTANT)
57
Q_PROPERTY(QObject* wimaSettings                        READ wimaSettings                   CONSTANT)
58 59
    Q_PROPERTY(QObject* firmwareUpgradeSettings         READ firmwareUpgradeSettings        CONSTANT)
    Q_PROPERTY(QObject* adsbVehicleManagerSettings      READ adsbVehicleManagerSettings     CONSTANT)
60
#if !defined(NO_ARDUPILOT_DIALECT)
61
    Q_PROPERTY(QObject* apmMavlinkStreamRateSettings    READ apmMavlinkStreamRateSettings   CONSTANT)
62
#endif
63 64 65
    // Override from QGCTool
    virtual void setToolbox(QGCToolbox *toolbox);

66
#if defined(QGC_AIRMAP_ENABLED)
67
    AirMapSettings*         airMapSettings      (void) { return _airMapSettings; }
68
#endif
69 70 71 72 73 74 75 76 77
    AppSettings*                    appSettings                 (void) { return _appSettings; }
    UnitsSettings*                  unitsSettings               (void) { return _unitsSettings; }
    AutoConnectSettings*            autoConnectSettings         (void) { return _autoConnectSettings; }
    VideoSettings*                  videoSettings               (void) { return _videoSettings; }
    FlightMapSettings*              flightMapSettings           (void) { return _flightMapSettings; }
    RTKSettings*                    rtkSettings                 (void) { return _rtkSettings; }
    FlyViewSettings*                flyViewSettings             (void) { return _flyViewSettings; }
    PlanViewSettings*               planViewSettings            (void) { return _planViewSettings; }
    BrandImageSettings*             brandImageSettings          (void) { return _brandImageSettings; }
78 79 80
    OfflineMapsSettings*            offlineMapsSettings         (void) { return _offlineMapsSettings; }
    FirmwareUpgradeSettings*        firmwareUpgradeSettings     (void) { return _firmwareUpgradeSettings; }
    ADSBVehicleManagerSettings*     adsbVehicleManagerSettings  (void) { return _adsbVehicleManagerSettings; }
81
    WimaSettings*                   wimaSettings                (void) { return _wimaSettings; }
82
#if !defined(NO_ARDUPILOT_DIALECT)
83
    APMMavlinkStreamRateSettings*   apmMavlinkStreamRateSettings(void) { return _apmMavlinkStreamRateSettings; }
84
#endif
85
private:
86
#if defined(QGC_AIRMAP_ENABLED)
87
    AirMapSettings*         _airMapSettings;
88
#endif
89 90 91 92 93 94 95 96 97
    AppSettings*                    _appSettings;
    UnitsSettings*                  _unitsSettings;
    AutoConnectSettings*            _autoConnectSettings;
    VideoSettings*                  _videoSettings;
    FlightMapSettings*              _flightMapSettings;
    RTKSettings*                    _rtkSettings;
    FlyViewSettings*                _flyViewSettings;
    PlanViewSettings*               _planViewSettings;
    BrandImageSettings*             _brandImageSettings;
98 99 100
    OfflineMapsSettings*            _offlineMapsSettings;
    FirmwareUpgradeSettings*        _firmwareUpgradeSettings;
    ADSBVehicleManagerSettings*     _adsbVehicleManagerSettings;
101
    WimaSettings*                   _wimaSettings;
102
#if !defined(NO_ARDUPILOT_DIALECT)
103
    APMMavlinkStreamRateSettings*   _apmMavlinkStreamRateSettings;
104
#endif
105 106 107
};

#endif