-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathproject.h
47 lines (34 loc) · 1.09 KB
/
project.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
#ifndef PROJECT_H
#define PROJECT_H
#include <memory>
#include <QVector>
#include <QFileInfo>
#include <QJsonObject>
struct EventType;
typedef QVector< std::shared_ptr<EventType> > EventTypeVector;
class Project
{
public:
static void init(const QString& directory, const QString& name);
static void open(const QString& path);
static Project* get();
static void close();
const QString& name() const { return mName; }
QString root() const;
std::shared_ptr<EventType> eventType(const QString& name);
inline const EventTypeVector& eventTypes() const { return mEventTypes; }
inline const QString& lastOpenedTimeline() const { return mLastOpenedTimeline; }
void setEventTypes(const EventTypeVector& eventTypes);
void setLastOpenedTimeline(const QString& timelinePath);
void save() const;
private:
Project();
static Project* gCurrentProject;
QJsonObject toJSON() const;
void fromJSON(const QJsonObject& project);
QFileInfo mSavePath;
QString mName;
EventTypeVector mEventTypes;
QString mLastOpenedTimeline;
};
#endif // PROJECT_H