#ifndef VIEW_H
#define VIEW_H

#include <QMainWindow>
#include <QLineEdit>
#include <Model/interfaz.h>

#define MATRIX_MENU_OPTION 1
#define LIST_MENU_OPTION 2
#define LINE_MENU_OPTION 3


class Controller;

namespace Ui {
class View;
}

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

    /*!
     * \brief View constructor.
     * \param parent View parent widget.
     */
    View(QWidget *parent);

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

    /*!
     * \brief showSuccess Show success message.
     * \param success Message to show.
     */
    virtual void showSuccess(QString success) = 0;

    /*!
     * \brief showInfo Show information message.
     * \param info Message to show.
     */
    virtual void showInfo(QString info) = 0;    

    /*!
     * \brief show Shows the view.
     * \param position Position to show the view.
     * \param size Size to show the view.
     */
    void show(QPoint position, QSize size);

protected:

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

    /*!
    * \brief setValidators Sets the validators of the view inputs.
    */
   virtual void setValidators() = 0;

    /*!
    * \brief setToolTips Sets the buttons help.
    */
   virtual void setToolTips() = 0;

    /*!
    * \brief isFullFill Checks if the all of the inputs have correct values.
    */
   virtual void isFullFill() = 0;

    /*!
    * \brief setIntValidators Sets a numeric validator to an input.
    * \param input Input to set the validator.
    * \param min Minimum value.
    * \param max Maximim value.
    */
   void setIntValidators(QLineEdit *input,int min, int max);

   /*!
    * \brief selectImage Selects an system image.
    * \return Path of the system image.
    */
   QString selectImage();

   /*!
     * \brief checkNumberElements Checks if the number of elements are correct
     * \param numberOfElements Number of elements.
     * \return The correct number of elements.
     */
    int checkNumberElements(int numberOfElements);

    /*!
     * \brief getRootHelpPath Returns the root help app path.
     * \return Root app help path.
     */
    QString getRootHelpPath();

private slots:

    /*!
     * \brief moveEvent This slot is executed when the view is moved.
     * \param event Move event.
     */
    void moveEvent(QMoveEvent *event);

private:

    /*!
    * \brief ui
    */
   Ui::View *ui;

protected:

   /*!
    * \brief currentPosition Current position of the view.
    */
   QPoint currentPosition;

   /*!
    * \brief controller Views controller.
    */
   Controller *controller;

};

#endif // VIEW_H
