multicookwindow.h 2.38 KB
#ifndef MULTICOOKWINDOW_H
#define MULTICOOKWINDOW_H

#include <QMainWindow>
#include <QPushButton>

#include "multicookview.h"
#include "multicookcontroller.h"

namespace Ui {
class MultiCookWindow;
}

class MultiCookWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MultiCookWindow(QWidget *parent = 0);
    ~MultiCookWindow();

protected:
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);

private slots:
    void updateView();
    void updateRecents();
    void handleViewClick(int slot);
    void handleButtonClick(int button);
    void handleRecentButtonClick(int button);
    void selectCook();
    void onCookSelected(MultiCook *cook);
    void showRecents();
    void showClock();
    void addCook(int slot, MultiCook *cook);
    void jumpConfig();
    void jumpWash();

    void on_showPrevButton_clicked();
    void on_showNowButton_clicked();
    void on_showNextButton_clicked();
    void on_showFavoritesButton_clicked();

    void on_backButton_clicked();
    void on_configButton_clicked();
    void on_washButton_clicked();
    void on_deleteButton_clicked();
    void on_helpButton_clicked();

    void onEncoderLeft();
    void onEncoderRight();
    void onEncoderClicked(QWidget *clicked);

    void on_selectButton_1_clicked();
    void on_selectButton_2_clicked();
    void on_selectButton_3_clicked();
    void on_selectButton_4_clicked();
    void on_selectButton_5_clicked();
    void on_selectButton_6_clicked();
    void on_selectButton_7_clicked();
    void on_selectButton_8_clicked();
    void on_selectButton_9_clicked();
    void on_selectButton_10_clicked();

    void on_recentButton_1_clicked();
    void on_recentButton_2_clicked();
    void on_recentButton_3_clicked();
    void on_recentButton_4_clicked();
    void on_recentButton_5_clicked();
    void on_recentButton_6_clicked();

    void on_showPrevPageButton_clicked();
    void on_showNextPageButton_clicked();

    void on_homeButton_clicked();

private:
    Ui::MultiCookWindow *ui;

    MultiCookContainer *container;
    MultiCookController *controller;

    QList<QPushButton *> buttons;
    QList<QPushButton *> recentButtons;
    QList<MultiCook *> recents;
    QTimer updateViewTimer;

    int lastClickedEmptyButton;
    int lastClickedCookButton;
    int lastClickedRecentCook;
    bool trashClicked;

    Define::Mode mode;
    QWidget *pushed = NULL;
};

#endif // MULTICOOKWINDOW_H