LibrePCB Developers Documentation
librarymanager.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_LIBRARYMANAGER_H
21#define LIBREPCB_EDITOR_LIBRARYMANAGER_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Library;
37class Workspace;
38
39namespace editor {
40
41class AddLibraryWidget;
42class LibraryListWidgetItem;
43
44namespace Ui {
45class LibraryManager;
46}
47
48/*******************************************************************************
49 * Class LibraryManager
50 ******************************************************************************/
51
55class LibraryManager final : public QMainWindow {
56 Q_OBJECT
57
58public:
59 // Constructors / Destructor
60 LibraryManager() = delete;
61 LibraryManager(const LibraryManager& other) = delete;
62 LibraryManager(Workspace& ws, QWidget* parent = nullptr) noexcept;
63 ~LibraryManager() noexcept;
64
65 // General Methods
66 void updateOnlineLibraryList() noexcept;
67
68 // Operator Overloadings
69 LibraryManager& operator=(const LibraryManager& rhs) = delete;
70
71private: // Methods
72 void closeEvent(QCloseEvent* event) noexcept override;
73 void clearLibraryList() noexcept;
74 void updateLibraryList() noexcept;
75 void currentListItemChanged(QListWidgetItem* current,
76 QListWidgetItem* previous) noexcept;
77 void libraryAddedSlot(const FilePath& libDir) noexcept;
78
79 static bool widgetsLessThan(const LibraryListWidgetItem* a,
80 const LibraryListWidgetItem* b) noexcept;
81
82signals:
84
85private: // Data
87 QScopedPointer<Ui::LibraryManager> mUi;
91};
92
93/*******************************************************************************
94 * End of File
95 ******************************************************************************/
96
97} // namespace editor
98} // namespace librepcb
99
100#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
The AddLibraryWidget class.
Definition: addlibrarywidget.h:56
The LibraryListWidgetItem class.
Definition: librarylistwidgetitem.h:51
The LibraryManager class.
Definition: librarymanager.h:55
FilePath mSelectedLibrary
Definition: librarymanager.h:90
void updateLibraryList() noexcept
Definition: librarymanager.cpp:125
void openLibraryEditorTriggered(const FilePath &libDir)
QWidget * mCurrentWidget
Definition: librarymanager.h:89
void updateOnlineLibraryList() noexcept
Definition: librarymanager.cpp:102
LibraryManager(const LibraryManager &other)=delete
QScopedPointer< AddLibraryWidget > mAddLibraryWidget
Definition: librarymanager.h:88
QScopedPointer< Ui::LibraryManager > mUi
Definition: librarymanager.h:87
static bool widgetsLessThan(const LibraryListWidgetItem *a, const LibraryListWidgetItem *b) noexcept
Definition: librarymanager.cpp:229
Workspace & mWorkspace
Definition: librarymanager.h:86
void closeEvent(QCloseEvent *event) noexcept override
Definition: librarymanager.cpp:110
void currentListItemChanged(QListWidgetItem *current, QListWidgetItem *previous) noexcept
Definition: librarymanager.cpp:182
void libraryAddedSlot(const FilePath &libDir) noexcept
Definition: librarymanager.cpp:217
void clearLibraryList() noexcept
Definition: librarymanager.cpp:115
Definition: occmodel.cpp:77