RecipeDB/userInterface/mainwindow.h

48 lines
1.0 KiB
C
Raw Normal View History

2018-02-02 09:00:46 +00:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
2018-02-12 13:24:11 +00:00
#include <string>
#include <QAbstractListModel>
2018-02-12 13:24:11 +00:00
#include "model/recipe/recipe.h"
#include "model/recipe/ingredients/ingredientlistmodel.h"
#include "gui/newrecipedialog.h"
2018-02-12 13:24:11 +00:00
using namespace std;
2018-02-02 09:00:46 +00:00
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
MainWindow(RecipeDatabase *db, QWidget *parent = 0);
2018-02-02 09:00:46 +00:00
~MainWindow();
2018-02-12 13:24:11 +00:00
//Loads all data from a recipe into the GUI components.
void loadFromRecipe(Recipe recipe);
private slots:
void on_newButton_clicked();
private:
2018-02-02 09:00:46 +00:00
Ui::MainWindow *ui;
RecipeDatabase *recipeDB;
IngredientListModel ingredientModel;
2018-02-12 13:24:11 +00:00
//Hidden manipulation methods.
void setRecipeName(string name);
void setInstruction(Instruction instruction);
void setIngredients(vector<RecipeIngredient> ingredients);
void setImage(QImage img);
2018-03-10 15:02:01 +00:00
void setPrepTime(QTime prepTime);
void setCookTime(QTime cookTime);
void setServings(float servings);
2018-02-02 09:00:46 +00:00
};
#endif // MAINWINDOW_H