Skip to content
Snippets Groups Projects
QGCToolbox.h 4.25 KiB
Newer Older
  • Learn to ignore specific revisions
  • /****************************************************************************
     *
     *   (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.
     *
     ****************************************************************************/
    
    
    #ifndef QGCToolbox_h
    #define QGCToolbox_h
    
    #include <QObject>
    
    
    Don Gagne's avatar
    Don Gagne committed
    class FactSystem;
    class FirmwarePluginManager;
    
    class AudioOutput;
    
    Don Gagne's avatar
    Don Gagne committed
    class JoystickManager;
    
    Jimmy Johnson's avatar
    Jimmy Johnson committed
    class FollowMe;
    
    class LinkManager;
    class MAVLinkProtocol;
    
    class MissionCommandTree;
    
    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;
    
    class VideoManager;
    
    Gus Grubba's avatar
    Gus Grubba committed
    class MAVLinkLogManager;
    
    class SettingsManager;
    
    
    /// This is used to manage all of our top level services/tools
    
    class QGCToolbox : public QObject {
        Q_OBJECT
    
    
    public:
        QGCToolbox(QGCApplication* app);
    
    
    Don Gagne's avatar
    Don Gagne committed
        FirmwarePluginManager*      firmwarePluginManager(void)     { return _firmwarePluginManager; }
    
        AudioOutput*                audioOutput(void)               { return _audioOutput; }
    
    Don Gagne's avatar
    Don Gagne committed
        JoystickManager*            joystickManager(void)           { return _joystickManager; }
    
    dogmaphobic's avatar
    dogmaphobic committed
        LinkManager*                linkManager(void)               { return _linkManager; }
        MAVLinkProtocol*            mavlinkProtocol(void)           { return _mavlinkProtocol; }
    
        MissionCommandTree*         missionCommandTree(void)        { return _missionCommandTree; }
    
    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; }
    
        VideoManager*               videoManager(void)              { return _videoManager; }
    
    Gus Grubba's avatar
    Gus Grubba committed
        MAVLinkLogManager*          mavlinkLogManager(void)         { return _mavlinkLogManager; }
    
        QGCCorePlugin*              corePlugin(void)                { return _corePlugin; }
    
        SettingsManager*            settingsManager(void)           { return _settingsManager; }
    
    Don Gagne's avatar
    Don Gagne committed
    #ifndef __mobile__
        GPSManager*                 gpsManager(void)                { return _gpsManager; }
    #endif
    
        void setChildToolboxes(void);
    
        void _scanAndLoadPlugins(QGCApplication *app);
    
    
        AudioOutput*                _audioOutput;
    
    Don Gagne's avatar
    Don Gagne committed
        FactSystem*                 _factSystem;
        FirmwarePluginManager*      _firmwarePluginManager;
    
    Don Gagne's avatar
    Don Gagne committed
    #ifndef __mobile__
    
    Don Gagne's avatar
    Don Gagne committed
    #endif
    
    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;
    
        MissionCommandTree*         _missionCommandTree;
    
    Don Gagne's avatar
    Don Gagne committed
        MultiVehicleManager*        _multiVehicleManager;
    
        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;
    
        VideoManager*               _videoManager;
    
    Gus Grubba's avatar
    Gus Grubba committed
        MAVLinkLogManager*          _mavlinkLogManager;
    
        SettingsManager*            _settingsManager;
    
    
        friend class QGCApplication;
    
    };
    
    /// This is the base class for all tools
    class QGCTool : public QObject {
        Q_OBJECT
    
    public:
    
        // All tools must be parented to the QGCToolbox and go through a two phase creation. In the constructor the toolbox
        // should only be passed to QGCTool constructor for correct parenting. It should not be referenced or set in the
        // protected member. Then in the second phase of setToolbox calls is where you can reference the toolbox.
        QGCTool(QGCApplication* app, QGCToolbox* toolbox);
    
        // If you override this method, you must call the base class.
    
        virtual void setToolbox(QGCToolbox* toolbox);
    
    protected:
        QGCApplication* _app;
        QGCToolbox*     _toolbox;
    };
    
    #endif