LibrePCB Developers Documentation
Loading...
Searching...
No Matches
eaglelibraryimportwizardcontext.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_EAGLELIBRARYIMPORTWIZARDCONTEXT_H
21#define LIBREPCB_EDITOR_EAGLELIBRARYIMPORTWIZARDCONTEXT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
28
29#include <QtCore>
30
31#include <optional>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class Workspace;
39
40namespace eagleimport {
41class EagleLibraryImport;
42}
43
44namespace editor {
45
46/*******************************************************************************
47 * Class EagleLibraryImportWizardContext
48 ******************************************************************************/
49
53class EagleLibraryImportWizardContext final : public QObject {
54 Q_OBJECT
55
56public:
57 static constexpr const char* NAME_PREFIX = "EAGLE_";
58
59 // Constructors / Destructor
62 const EagleLibraryImportWizardContext& other) = delete;
64 const FilePath& dstLibFp,
65 QObject* parent = nullptr) noexcept;
67
68 // Getters
69 Workspace& getWorkspace() const noexcept { return mWorkspace; }
71 const FilePath& getLbrFilePath() const noexcept { return mLbrFilePath; }
72 bool getAddNamePrefix() const noexcept { return mAddNamePrefix; }
73 const std::optional<Uuid>& getComponentCategory() const noexcept {
75 }
76 const std::optional<Uuid>& getPackageCategory() const noexcept {
78 }
79
80 // Setters
81 void setLbrFilePath(const QString& filePath) noexcept;
82 void setAddNamePrefix(bool add) noexcept;
83 void setComponentCategory(const std::optional<Uuid>& uuid) noexcept;
84 void setPackageCategory(const std::optional<Uuid>& uuid) noexcept;
85
86 // Operator Overloadings
88 const EagleLibraryImportWizardContext& rhs) = delete;
89
90signals:
91 void parseCompleted(const QString& messages);
92
93private: // Data
95 QScopedPointer<eagleimport::EagleLibraryImport> mImport;
98 std::optional<Uuid> mComponentCategoryUuid;
99 std::optional<Uuid> mPackageCategoryUuid;
100};
101
102/*******************************************************************************
103 * End of File
104 ******************************************************************************/
105
106} // namespace editor
107} // namespace librepcb
108
109#endif
This class represents absolute, well-formatted paths to files or directories.
Definition filepath.h:127
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition workspace.h:54
EAGLE library (*.lbr) import.
Definition eaglelibraryimport.h:59
The EagleLibraryImportWizardContext class.
Definition eaglelibraryimportwizardcontext.h:53
const std::optional< Uuid > & getComponentCategory() const noexcept
Definition eaglelibraryimportwizardcontext.h:73
FilePath mLbrFilePath
Definition eaglelibraryimportwizardcontext.h:96
std::optional< Uuid > mPackageCategoryUuid
Definition eaglelibraryimportwizardcontext.h:99
void setLbrFilePath(const QString &filePath) noexcept
Definition eaglelibraryimportwizardcontext.cpp:90
const std::optional< Uuid > & getPackageCategory() const noexcept
Definition eaglelibraryimportwizardcontext.h:76
void setComponentCategory(const std::optional< Uuid > &uuid) noexcept
Definition eaglelibraryimportwizardcontext.cpp:117
Workspace & getWorkspace() const noexcept
Definition eaglelibraryimportwizardcontext.h:69
const FilePath & getLbrFilePath() const noexcept
Definition eaglelibraryimportwizardcontext.h:71
void parseCompleted(const QString &messages)
EagleLibraryImportWizardContext(const EagleLibraryImportWizardContext &other)=delete
QScopedPointer< eagleimport::EagleLibraryImport > mImport
Definition eaglelibraryimportwizardcontext.h:95
void setAddNamePrefix(bool add) noexcept
Definition eaglelibraryimportwizardcontext.cpp:112
Workspace & mWorkspace
Definition eaglelibraryimportwizardcontext.h:94
void setPackageCategory(const std::optional< Uuid > &uuid) noexcept
Definition eaglelibraryimportwizardcontext.cpp:131
EagleLibraryImportWizardContext & operator=(const EagleLibraryImportWizardContext &rhs)=delete
bool getAddNamePrefix() const noexcept
Definition eaglelibraryimportwizardcontext.h:72
bool mAddNamePrefix
Definition eaglelibraryimportwizardcontext.h:97
eagleimport::EagleLibraryImport & getImport() noexcept
Definition eaglelibraryimportwizardcontext.h:70
std::optional< Uuid > mComponentCategoryUuid
Definition eaglelibraryimportwizardcontext.h:98
static constexpr const char * NAME_PREFIX
Definition eaglelibraryimportwizardcontext.h:57
Definition occmodel.cpp:76