LibrePCB Developers Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
71 // Operator Overloadings
73
74protected:
75 void triggerAsync(ui::Action a) noexcept override;
76
77private:
78 void validate() noexcept;
79 void downloadFinished(bool success, const QString& errMsg) noexcept;
80
81 ui::DownloadLibraryTabData mUiData;
82 std::optional<QUrl> mUrl;
85};
86
87/*******************************************************************************
88 * End of File
89 ******************************************************************************/
90
91} // namespace editor
92} // namespace librepcb
93
94#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:82
Signal< DownloadLibraryTab > onDerivedUiDataChanged
Definition downloadlibrarytab.h:55
FilePath mDirectory
Definition downloadlibrarytab.h:83
std::unique_ptr< LibraryDownload > mDownload
Definition downloadlibrarytab.h:84
void validate() noexcept
Definition downloadlibrarytab.cpp:146
ui::DownloadLibraryTabData mUiData
Definition downloadlibrarytab.h:81
DownloadLibraryTab & operator=(const DownloadLibraryTab &rhs)=delete
void downloadFinished(bool success, const QString &errMsg) noexcept
Definition downloadlibrarytab.cpp:206
void setDerivedUiData(const ui::DownloadLibraryTabData &data) noexcept
Definition downloadlibrarytab.cpp:79
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
void triggerAsync(ui::Action a) noexcept override
Definition downloadlibrarytab.cpp:89
The GuiApplication class.
Definition guiapplication.h:60
The LibraryDownload class.
Definition librarydownload.h:48
The WindowTab class.
Definition windowtab.h:47
Definition occmodel.cpp:77
Definition uuid.h:186