-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
55 lines (45 loc) · 1.17 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "PetDatabaseSortableByName.h"
#include "bundle.h"
#include "csvreader.h"
#include "databasebuilder.h"
#include "bundletablevisitor.h"
#include "pettablevisitor.h"
#include "BubbleSortIncreasing.h"
#include "shoppingcart.h"
#include "subject.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow, public Subject
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
ItemVector* getShoppingCart(){
return &shopping_cart;
}
public slots:
void loadDatabase();
void openShoppingCartWindow();
void CheckoutCart();
void DeleteRecord(Item*);
void observerDeleted(Observer*);
void on_addToCart();
void petSelectionChanged(QItemSelection, QItemSelection);
void bundleSelectionChanged(QItemSelection, QItemSelection);
private:
Ui::MainWindow *ui;
ShoppingCart* SCWindow;
PetDatabaseSearchableByName pets;
vector<Bundle> bundles;
CSVReader reader;
DatabaseBuilder builder;
BundleTableVisitor bundle_visitor;
PetTableVisitor pet_visitor;
ItemVector shopping_cart;
};
#endif // MAINWINDOW_H