LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_WORKSPACE_LIBRARYLISTWIDGETITEM_H
21 #define LIBREPCB_WORKSPACE_LIBRARYLISTWIDGETITEM_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
27 
28 #include <QtCore>
29 #include <QtWidgets>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 
36 namespace workspace {
37 class Workspace;
38 }
39 
40 namespace library {
41 namespace manager {
42 
43 namespace Ui {
44 class LibraryListWidgetItem;
45 }
46 
47 /*******************************************************************************
48  * Class LibraryListWidgetItem
49  ******************************************************************************/
50 
57 class LibraryListWidgetItem final : public QWidget {
58  Q_OBJECT
59 
60 public:
61  // Constructors / Destructor
62  LibraryListWidgetItem() noexcept;
63  LibraryListWidgetItem(const LibraryListWidgetItem& other) = delete;
65  const QString& name = "",
66  const QString& description = "",
67  const QPixmap& icon = QPixmap()) noexcept;
68  ~LibraryListWidgetItem() noexcept;
69 
70  // Getters
71  const FilePath& getLibraryFilePath() const noexcept { return mLibDir; }
72  QString getName() const noexcept;
73  bool isRemoteLibrary() const noexcept { return mIsRemoteLibrary; }
74 
75  // Operator Overloadings
77 
78 protected: // Methods
79  void mouseDoubleClickEvent(QMouseEvent* e) noexcept override;
80 
81 signals:
82  void openLibraryEditorTriggered(const FilePath& libDir);
83 
84 private: // Data
85  QScopedPointer<Ui::LibraryListWidgetItem> mUi;
88 };
89 
90 /*******************************************************************************
91  * End of File
92  ******************************************************************************/
93 
94 } // namespace manager
95 } // namespace library
96 } // namespace librepcb
97 
98 #endif // LIBREPCB_WORKSPACE_LIBRARYLISTWIDGETITEM_H
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
Definition: workspace.h:65
void openLibraryEditorTriggered(const FilePath &libDir)
The LibraryListWidgetItem class.
Definition: librarylistwidgetitem.h:57
FilePath mLibDir
Definition: librarylistwidgetitem.h:86
QScopedPointer< Ui::LibraryListWidgetItem > mUi
Definition: librarylistwidgetitem.h:85
const FilePath & getLibraryFilePath() const noexcept
Definition: librarylistwidgetitem.h:71
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:130
LibraryListWidgetItem & operator=(const LibraryListWidgetItem &rhs)=delete
~LibraryListWidgetItem() noexcept
Definition: librarylistwidgetitem.cpp:78
bool isRemoteLibrary() const noexcept
Definition: librarylistwidgetitem.h:73
bool mIsRemoteLibrary
Definition: librarylistwidgetitem.h:87
QString getName() const noexcept
Definition: librarylistwidgetitem.cpp:85
void mouseDoubleClickEvent(QMouseEvent *e) noexceptoverride
Definition: librarylistwidgetitem.cpp:93