LibrePCB Developers Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
windowtab.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_WINDOWTAB_H
21#define LIBREPCB_EDITOR_WINDOWTAB_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "appwindow.h"
27
29
30#include <QtCore>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36namespace editor {
37
38class GuiApplication;
39
40/*******************************************************************************
41 * Class WindowTab
42 ******************************************************************************/
43
47class WindowTab : public QObject {
48 Q_OBJECT
49
50public:
51 // Signals
53
54 // Constructors / Destructor
55 WindowTab() = delete;
56 WindowTab(const WindowTab& other) = delete;
57 explicit WindowTab(GuiApplication& app, QObject* parent = nullptr) noexcept;
58 virtual ~WindowTab() noexcept;
59
60 // General Methods
61 virtual ui::TabData getUiData() const noexcept = 0;
62 virtual void setUiData(const ui::TabData& data) noexcept;
63 virtual void activate() noexcept {}
64 virtual void deactivate() noexcept {}
65
66 // Operator Overloadings
67 WindowTab& operator=(const WindowTab& rhs) = delete;
68
69signals:
70 void panelPageRequested(ui::PanelPage p);
72 void statusBarMessageChanged(const QString& message, int timeoutMs);
73
74protected:
75 virtual void triggerAsync(ui::Action a) noexcept;
76
78};
79
80/*******************************************************************************
81 * End of File
82 ******************************************************************************/
83
84} // namespace editor
85} // namespace librepcb
86
87#endif
The Signal class is used to emit signals on non-QObject derived classes.
Definition signalslot.h:65
The GuiApplication class.
Definition guiapplication.h:60
The WindowTab class.
Definition windowtab.h:47
virtual void deactivate() noexcept
Definition windowtab.h:64
virtual void activate() noexcept
Definition windowtab.h:63
virtual void triggerAsync(ui::Action a) noexcept
Definition windowtab.cpp:61
virtual void setUiData(const ui::TabData &data) noexcept
Definition windowtab.cpp:48
void statusBarMessageChanged(const QString &message, int timeoutMs)
WindowTab(const WindowTab &other)=delete
virtual ui::TabData getUiData() const noexcept=0
void panelPageRequested(ui::PanelPage p)
WindowTab & operator=(const WindowTab &rhs)=delete
Signal< WindowTab > onUiDataChanged
Definition windowtab.h:52
GuiApplication & mApp
Definition windowtab.h:77
Definition occmodel.cpp:77