/*Copyright (C) 2010-2020 Duncan Deveaux

This file is part of Hikou no mizu.

Hikou no mizu 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.

Hikou no mizu 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 Hikou no mizu.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef DEF_MAIN_TAB
#define DEF_MAIN_TAB

#include "Graphics/Window.hpp"

#include "Configuration/Configuration.hpp"
#include "Engines/Resources/TextureManager.hpp"
#include "Engines/Sound/SoundEngine.hpp"

#include "GUI/Widget/Tab.hpp"
#include "GUI/Widget/Checkbox.hpp"
#include "GUI/Widget/Chooser.hpp"

#include <sstream>

class MainTab : public Tab
{
    public:
        MainTab(Font &labelFont, const Configuration &configuration, TextureManager &manager, SoundEngine &soundEngine, const std::vector<Vector> &displayModes, float width, float height, const Color &color);
        void draw();
        
        bool mouseClick(const Vector &mouseCoords);
        bool mouseMove(const Vector &mouseCoords);
        
        void setLabelFont(Font &font);
        const Font *getLabelFont() const;
        
        void apply(Configuration &configuration);
    
    private:
        Checkbox m_fullscreen, m_dynamicCamera, m_debugMode;
        Chooser m_resolution;
        
        bool addWidget(const std::string &label, Widget &widget, float space);
        
        std::vector< std::pair<Text, Widget*> > m_widgetsList;
        Font *m_labelFont;
        
        float m_horizontalSpace;
};

#endif
