libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
project.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include <memory>
6#include <functional>
7#include "spimpl.h"
8
9#include "global.h"
10#include "signal.h"
11
12namespace libscratchcpp
13{
14
15class ProjectPrivate;
16
17class IEngine;
18
25{
26 public:
27 Project();
28 Project(const std::string &fileName);
29 Project(const Project &) = delete;
30
31 bool load();
32 void stopLoading();
33
34 void start();
35 void run();
36 void runEventLoop();
37
38 const std::string &fileName() const;
39 void setFileName(const std::string &newFileName);
40
41 std::shared_ptr<IEngine> engine() const;
42
43 sigslot::signal<unsigned int, unsigned int> &downloadProgressChanged();
44
45 private:
46 spimpl::unique_impl_ptr<ProjectPrivate> impl;
47};
48
49} // namespace libscratchcpp
The IEngine interface provides an API for running Scratch projects.
Definition iengine.h:41
void run()
Definition project.cpp:55
bool load()
Definition project.cpp:27
void setFileName(const std::string &newFileName)
Definition project.cpp:76
void start()
Definition project.cpp:44
const std::string & fileName() const
Definition project.cpp:70
std::shared_ptr< IEngine > engine() const
Definition project.cpp:82
Project(const Project &)=delete
Project()
Definition project.cpp:15
void stopLoading()
Definition project.cpp:33
void runEventLoop()
Definition project.cpp:64
sigslot::signal< unsigned int, unsigned int > & downloadProgressChanged()
Definition project.cpp:91
#define LIBSCRATCHCPP_EXPORT
Definition global.h:17
The main namespace of the library.
Definition asset.h:10