#ifndef INFORMATIONSCREENCONTROLLER_H
#define INFORMATIONSCREENCONTROLLER_H

#include <Controller/controller.h>
#include <View/informationscreen.h>

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

    /*!
     * \brief InformationScreenController constructor.
     * \param view Information screen view.
     */
    InformationScreenController(InformationScreen* view);

    /*!
     * \brief checkGeneralMenuSize Checks the number of elements and if it is correct, sets the value into the information model.
     */
    void checkGeneralMenuSize();

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

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

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

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

    /*!
     * \brief cardSize Gets the screen card rows and columns and sets it into the information model.
     */
    void cardSize();

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

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

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

    /*!
     * \brief cardTitle Gets the screen card title and sets it into the information model.
     */
    void cardTitle();

    /*!
     * \brief cardIcon Gets the screen image path and sets it into the information model.
     */
    void cardIcon();

    /*!
     * \brief addProperty Gets the screen property and sets it into the information model.
     */
    void addProperty();

    /*!
     * \brief removeProperty Gets the screen property and removes it into the information model.
     */
    void removeProperty();

    /*!
     * \brief changeProperty Gets the screen property and edits it into the information model.
     */
    void changeProperty();

    /*!
     * \brief selectProperty Gets the clicked property and shows the property values.
     */
    void selectProperty();

    /*!
     * \brief nextCard Changes the current card.
     */
    void nextCard();

    /*!
     * \brief updateCardViewProgress Update the progress view.
     */
    void updateCardViewProgress();

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

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


private:

    /*!
     * \brief currentCard Current card index.
     */
    int currentCard;

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

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

    /*!
     * \brief setViewInfo Shows card information.
     */
    void setViewInfo();

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

    /*!
     * \brief checkMenuSize Checks the size of the elements in the screen.
     * \param icons Number of cards.
     * \param rows Number of rows.
     * \param cols Numbers of columns.
     * \return Error found during the check, if there is no errors, returns empty QString.
     */
    QString checkMenuSize(int icons, int rows, int cols);

};

#endif // INFORMATIONSCREENCONTROLLER_H
