Skip to content
QGCToolbox.h 3.82 KiB
Newer Older
/****************************************************************************
 *
 *   (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


#ifndef QGCToolbox_h
#define QGCToolbox_h

#include <QObject>

Don Gagne's avatar
Don Gagne committed
class AutoPilotPluginManager;
class FactSystem;
class FirmwarePluginManager;
class FlightMapSettings;
class GAudioOutput;
Don Gagne's avatar
Don Gagne committed
class HomePositionManager;
class JoystickManager;
Jimmy Johnson's avatar
Jimmy Johnson committed
class FollowMe;
class LinkManager;
class MAVLinkProtocol;
Don Gagne's avatar
Don Gagne committed
class MissionCommands;
class MultiVehicleManager;
dogmaphobic's avatar
dogmaphobic committed
class QGCMapEngineManager;
Don Gagne's avatar
Don Gagne committed
class QGCApplication;
dogmaphobic's avatar
dogmaphobic committed
class QGCImageProvider;
Don Gagne's avatar
Don Gagne committed
class UASMessageHandler;
Jimmy Johnson's avatar
Jimmy Johnson committed
class QGCPositionManager;

/// 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
    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
    LinkManager*                linkManager(void)               { return _linkManager; }
    MAVLinkProtocol*            mavlinkProtocol(void)           { return _mavlinkProtocol; }
Don Gagne's avatar
Don Gagne committed
    MissionCommands*            missionCommands(void)           { return _missionCommands; }
dogmaphobic's avatar
dogmaphobic committed
    MultiVehicleManager*        multiVehicleManager(void)       { return _multiVehicleManager; }
dogmaphobic's avatar
dogmaphobic committed
    QGCMapEngineManager*        mapEngineManager(void)          { return _mapEngineManager; }
dogmaphobic's avatar
dogmaphobic committed
    QGCImageProvider*           imageProvider()                 { return _imageProvider; }
Don Gagne's avatar
Don Gagne committed
    UASMessageHandler*          uasMessageHandler(void)         { return _uasMessageHandler; }
Jimmy Johnson's avatar
Jimmy Johnson committed
    FollowMe*                   followMe(void)                  { return _followMe; }
Jimmy Johnson's avatar
Jimmy Johnson committed
    QGCPositionManager*         qgcPositionManager(void)        { return _qgcPositionManager; }
Don Gagne's avatar
Don Gagne committed
#ifndef __mobile__
    GPSManager*                 gpsManager(void)                { return _gpsManager; }
#endif
Don Gagne's avatar
Don Gagne committed
    GAudioOutput*               _audioOutput;
dogmaphobic's avatar
dogmaphobic committed
    AutoPilotPluginManager*     _autopilotPluginManager;
Don Gagne's avatar
Don Gagne committed
    FactSystem*                 _factSystem;
    FirmwarePluginManager*      _firmwarePluginManager;
dogmaphobic's avatar
dogmaphobic committed
    FlightMapSettings*          _flightMapSettings;
Don Gagne's avatar
Don Gagne committed
#ifndef __mobile__
Don Gagne's avatar
Don Gagne committed
#endif
dogmaphobic's avatar
dogmaphobic committed
    HomePositionManager*        _homePositionManager;
Don Gagne's avatar
Don Gagne committed
    QGCImageProvider*           _imageProvider;
dogmaphobic's avatar
dogmaphobic committed
    JoystickManager*            _joystickManager;
Don Gagne's avatar
Don Gagne committed
    LinkManager*                _linkManager;
    MAVLinkProtocol*            _mavlinkProtocol;
    MissionCommands*            _missionCommands;
    MultiVehicleManager*        _multiVehicleManager;
dogmaphobic's avatar
dogmaphobic committed
    QGCMapEngineManager*         _mapEngineManager;
dogmaphobic's avatar
dogmaphobic committed
    UASMessageHandler*          _uasMessageHandler;
Jimmy Johnson's avatar
Jimmy Johnson committed
    FollowMe*                   _followMe;
Jimmy Johnson's avatar
Jimmy Johnson committed
    QGCPositionManager*         _qgcPositionManager;
};

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