LibrePCB Developers Documentation
Loading...
Searching...
No Matches
createlibrarytab.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_CREATELIBRARYTAB_H
21#define LIBREPCB_EDITOR_CREATELIBRARYTAB_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "windowtab.h"
27
31
32#include <QtCore>
33
34#include <optional>
35
36/*******************************************************************************
37 * Namespace / Forward Declarations
38 ******************************************************************************/
39namespace librepcb {
40namespace editor {
41
42/*******************************************************************************
43 * Class CreateLibraryTab
44 ******************************************************************************/
45
49class CreateLibraryTab final : public WindowTab {
50 Q_OBJECT
51
52public:
53 // Signals
55
56 // Constructors / Destructor
57 CreateLibraryTab() = delete;
58 CreateLibraryTab(const CreateLibraryTab& other) = delete;
59 explicit CreateLibraryTab(GuiApplication& app,
60 QObject* parent = nullptr) noexcept;
61 ~CreateLibraryTab() noexcept;
62
63 // General Methods
64 ui::TabData getUiData() const noexcept override;
65 const ui::CreateLibraryTabData& getDerivedUiData() const noexcept {
66 return mUiData;
67 }
68 void setDerivedUiData(const ui::CreateLibraryTabData& data) noexcept;
69 void trigger(ui::TabAction a) noexcept override;
70
71 // Operator Overloadings
73
74signals:
75 void libraryCreated(const FilePath& fp);
76
77private:
78 void validate() noexcept;
79
80 ui::CreateLibraryTabData mUiData;
81 std::optional<ElementName> mName;
82 std::optional<Version> mVersion;
83 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 Version class represents a version number in the format "1.42.7".
Definition version.h:58
The CreateLibraryTab class.
Definition createlibrarytab.h:49
std::optional< ElementName > mName
Definition createlibrarytab.h:81
std::optional< QUrl > mUrl
Definition createlibrarytab.h:83
FilePath mDirectory
Definition createlibrarytab.h:84
void setDerivedUiData(const ui::CreateLibraryTabData &data) noexcept
Definition createlibrarytab.cpp:94
ui::CreateLibraryTabData mUiData
Definition createlibrarytab.h:80
CreateLibraryTab(const CreateLibraryTab &other)=delete
void validate() noexcept
Definition createlibrarytab.cpp:197
Signal< CreateLibraryTab > onDerivedUiDataChanged
Definition createlibrarytab.h:54
std::optional< Version > mVersion
Definition createlibrarytab.h:82
void trigger(ui::TabAction a) noexcept override
Definition createlibrarytab.cpp:100
const ui::CreateLibraryTabData & getDerivedUiData() const noexcept
Definition createlibrarytab.h:65
void libraryCreated(const FilePath &fp)
CreateLibraryTab & operator=(const CreateLibraryTab &rhs)=delete
ui::TabData getUiData() const noexcept override
Definition createlibrarytab.cpp:79
The GuiApplication class.
Definition guiapplication.h:61
The WindowTab class.
Definition windowtab.h:51
Definition occmodel.cpp:77
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84
Definition uuid.h:186