LibrePCB Developers Documentation
librarylistwidgetitem.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_LIBRARYLISTWIDGETITEM_H
21#define LIBREPCB_EDITOR_LIBRARYLISTWIDGETITEM_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Workspace;
37
38namespace editor {
39
40namespace Ui {
41class LibraryListWidgetItem;
42}
43
44/*******************************************************************************
45 * Class LibraryListWidgetItem
46 ******************************************************************************/
47
51class LibraryListWidgetItem final : public QWidget {
52 Q_OBJECT
53
54public:
55 // Constructors / Destructor
58 LibraryListWidgetItem(Workspace& ws, const FilePath& libDir,
59 const QString& name = "",
60 const QString& description = "",
61 const QPixmap& icon = QPixmap()) noexcept;
62 ~LibraryListWidgetItem() noexcept;
63
64 // Getters
65 const FilePath& getLibraryFilePath() const noexcept { return mLibDir; }
66 QString getName() const noexcept;
67 bool isRemoteLibrary() const noexcept { return mIsRemoteLibrary; }
68
69 // Operator Overloadings
71
72protected: // Methods
73 void mouseDoubleClickEvent(QMouseEvent* e) noexcept override;
74
75signals:
77
78private: // Data
79 QScopedPointer<Ui::LibraryListWidgetItem> mUi;
82};
83
84/*******************************************************************************
85 * End of File
86 ******************************************************************************/
87
88} // namespace editor
89} // namespace librepcb
90
91#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 LibraryListWidgetItem class.
Definition: librarylistwidgetitem.h:51
const FilePath & getLibraryFilePath() const noexcept
Definition: librarylistwidgetitem.h:65
bool mIsRemoteLibrary
Definition: librarylistwidgetitem.h:81
QString getName() const noexcept
Definition: librarylistwidgetitem.cpp:85
LibraryListWidgetItem(const LibraryListWidgetItem &other)=delete
void openLibraryEditorTriggered(const FilePath &libDir)
FilePath mLibDir
Definition: librarylistwidgetitem.h:80
void mouseDoubleClickEvent(QMouseEvent *e) noexcept override
Definition: librarylistwidgetitem.cpp:93
bool isRemoteLibrary() const noexcept
Definition: librarylistwidgetitem.h:67
QScopedPointer< Ui::LibraryListWidgetItem > mUi
Definition: librarylistwidgetitem.h:79
LibraryListWidgetItem & operator=(const LibraryListWidgetItem &rhs)=delete
Definition: occmodel.cpp:77