/***
 * Warthog Robotics
 * University of Sao Paulo (USP) at Sao Carlos
 * http://www.warthog.sc.usp.br/
 *
 * This file is part of WRJoy project.
 *
 * This program 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.
 *
 * This program 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ***/

// Prevents multiple definitions
#ifndef WRJOY_JOYSTICKGUI
#define WRJOY_JOYSTICKGUI


// Includes WRJoy
#include <WRJoy/wrjoy.hh>


// Includes Qt library
#include <QtCore/QtCore>
#include <QtWidgets/QtWidgets>

// Includes SDL library
#include <SDL2/SDL.h>


// Selects WRJoy namespace
using namespace WRJoy;


class WRJoy::JoystickGUI::JoystickGUI : public QMainWindow {
    private:
        Joystick* _joystick;

        QTabWidget* _tabWidget;

        QToolBar* _toolBar;
        QAction*  _startJoystickAction;
        QAction*  _stopJoystickAction;
        QAction*  _resetAction;


    public:
        JoystickGUI(Joystick* joystick);


    private:
        void configureMainWindow();
        void configureToolBar();
        void configureTabWidget();
        void configureConnections();

        void configureRunTimeActions(QToolBar* toolBar);
        void configureAdvancedActions(QToolBar* toolBar);


    private slots:
        void startJoystick();
        void stopJoystick();
        void resetJoystick();

        void joystickStarted();
        void joystickStoped();
        void joystickReseted();
        void joystickOpened();
        void joystickClosed();
};


#endif
