QGroundControlQmlGlobal.h 2.84 KB
Newer Older
1
/*=====================================================================
Gus Grubba's avatar
Gus Grubba committed
2

3
 QGroundControl Open Source Ground Control Station
Gus Grubba's avatar
Gus Grubba committed
4

5
 (c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
Gus Grubba's avatar
Gus Grubba committed
6

7
 This file is part of the QGROUNDCONTROL project
Gus Grubba's avatar
Gus Grubba committed
8

9 10 11 12
 QGROUNDCONTROL is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
Gus Grubba's avatar
Gus Grubba committed
13

14 15 16 17
 QGROUNDCONTROL is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
Gus Grubba's avatar
Gus Grubba committed
18

19 20
 You should have received a copy of the GNU General Public License
 along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
Gus Grubba's avatar
Gus Grubba committed
21

22 23 24 25 26 27 28 29 30 31 32
 ======================================================================*/

/// @file
///     @author Don Gagne <don@thegagnes.com>

#ifndef QGroundControlQmlGlobal_H
#define QGroundControlQmlGlobal_H

#include <QObject>

#include "HomePositionManager.h"
33
#include "FlightMapSettings.h"
34

35 36
class QGCToolbox;

37 38 39 40 41
class QGroundControlQmlGlobal : public QObject
{
    Q_OBJECT

public:
42
    QGroundControlQmlGlobal(QGCToolbox* toolbox, QObject* parent = NULL);
Gus Grubba's avatar
Gus Grubba committed
43

44 45
    Q_PROPERTY(HomePositionManager* homePositionManager READ homePositionManager    CONSTANT)
    Q_PROPERTY(FlightMapSettings*   flightMapSettings   READ flightMapSettings      CONSTANT)
Gus Grubba's avatar
Gus Grubba committed
46 47 48 49 50

    Q_PROPERTY(qreal                zOrderTopMost       READ zOrderTopMost          CONSTANT) ///< z order for top most items, toolbar, main window sub view
    Q_PROPERTY(qreal                zOrderWidgets       READ zOrderWidgets          CONSTANT) ///< z order value to widgets, for example: zoom controls, hud widgetss
    Q_PROPERTY(qreal                zOrderMapItems      READ zOrderMapItems         CONSTANT) ///< z order value for map items, for example: mission item indicators

51 52 53 54 55
    Q_INVOKABLE void    saveGlobalSetting       (const QString& key, const QString& value);
    Q_INVOKABLE QString loadGlobalSetting       (const QString& key, const QString& defaultValue);
    Q_INVOKABLE void    saveBoolGlobalSetting   (const QString& key, bool value);
    Q_INVOKABLE bool    loadBoolGlobalSetting   (const QString& key, bool defaultValue);

56
    // Property accesors
Gus Grubba's avatar
Gus Grubba committed
57 58 59 60 61 62 63 64

    HomePositionManager*    homePositionManager ()      { return _homePositionManager; }
    FlightMapSettings*      flightMapSettings   ()      { return _flightMapSettings; }

    qreal                   zOrderTopMost       ()      { return 1000; }
    qreal                   zOrderWidgets       ()      { return 100; }
    qreal                   zOrderMapItems      ()      { return 50; }

65 66
private:
    HomePositionManager*    _homePositionManager;
67
    FlightMapSettings*      _flightMapSettings;
68 69 70
};

#endif