/*Copyright (C) 2010-2012 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_TEXT_MENU
#define DEF_TEXT_MENU

#include "Menu.hpp"
#include "GUI/Basic/Buttons/TextButton.hpp"

class TextMenu : public Menu
{
    public:
        TextMenu();
        TextMenu(const TextButton &sampleButton, float space, int orientation);
        void draw();
        
        //Menu virtual methods
        void launch();
        void update(const Vector &mousePosition, bool mouseClicked);
        
        bool browsed() const;
        const std::vector<std::string> &result() const;
        
        float getWidth() const;
        float getHeight() const;
        
        //TextMenu specific methods
            //Style methods
        void applyStyleNow();
        
            //Get and set methods
        void setOrientation(int orientation);
        int getOrientation() const;
        
        void setStyleSample(const TextButton &sampleStyle);
        const TextButton &getStyleSample() const;
        
        void setButtonsSpace(float space);
        float getButtonsSpace() const;
    
    private:
        void draw(TiXmlElement *itemsList);
        
        std::vector<TextButton> m_buttonsList;
        std::vector<std::string> m_selections;
        
        TextButton m_sampleStyle;
        float m_buttonSpace;
        int m_orientation;
        
        bool m_browsed;
};

#endif
