LibrePCB Developers Documentation
Loading...
Searching...
No Matches
downloadlibrarytab.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_DOWNLOADLIBRARYTAB_H
21#define LIBREPCB_EDITOR_DOWNLOADLIBRARYTAB_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "windowtab.h"
27
29
30#include <QtCore>
31
32#include <optional>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38namespace editor {
39
40class GuiApplication;
41class LibraryDownload;
42
43/*******************************************************************************
44 * Class DownloadLibraryTab
45 ******************************************************************************/
46
50class DownloadLibraryTab final : public WindowTab {
51 Q_OBJECT
52
53public:
54 // Signals
56
57 // Constructors / Destructor
59 DownloadLibraryTab(const DownloadLibraryTab& other) = delete;
61 QObject* parent = nullptr) noexcept;
62 ~DownloadLibraryTab() noexcept;
63
64 // General Methods
65 ui::TabData getUiData() const noexcept override;
66 const ui::DownloadLibraryTabData& getDerivedUiData() const noexcept {
67 return mUiData;
68 }
69 void setDerivedUiData(const ui::DownloadLibraryTabData& data) noexcept;
70 void trigger(ui::TabAction a) noexcept override;
71
72 // Operator Overloadings
74
75private:
76 void validate() noexcept;
77 void downloadFinished(bool success, const QString& errMsg) noexcept;
78
79 ui::DownloadLibraryTabData mUiData;
80 std::optional<QUrl> mUrl;
83};
84
85/*******************************************************************************
86 * End of File
87 ******************************************************************************/
88
89} // namespace editor
90} // namespace librepcb
91
92#endif
This class represents absolute, well-formatted paths to files or directories.
Definition filepath.h:127
The Signal class is used to emit signals on non-QObject derived classes.
Definition signalslot.h:65
The DownloadLibraryTab class.
Definition downloadlibrarytab.h:50
std::optional< QUrl > mUrl
Definition downloadlibrarytab.h:80
Signal< DownloadLibraryTab > onDerivedUiDataChanged
Definition downloadlibrarytab.h:55
FilePath mDirectory
Definition downloadlibrarytab.h:81
std::unique_ptr< LibraryDownload > mDownload
Definition downloadlibrarytab.h:82
void validate() noexcept
Definition downloadlibrarytab.cpp:149
ui::DownloadLibraryTabData mUiData
Definition downloadlibrarytab.h:79
DownloadLibraryTab & operator=(const DownloadLibraryTab &rhs)=delete
void downloadFinished(bool success, const QString &errMsg) noexcept
Definition downloadlibrarytab.cpp:209
void setDerivedUiData(const ui::DownloadLibraryTabData &data) noexcept
Definition downloadlibrarytab.cpp:86
void trigger(ui::TabAction a) noexcept override
Definition downloadlibrarytab.cpp:92
const ui::DownloadLibraryTabData & getDerivedUiData() const noexcept
Definition downloadlibrarytab.h:66
ui::TabData getUiData() const noexcept override
Definition downloadlibrarytab.cpp:71
DownloadLibraryTab(const DownloadLibraryTab &other)=delete
The GuiApplication class.
Definition guiapplication.h:61
The LibraryDownload class.
Definition librarydownload.h:48
The WindowTab class.
Definition windowtab.h:51
Definition occmodel.cpp:77
Definition uuid.h:186