QGCToolbox.h 3.55 KB
Newer Older
1
/*=====================================================================
dogmaphobic's avatar
dogmaphobic committed
2

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

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

7
 This file is part of the QGROUNDCONTROL project
dogmaphobic's avatar
dogmaphobic 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.
dogmaphobic's avatar
dogmaphobic 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.
dogmaphobic's avatar
dogmaphobic 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/>.
dogmaphobic's avatar
dogmaphobic committed
21

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
 ======================================================================*/

#ifndef QGCToolbox_h
#define QGCToolbox_h

#include <QObject>

class QGCApplication;
class LinkManager;
class MAVLinkProtocol;
class MultiVehicleManager;
class JoystickManager;
class UASMessageHandler;
class HomePositionManager;
class FlightMapSettings;
class GAudioOutput;
class FirmwarePluginManager;
class AutoPilotPluginManager;
class FactSystem;
dogmaphobic's avatar
dogmaphobic committed
41
class QGCImageProvider;
42 43 44 45 46 47 48 49

/// This is used to manage all of our top level services/tools
class QGCToolbox {

public:
    QGCToolbox(QGCApplication* app);
    ~QGCToolbox();

dogmaphobic's avatar
dogmaphobic committed
50 51 52 53 54 55 56 57 58 59 60
    LinkManager*                linkManager(void)               { return _linkManager; }
    MAVLinkProtocol*            mavlinkProtocol(void)           { return _mavlinkProtocol; }
    MultiVehicleManager*        multiVehicleManager(void)       { return _multiVehicleManager; }
    JoystickManager*            joystickManager(void)           { return _joystickManager; }
    UASMessageHandler*          uasMessageHandler(void)         { return _uasMessageHandler; }
    HomePositionManager*        homePositionManager(void)       { return _homePositionManager; }
    FlightMapSettings*          flightMapSettings(void)         { return _flightMapSettings; }
    GAudioOutput*               audioOutput(void)               { return _audioOutput; }
    FirmwarePluginManager*      firmwarePluginManager(void)     { return _firmwarePluginManager; }
    AutoPilotPluginManager*     autopilotPluginManager(void)    { return _autopilotPluginManager; }
    QGCImageProvider*           imageProvider()                 { return _imageProvider; }
61 62

private:
dogmaphobic's avatar
dogmaphobic committed
63 64 65 66 67 68 69 70 71 72 73 74
    FirmwarePluginManager*      _firmwarePluginManager;
    AutoPilotPluginManager*     _autopilotPluginManager;
    LinkManager*                _linkManager;
    MultiVehicleManager*        _multiVehicleManager;
    MAVLinkProtocol*            _mavlinkProtocol;
    FlightMapSettings*          _flightMapSettings;
    HomePositionManager*        _homePositionManager;
    JoystickManager*            _joystickManager;
    GAudioOutput*               _audioOutput;
    UASMessageHandler*          _uasMessageHandler;
    FactSystem*                 _factSystem;
    QGCImageProvider*           _imageProvider;
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
};

/// This is the base class for all tools
class QGCTool : public QObject {
    Q_OBJECT

public:
    // All tools are parented to QGCAppliation and go through a two phase creation. First all tools are newed,
    // and then setToolbox is called on all tools. The prevents creating an circular dependencies at constructor
    // time.
    QGCTool(QGCApplication* app);

    virtual void setToolbox(QGCToolbox* toolbox);

protected:
    QGCApplication* _app;
    QGCToolbox*     _toolbox;
};

#endif