/home/docs/checkouts/readthedocs.org/user_builds/mathvizanimator/checkouts/latest/libs/mva_svg/include/svg_creator.h Source File

MathVizAnimator: /home/docs/checkouts/readthedocs.org/user_builds/mathvizanimator/checkouts/latest/libs/mva_svg/include/svg_creator.h Source File
MathVizAnimator  0.0.1
svg_creator.h
1 /* mathvizanimator
2  * Copyright (C) 2024 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 #ifndef LIBS_MVA_SVG_INCLUDE_SVG_CREATOR_H_
18 #define LIBS_MVA_SVG_INCLUDE_SVG_CREATOR_H_
19 
20 #include <QDir>
21 #include <QFileInfo>
22 #include <QObject>
23 #include <QProcess>
24 
25 #include "dvisvgm_process.h"
26 #include "latex_process.h"
27 
33 class SVGCreator : public QObject {
34  Q_OBJECT
35  public:
40  explicit SVGCreator(QObject* parent = nullptr);
41 
46  void svgFromLaTeX(const QString& latex);
47 
48  signals:
53  void svgCreated(const QFileInfo& svg_file);
54 
59 
60  private slots:
65  void latexProcessFinished(const QFileInfo& dvi_file);
66 
71  void dvisvgmProcessFinished(const QFileInfo& svg_file);
72 
77  void latexProcessFailed(const QFileInfo& latex_file);
78 
83  void dvisvgmProcessFailed(const QFileInfo& dvi_file);
84 
85  private:
91  QFileInfo prepareLaTeXFile(const QString& latex);
92 
93  QMap<QString, QSharedPointer<LaTeXProcess>> m_latex_process_map;
94  QMap<QString, QSharedPointer<DvisvgmProcess>> m_dvisvgm_process_map;
95 };
96 
97 #endif // LIBS_MVA_SVG_INCLUDE_SVG_CREATOR_H_
The SVGCreator class handles the creation of SVG files from LaTeX input.
Definition: svg_creator.h:33
void svgFromLaTeX(const QString &latex)
Initiates the creation of SVG file from LaTeX input.
Definition: svg_creator.cpp:33
SVGCreator(QObject *parent=nullptr)
Constructs an SVGCreator object.
Definition: svg_creator.cpp:28
void svgCreated(const QFileInfo &svg_file)
Signal emitted when the SVG file is successfully created.
void svgCreationFailed()
Signal emitted when the SVG creation process fails.