LibrePCB Developers Documentation
projectjsonoutputjob.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_CORE_PROJECTJSONOUTPUTJOB_H
21#define LIBREPCB_CORE_PROJECTJSONOUTPUTJOB_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "outputjob.h"
27
28#include <QtCore>
29#include <QtGui>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36/*******************************************************************************
37 * Class ProjectJsonOutputJob
38 ******************************************************************************/
39
43class ProjectJsonOutputJob final : public OutputJob {
44 Q_DECLARE_TR_FUNCTIONS(ProjectJsonOutputJob)
45
46public:
47 // Constructors / Destructor
48 ProjectJsonOutputJob() noexcept;
49 ProjectJsonOutputJob(const ProjectJsonOutputJob& other) noexcept;
50 explicit ProjectJsonOutputJob(const SExpression& node);
51 virtual ~ProjectJsonOutputJob() noexcept;
52
53 // Getters
54 virtual QString getTypeTr() const noexcept override;
55 virtual QIcon getTypeIcon() const noexcept override;
56 const QString& getOutputPath() const noexcept { return mOutputPath; }
57
58 // Setters
59 void setOutputPath(const QString& path) noexcept;
60
61 // General Methods
62 static QString getTypeName() noexcept { return "project_json"; }
63 static QString getTypeTrStatic() noexcept {
64 return tr("Project Data") % " (*.json)";
65 }
66 virtual std::shared_ptr<OutputJob> cloneShared() const noexcept override;
67
68 // Operator Overloadings
69 ProjectJsonOutputJob& operator=(const ProjectJsonOutputJob& rhs) = delete;
70
71private: // Methods
72 virtual void serializeDerived(SExpression& root) const override;
73 virtual bool equals(const OutputJob& rhs) const noexcept override;
74
75private: // Data
76 QString mOutputPath;
77};
78
79/*******************************************************************************
80 * End of File
81 ******************************************************************************/
82
83} // namespace librepcb
84
85#endif
Base class for all output job types.
Definition: outputjob.h:50
JSON project data output job.
Definition: projectjsonoutputjob.h:43
virtual ~ProjectJsonOutputJob() noexcept
Definition: projectjsonoutputjob.cpp:53
ProjectJsonOutputJob() noexcept
Definition: projectjsonoutputjob.cpp:37
virtual QString getTypeTr() const noexcept override
Definition: projectjsonoutputjob.cpp:60
void setOutputPath(const QString &path) noexcept
Definition: projectjsonoutputjob.cpp:72
virtual bool equals(const OutputJob &rhs) const noexcept override
Definition: projectjsonoutputjob.cpp:96
static QString getTypeName() noexcept
Definition: projectjsonoutputjob.h:62
static QString getTypeTrStatic() noexcept
Definition: projectjsonoutputjob.h:63
QString mOutputPath
Definition: projectjsonoutputjob.h:76
virtual QIcon getTypeIcon() const noexcept override
Definition: projectjsonoutputjob.cpp:64
virtual void serializeDerived(SExpression &root) const override
Definition: projectjsonoutputjob.cpp:91
const QString & getOutputPath() const noexcept
Definition: projectjsonoutputjob.h:56
virtual std::shared_ptr< OutputJob > cloneShared() const noexcept override
Definition: projectjsonoutputjob.cpp:83
The SExpression class.
Definition: sexpression.h:69
Definition: occmodel.cpp:77