LibrePCB Developers Documentation
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#include <optional/tl/optional.hpp>
29
30#include <QtCore>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36
37class Workspace;
38
39namespace eagleimport {
40class EagleLibraryImport;
41}
42
43namespace editor {
44
45/*******************************************************************************
46 * Class EagleLibraryImportWizardContext
47 ******************************************************************************/
48
52class EagleLibraryImportWizardContext final : public QObject {
53 Q_OBJECT
54
55public:
56 static constexpr const char* NAME_PREFIX = "EAGLE_";
57
58 // Constructors / Destructor
61 const EagleLibraryImportWizardContext& other) = delete;
63 const FilePath& dstLibFp,
64 QObject* parent = nullptr) noexcept;
66
67 // Getters
68 Workspace& getWorkspace() const noexcept { return mWorkspace; }
70 const FilePath& getLbrFilePath() const noexcept { return mLbrFilePath; }
71 bool getAddNamePrefix() const noexcept { return mAddNamePrefix; }
72 const tl::optional<Uuid>& getComponentCategory() const noexcept {
74 }
75 const tl::optional<Uuid>& getPackageCategory() const noexcept {
77 }
78
79 // Setters
80 void setLbrFilePath(const QString& filePath) noexcept;
81 void setAddNamePrefix(bool add) noexcept;
82 void setComponentCategory(const tl::optional<Uuid>& uuid) noexcept;
83 void setPackageCategory(const tl::optional<Uuid>& uuid) noexcept;
84
85 // Operator Overloadings
87 const EagleLibraryImportWizardContext& rhs) = delete;
88
89signals:
90 void parseCompleted(const QString& messages);
91
92private: // Data
94 QScopedPointer<eagleimport::EagleLibraryImport> mImport;
97 tl::optional<Uuid> mComponentCategoryUuid;
98 tl::optional<Uuid> mPackageCategoryUuid;
99};
100
101/*******************************************************************************
102 * End of File
103 ******************************************************************************/
104
105} // namespace editor
106} // namespace librepcb
107
108#endif
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
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:52
tl::optional< Uuid > mComponentCategoryUuid
Definition: eaglelibraryimportwizardcontext.h:97
void setComponentCategory(const tl::optional< Uuid > &uuid) noexcept
Definition: eaglelibraryimportwizardcontext.cpp:117
tl::optional< Uuid > mPackageCategoryUuid
Definition: eaglelibraryimportwizardcontext.h:98
FilePath mLbrFilePath
Definition: eaglelibraryimportwizardcontext.h:95
void setLbrFilePath(const QString &filePath) noexcept
Definition: eaglelibraryimportwizardcontext.cpp:90
void setPackageCategory(const tl::optional< Uuid > &uuid) noexcept
Definition: eaglelibraryimportwizardcontext.cpp:131
Workspace & getWorkspace() const noexcept
Definition: eaglelibraryimportwizardcontext.h:68
const FilePath & getLbrFilePath() const noexcept
Definition: eaglelibraryimportwizardcontext.h:70
const tl::optional< Uuid > & getPackageCategory() const noexcept
Definition: eaglelibraryimportwizardcontext.h:75
void parseCompleted(const QString &messages)
EagleLibraryImportWizardContext(const EagleLibraryImportWizardContext &other)=delete
QScopedPointer< eagleimport::EagleLibraryImport > mImport
Definition: eaglelibraryimportwizardcontext.h:94
void setAddNamePrefix(bool add) noexcept
Definition: eaglelibraryimportwizardcontext.cpp:112
Workspace & mWorkspace
Definition: eaglelibraryimportwizardcontext.h:93
EagleLibraryImportWizardContext & operator=(const EagleLibraryImportWizardContext &rhs)=delete
bool getAddNamePrefix() const noexcept
Definition: eaglelibraryimportwizardcontext.h:71
bool mAddNamePrefix
Definition: eaglelibraryimportwizardcontext.h:96
eagleimport::EagleLibraryImport & getImport() noexcept
Definition: eaglelibraryimportwizardcontext.h:69
static constexpr const char * NAME_PREFIX
Definition: eaglelibraryimportwizardcontext.h:56
const tl::optional< Uuid > & getComponentCategory() const noexcept
Definition: eaglelibraryimportwizardcontext.h:72
Definition: occmodel.cpp:77