QGCToolbox.h 3.82 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/
dogmaphobic's avatar
dogmaphobic committed
9

10 11 12 13 14 15

#ifndef QGCToolbox_h
#define QGCToolbox_h

#include <QObject>

Don Gagne's avatar
Don Gagne committed
16 17 18 19 20
class AutoPilotPluginManager;
class FactSystem;
class FirmwarePluginManager;
class FlightMapSettings;
class GAudioOutput;
21
class GPSManager;
Don Gagne's avatar
Don Gagne committed
22 23
class HomePositionManager;
class JoystickManager;
Jimmy Johnson's avatar
Jimmy Johnson committed
24
class FollowMe;
25 26
class LinkManager;
class MAVLinkProtocol;
Don Gagne's avatar
Don Gagne committed
27
class MissionCommands;
28
class MultiVehicleManager;
dogmaphobic's avatar
dogmaphobic committed
29
class QGCMapEngineManager;
Don Gagne's avatar
Don Gagne committed
30
class QGCApplication;
dogmaphobic's avatar
dogmaphobic committed
31
class QGCImageProvider;
Don Gagne's avatar
Don Gagne committed
32
class UASMessageHandler;
Jimmy Johnson's avatar
Jimmy Johnson committed
33
class QGCPositionManager;
34 35 36 37 38 39 40 41

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

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

Don Gagne's avatar
Don Gagne committed
42 43 44 45 46 47
    AutoPilotPluginManager*     autopilotPluginManager(void)    { return _autopilotPluginManager; }
    FirmwarePluginManager*      firmwarePluginManager(void)     { return _firmwarePluginManager; }
    FlightMapSettings*          flightMapSettings(void)         { return _flightMapSettings; }
    GAudioOutput*               audioOutput(void)               { return _audioOutput; }
    HomePositionManager*        homePositionManager(void)       { return _homePositionManager; }
    JoystickManager*            joystickManager(void)           { return _joystickManager; }
dogmaphobic's avatar
dogmaphobic committed
48 49
    LinkManager*                linkManager(void)               { return _linkManager; }
    MAVLinkProtocol*            mavlinkProtocol(void)           { return _mavlinkProtocol; }
Don Gagne's avatar
Don Gagne committed
50
    MissionCommands*            missionCommands(void)           { return _missionCommands; }
dogmaphobic's avatar
dogmaphobic committed
51
    MultiVehicleManager*        multiVehicleManager(void)       { return _multiVehicleManager; }
dogmaphobic's avatar
dogmaphobic committed
52
    QGCMapEngineManager*        mapEngineManager(void)          { return _mapEngineManager; }
dogmaphobic's avatar
dogmaphobic committed
53
    QGCImageProvider*           imageProvider()                 { return _imageProvider; }
Don Gagne's avatar
Don Gagne committed
54
    UASMessageHandler*          uasMessageHandler(void)         { return _uasMessageHandler; }
Jimmy Johnson's avatar
Jimmy Johnson committed
55
    FollowMe*                   followMe(void)                  { return _followMe; }
Jimmy Johnson's avatar
Jimmy Johnson committed
56
    QGCPositionManager*         qgcPositionManager(void)        { return _qgcPositionManager; }
Don Gagne's avatar
Don Gagne committed
57 58 59
#ifndef __mobile__
    GPSManager*                 gpsManager(void)                { return _gpsManager; }
#endif
60 61

private:
Don Gagne's avatar
Don Gagne committed
62
    GAudioOutput*               _audioOutput;
dogmaphobic's avatar
dogmaphobic committed
63
    AutoPilotPluginManager*     _autopilotPluginManager;
Don Gagne's avatar
Don Gagne committed
64 65
    FactSystem*                 _factSystem;
    FirmwarePluginManager*      _firmwarePluginManager;
dogmaphobic's avatar
dogmaphobic committed
66
    FlightMapSettings*          _flightMapSettings;
Don Gagne's avatar
Don Gagne committed
67
#ifndef __mobile__
68
    GPSManager*                 _gpsManager;
Don Gagne's avatar
Don Gagne committed
69
#endif
dogmaphobic's avatar
dogmaphobic committed
70
    HomePositionManager*        _homePositionManager;
Don Gagne's avatar
Don Gagne committed
71
    QGCImageProvider*           _imageProvider;
dogmaphobic's avatar
dogmaphobic committed
72
    JoystickManager*            _joystickManager;
Don Gagne's avatar
Don Gagne committed
73 74 75 76
    LinkManager*                _linkManager;
    MAVLinkProtocol*            _mavlinkProtocol;
    MissionCommands*            _missionCommands;
    MultiVehicleManager*        _multiVehicleManager;
dogmaphobic's avatar
dogmaphobic committed
77
    QGCMapEngineManager*         _mapEngineManager;
dogmaphobic's avatar
dogmaphobic committed
78
    UASMessageHandler*          _uasMessageHandler;
Jimmy Johnson's avatar
Jimmy Johnson committed
79
    FollowMe*                   _followMe;
Jimmy Johnson's avatar
Jimmy Johnson committed
80
    QGCPositionManager*         _qgcPositionManager;
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
};

/// 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