LibrePCB Developers Documentation
orderpcbdialog.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_EDITOR_ORDERPCBDIALOG_H
21#define LIBREPCB_EDITOR_ORDERPCBDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <QtCore>
27#include <QtWidgets>
28
29#include <functional>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class OrderPcbApiRequest;
37class WorkspaceSettings;
38
39namespace editor {
40
41namespace Ui {
42class OrderPcbDialog;
43}
44
45/*******************************************************************************
46 * Class OrderPcbDialog
47 ******************************************************************************/
48
52class OrderPcbDialog final : public QDialog {
53 Q_OBJECT
54
55public:
56 // Constructors / Destructor
57 OrderPcbDialog() = delete;
58 OrderPcbDialog(const OrderPcbDialog& other) = delete;
59 explicit OrderPcbDialog(const WorkspaceSettings& settings,
60 std::function<QByteArray()> createLppzCallback,
61 QWidget* parent = nullptr) noexcept;
62 ~OrderPcbDialog() noexcept;
63
64 // Operator Overloads
65 OrderPcbDialog& operator=(const OrderPcbDialog& rhs) = delete;
66
67private: // Methods
68 void infoRequestSucceeded(QUrl infoUrl, int maxFileSize) noexcept;
69 void infoRequestFailed(QString errorMsg) noexcept;
70 void uploadButtonClicked() noexcept;
71 void startUpload() noexcept;
72 void uploadProgressPercent(int percent) noexcept;
73 void uploadSucceeded(const QUrl& redirectUrl) noexcept;
74 void uploadFailed(const QString& errorMsg) noexcept;
75 void setStatus(const QString msg) noexcept;
76 void setError(const QString& msg) noexcept;
77
78private: // Data
81 std::function<QByteArray()> mCreateLppzCallback;
82 QScopedPointer<Ui::OrderPcbDialog> mUi;
83};
84
85/*******************************************************************************
86 * End of File
87 ******************************************************************************/
88
89} // namespace editor
90} // namespace librepcb
91
92#endif
Order a PCB via a LibrePCB API server.
Definition: orderpcbapirequest.h:42
Container for all workspace related settings.
Definition: workspacesettings.h:60
The OrderPcbDialog class.
Definition: orderpcbdialog.h:52
void setError(const QString &msg) noexcept
Definition: orderpcbdialog.cpp:233
void infoRequestFailed(QString errorMsg) noexcept
Definition: orderpcbdialog.cpp:142
void setStatus(const QString msg) noexcept
Definition: orderpcbdialog.cpp:227
OrderPcbDialog(const OrderPcbDialog &other)=delete
void uploadSucceeded(const QUrl &redirectUrl) noexcept
Definition: orderpcbdialog.cpp:194
void uploadProgressPercent(int percent) noexcept
Definition: orderpcbdialog.cpp:190
QScopedPointer< Ui::OrderPcbDialog > mUi
Definition: orderpcbdialog.h:82
void infoRequestSucceeded(QUrl infoUrl, int maxFileSize) noexcept
Definition: orderpcbdialog.cpp:121
const WorkspaceSettings & mSettings
Definition: orderpcbdialog.h:79
void uploadFailed(const QString &errorMsg) noexcept
Definition: orderpcbdialog.cpp:219
QScopedPointer< OrderPcbApiRequest > mRequest
Definition: orderpcbdialog.h:80
void uploadButtonClicked() noexcept
Definition: orderpcbdialog.cpp:149
std::function< QByteArray()> mCreateLppzCallback
Definition: orderpcbdialog.h:81
void startUpload() noexcept
Definition: orderpcbdialog.cpp:161
Definition: occmodel.cpp:77