#ifndef INKSCREEN_H
#define INKSCREEN_H

#include <View/view.h>
#include <Model/inktextoption.h>
#include <QPushButton>

namespace Ui {
class InkScreen;
}

/*!
 * \brief The InkScreen class.
 */
class InkScreen : public View
{
    Q_OBJECT

public:

    /*!
     * \brief InkScreen constructor.
     * \param parent Ink screen parent widget.
     */
    explicit InkScreen(QWidget *parent = 0);
    ~InkScreen();

    /*!
     * \brief showError Shows an error message.
     * \param error Message to show.
     */
    void showError(QString error);

    /*!
     * \brief showSuccess Shows a success message.
     * \param success Message to show.
     */
    void showSuccess(QString success);

    /*!
     * \brief showInfo Shows an information message.
     * \param info Message to show.
     */
    void showInfo(QString info);

    /*!
     * \brief getNumberOfElements Returns the number of elements.
     * \return Number of elements.
     */
    int getNumberOfElements();

    /*!
     * \brief getNumberOfCols Returns the number of columns.
     * \return Number of columns.
     */
    int getNumberOfCols();

    /*!
     * \brief getNumberOfRows Returns the number of rows.
     * \return Number of rows.
     */
    int getNumberOfRows();

    /*!
     * \brief getWidth Returns screen width.
     * \return Screen width.
     */
    int getWidth();

    /*!
     * \brief getHeight Returns screen height.
     * \return Screen height.
     */
    int getHeight();

    /*!
     * \brief addInkButtons Adds ink color selector buttons into the ink screen.
     * \param numberOfElements Number of elements to add.
     * \param rows Number of rows.
     * \param cols Number of columns.
     * \param colors Colors of the elements.
     */
    void addInkButtons(int numberOfElements, int rows, int cols, QVector<QColor> *colors =  new QVector<QColor>);

    /*!
     * \brief clearElements Restores default values.
     */
    void clearElements();

    /*!
     * \brief getTextOption Returns ink text option.
     * \return
     */
    InkTextOption getTextOption();

    /*!
     * \brief getInkColor Returns ink color of the specified position.
     * \param position Position.
     * \return Color of the specified position.
     */
    QColor getInkColor(int position);

    /*!
     * \brief setEditModel Specifies the values of the ink screen properties.
     * \param interfaz Interface model.
     */
    void setEditModel(Interfaz *interfaz);

private slots:

    /*!
     * \brief on_positionCombo_activated
     * \param index
     */
    void on_positionCombo_activated(int index);

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

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

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

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

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

    /*!
     * \brief on_rowInput_textEdited This slot is executed when row input is edited.
     */
    void on_rowInput_textEdited();

    /*!
     * \brief on_colInput_textEdited This slot is executed when column input is edited.
     */
    void on_colInput_textEdited();

    /*!
     * \brief on_numberElementInput_textEdited This slot is executed when number of elements input is edited.
     */
    void on_numberElementInput_textEdited();

    /*!
     * \brief selectBtnColor This slot is executed when ink color selector button is clicked.
     */
    void selectBtnColor();

    /*!
     * \brief on_porcentageRadio_clicked This slot is executed when percentage radio button is clicked.
     */
    void on_porcentageRadio_clicked();

    /*!
     * \brief on_numberRadio_clicked This slot is executed when number radio button is clicked.
     */
    void on_numberRadio_clicked();

    /*!
     * \brief on_noneRadio_clicked This slot is executed when none radio button is clicked.
     */
    void on_noneRadio_clicked();

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

    /*!
     * \brief on_heightInput_textEdited This slot is executed when height input is edited.
     */
    void on_heightInput_textEdited();

    /*!
     * \brief on_widthInput_textEdited This slot is executed when width input is edited.
     */
    void on_widthInput_textEdited();

private:

    /*!
     * \brief initElements Initialices the elements.
     */
    void initElements();

    /*!
     * \brief setValidators Sets inputs validators.
     */
    void setValidators();

    /*!
     * \brief isFullFill Checks if all of the elements have a value.
     */
    void isFullFill();

    /*!
     * \brief setToolTips Sets buttons help.
     */
    void setToolTips();

    /*!
     * \brief showSizeElements Shows size elements.
     */
    void showSizeElements();

    /*!
     * \brief hideSizeElements Hide size elements.
     */
    void hideSizeElements();

    /*!
     * \brief checkNumberElements Checks if the number of elements is correct.
     * \param elements Number of elements
     */
    void checkNumberElements(int elements);

    /*!
     * \brief hideMessages Hide messages.
     */
    void hideMessages();

    /*!
     * \brief clearInkButtons Removes ink color selector buttons.
     */
    void clearInkButtons();

private:

    /*!
     * \brief ui
     */
    Ui::InkScreen *ui;    
};

#endif // INKSCREEN_H
