#ifndef MENUSCREENCONTROLLER_H
#define MENUSCREENCONTROLLER_H

#include <Controller/controller.h>
#include <View/menuscreen.h>
#include <QObject>

/*!
 * \brief The MenuScreenController class.
 */
class MenuScreenController: public Controller
{    
    Q_OBJECT

public: 

    /*!
     * \brief MenuScreenController constructor.
     * \param view menu screen view.
     */
    MenuScreenController(MenuScreen *view);    

    /*!
     * \brief on_title_options Gets the screen icon title option and sets it into the menu model.
     */
    void on_title_options();

    /*!
     * \brief on_continueBtn_clicked Changes between the primary view and the secondary view.
     */
    void on_continueBtn_clicked();

    /*!
     * \brief automatic_icon_position Gets the screen automatic icon option and sets it into the menu model.
     */
    void automatic_icon_position();

    /*!
     * \brief number_of_icons Gets the screen number of icons and sets it into the menu model.
     */
    void number_of_icons();    

    /*!
     * \brief iconTitle Gets the screen icon title and sets it into the menu model.
     */
    void iconTitle();

    /*!
     * \brief nextIcon Changes the current icon.
     */
    void nextIcon();

    /*!
     * \brief topMargin Gets the screen icon top margin and sets it into the menu model.
     */
    void topMargin();

    /*!
     * \brief rigthMargin Gets the screen icon right margin and sets it into the menu model.
     */
    void rigthMargin();

    /*!
     * \brief bottomMargin Gets the screen icon bottom margin and sets it into the menu model.
     */
    void bottomMargin();

    /*!
     * \brief leftMargin Gets the screen icon left margin and sets it into the menu model.
     */
    void leftMargin();

    /*!
     * \brief colorBackground Gets the screen background color and sets it into the menu model.
     */
    void colorBackground();

    /*!
     * \brief imageBackground Gets the screen background image and sets it into the menu model.
     */
    void imageBackground();

    /*!
     * \brief checkMenuSize Checks the size of the elements in the screen.
     */
    void checkMenuSize();

    /*!
     * \brief heightView Gets the screen height and sets it into the menu model.
     */
    void heightView();

    /*!
     * \brief widthView Gets the screen width and sets it into the menu model.
     */
    void widthView();

    /*!
     * \brief iconImage Gets the icon path image and sets it into the menu model.
     */
    void iconImage();

    /*!
     * \brief setModel Sets the menu model.
     * \param interfaz Interface model.
     */
    void setModel(Interfaz *interfaz);

    /*!
     * \brief goBack Goes to the previous icon, if is the first icon, goes to menu general options.
     */
    void goBack();

private:

    /*!
     * \brief currentIcon Current icon index.
     */
    int currentIcon;

    /*!
     * \brief isFromEdit Whether the interface is made from edition.
     */
    bool isFromEdit;

    /*!
     * \brief isBack Wheter the user has gone back.
     */
    bool isBack;

private:    

    /*!
     * \brief updateIconViewProgress Updates progress view.
     * \param isBack Wheter the user has gone back.
     */
    void updateIconViewProgress(bool isBack = false);

    /*!
     * \brief calculateCurrentIcon Calculates the current icon.
     */
    void calculateCurrentIcon();

    /*!
     * \brief setIconInfo Shows the current icon information.
     */
    void setIconInfo();

    /*!
     * \brief finish Finish the edition and shows the preview of the QML interface.
     */
    void finish();

public slots:

    /*!
     * \brief backExit This slot is executed when goback button is clicked.
     */
    void backExit();


};

#endif // MENUSCREENCONTROLLER_H
