/***
 * 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_JOYSTICKMANAGER
#define WRJOY_JOYSTICKMANAGER


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

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

// Selects WRJoy namespace
using namespace WRJoy;


class WRJoy::JoystickManager {
    private:
        QList<Joystick*> _joysticks;

    public:
        ~JoystickManager();

    public:
        QList<Joystick*> joysticks();
        void addJoystick(QString joystickName);
        void delJoystick(QString joystickName);

    public:
        QWidget* joystickWidget(quint8 joystickNumber);

    public:
        void stopAllJoysticks();
        void reset();

    private:
        qint16 joystickIndex(QString joystickName);
};


#endif
