Files
Chronos/sources/models/day.h
2022-10-16 14:49:10 +02:00

53 lines
902 B
C++

#ifndef DAY_H
#define DAY_H
#define KEY_START "start"
#define KEY_END "end"
#define KEY_BREAKS "breaks"
#define KEY_VALIDATE "validate"
#include <QTime>
#include <QJsonObject>
#include <QJsonArray>
#include <math.h>
#include "breakpoint.h"
class Day
{
private:
QTime start;
QTime end;
QVector<BreakPoint*> breaks;
bool validate;
bool notWorking;
public:
Day();
Day(Day*);
~Day();
void set_start(QTime value);
void set_end(QTime value);
void set_validate(bool);
void set_working(bool);
void setBreaks(QVector<BreakPoint*>);
QTime get_start();
QTime get_end();
QVector<BreakPoint*> getBreaks();
bool get_validate();
bool not_working();
float get_time_break();
void update(Day *);
QJsonObject to_json();
bool has_warning();
float get_total();
static Day* from_json(QJsonObject);
};
#endif // DAY_H