#ifndef CONTROLLER_H
#define CONTROLLER_H

#include <View/view.h>
#include <Model/interfaz.h>
#include <QString>

#define HEADER_FILE "file:///"

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

public:
    ///
    /// \brief Controller constructor.
    ///
    Controller();

    /*!
     * \brief on_homeBtn_clicked.
     * \param ask whether confirmation from the user is required.
     */
    void on_homeBtn_clicked(bool ask = true);

    /*!
     * \brief on_settingsBtn_clicked.
     */
    void on_settingsBtn_clicked();  

    /*!
     * \brief on_helpBtn_clicked.
     * \param path help file \a path.
     * \param position current widget screen \a position.
     */
    void on_helpBtn_clicked(QString path, QPoint position);

protected:

    /*!
     * \brief confirmExit ask the user for exit confirmation.
     * \return \c true if the user confirm, \c false otherwise.
     */
    bool confirmExit();

    /*!
     * \brief showPreview show graphic preview of QML file.
     * \param path QML file \a path to preview.
     */
    void showPreview(QString path);

    /*!
     * \brief getLongSavePath ask the user the location to save the file.
     * \return the selected path.
     */
    QString getLongSavePath();

    /*!
     * \brief switchToOptionsView change the current view to the secondary view.
     */
    void switchToOptionsView();

protected:

    /*!
     * \brief generalView primary view.
     */
    View *generalView;

    /*!
     * \brief optionsView secondary view.
     */
    View *optionsView;

    /*!
     * \brief interfaz interface.
     */
    Interfaz *interfaz;


};

#endif // CONTROLLER_H
