/***
 * 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_JOYSTICKMANAGERGUI
#define WRJOY_JOYSTICKMANAGERGUI


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

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

// Selects WRJoy namespace
using namespace WRJoy;


class WRJoy::JoystickManagerGUI::JoystickManagerGUI : public QMainWindow {
    private:
        JoystickManager* _joystickManager;

        QTabWidget* _tabWidget;

        QToolBar* _toolBar;
        QAction*  _addJoystickAction;
        QAction*  _delJoystickAction;
        QAction*  _stopAllJoysticksAction;
        QAction*  _resetServerConnectionAction;
        QAction*  _resetAction;


    public:
        JoystickManagerGUI(JoystickManager* joystickManager);

    private:
        void configureMainWindow();
        void configureToolBar();
        void configureTabWidget();
        void configureConnections();
        void addJoystickTab(Joystick* joystick);

    private slots:
        void addJoystick();
        void delJoystick();
        void stopAllJoysticks();
        void resetServerConnection();
        void reset();
        void delJoystickActionHandler(int currentIndex);
};


#endif
