-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontroller.h
101 lines (83 loc) · 1.75 KB
/
controller.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <QObject>
#include <QApplication>
#include <QtCore>
#include <QPrinter>
#include <QPainter>
#include <QPixmap>
#include <QWidget>
#include "mainwindow.h"
#include "model.h"
#include "initwindow.h"
class Controller : public QObject
{
Q_OBJECT
private:
MainWindow *mainwindow;
Model *model;
public:
explicit Controller(QObject *parent = nullptr);
/**
* @brief Sets the Model object
*
* @param _model
*/
void setModel(Model *_model);
/**
* @brief Sets the Main Window object
*
* @param _mainwindow
*/
void setMainWindow(MainWindow *_mainwindow);
/**
*
* @brief Opens and read a JSon file to create a chart
*
* @param Path string of the path
*/
Model *getModel() const;
void init();
public slots:
/**
* @brief Opens a file from the device
*
*/
void open() const;
/**
* @brief Creates and shows a new chart on the window
*
*/
void newChart() const;
/**
* @brief Saves the data inside the table in a new .json file
*
*/
void save() const;
/**
* @brief Saves a screenshot of the chart in a .pdf file
*
*/
void saveAsPdf() const;
/**
* @brief Saves a screenshot of the file in .png format
*
*/
void saveAsImage() const;
/**
* @brief Adds a column before the column of the selected cell
*/
void addColumnB();
/**
* @brief Adds a column after the column of the selected cell
*/
void addColumnA();
/**
* @brief Similar to the two previous functions
*/
void addRowB();
void addRowA();
void removeColumn();
void removeRow();
};
#endif // CONTROLLER_H