/home/docs/checkouts/readthedocs.org/user_builds/mathvizanimator/checkouts/latest/app/src/mainlogic.h Source File

MathVizAnimator: /home/docs/checkouts/readthedocs.org/user_builds/mathvizanimator/checkouts/latest/app/src/mainlogic.h Source File
MathVizAnimator  0.0.1
mainlogic.h
1 /* mathvizanimator
2  * Copyright (C) 2023 codingwithmagga
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef APP_SRC_MAINLOGIC_H_
19 #define APP_SRC_MAINLOGIC_H_
20 
21 #include <QLoggingCategory>
22 #include <QObject>
23 #include <QQmlApplicationEngine>
24 
25 #include "itemhandler.h"
26 #include "mainwindowhandler.h"
27 #include "renderer.h"
28 #include "savefilehandler.h"
29 
30 Q_DECLARE_LOGGING_CATEGORY(mainlogic)
31 
32 class MainLogic : public QObject {
33  Q_OBJECT
34 
35  public:
36  explicit MainLogic(QObject* parent = Q_NULLPTR);
37 
38  void initEngine(QQmlApplicationEngine* const engine);
39  void connectEngine();
40 
41  private slots:
42  void createSnapshot(const QFileInfo& snapshot_file_info);
43  void renderVideo(const QFileInfo& video_file_info);
44 
45  void saveProject(const QFileInfo& save_file_info);
46  void loadProject(const QFileInfo& load_file_info);
47 
48  void projectSizeChanged();
49 
50  void uiTimeChanged(const qreal time);
51  void renderingVideoFinished();
52 
53  private:
54  QJsonObject projectSettingsJson() const;
55  void setProjectSettings(const QJsonObject& json);
56 
57  QQmlApplicationEngine* m_qml_engine;
58  QObject* m_qml_creation_area;
59 
60  qreal m_current_time = 0.0;
61 
62  MainWindowHandler m_mainwindowhandler;
63 
64  SaveFileHandler m_savefilehandler;
65  Renderer m_renderer;
66  ItemHandler m_itemhandler;
67 };
68 
69 #endif // APP_SRC_MAINLOGIC_H_
Definition: itemhandler.h:63
Definition: mainlogic.h:32
Definition: mainwindowhandler.h:27
Definition: renderer.h:28
Definition: savefilehandler.h:26