-
Notifications
You must be signed in to change notification settings - Fork 1
/
mediator.h
40 lines (32 loc) · 1.02 KB
/
mediator.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
#ifndef MEDIATOR_H
#define MEDIATOR_H
#include "postmodel.h"
#include <QObject>
class Mediator : public QObject
{
Q_OBJECT
Q_PROPERTY(PostModel* postModel READ postModel WRITE setPostModel NOTIFY postModelChanged)
private:
PostModel *_postModel;
QString dataPath;
QString workoutsContent;
public:
Mediator(QObject *parent=0);
void setPostModel(PostModel *postModel){
_postModel = postModel;
emit postModelChanged();
}
PostModel* postModel(){
return _postModel;
}
signals:
void postModelChanged();
public slots:
void insertPost(QString title, QDateTime date, QString content, QString reaction, quint16 weight, quint16 calories, bool run, QList<QUrl> photos);
void editPost(int index, QString title, QDateTime date, QString content, QString reaction, quint16 weight, quint16 calories, bool run, QList<QUrl> photos);
void deletePost(int index);
void addPoints(int points);
QString getWorkoutsContent();
void saveAll();
};
#endif // MEDIATOR_H