LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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 {
36
37class LengthUnit;
38class Point;
39
40namespace editor {
41
42class GuiApplication;
43
44/*******************************************************************************
45 * Class WindowTab
46 ******************************************************************************/
47
51class WindowTab : public QObject {
52 Q_OBJECT
53
54public:
55 // Signals
57
58 // Constructors / Destructor
59 WindowTab() = delete;
60 WindowTab(const WindowTab& other) = delete;
61 explicit WindowTab(GuiApplication& app, QObject* parent = nullptr) noexcept;
62 virtual ~WindowTab() noexcept;
63
64 // General Methods
65 virtual ui::TabData getUiData() const noexcept = 0;
66 virtual void setUiData(const ui::TabData& data) noexcept;
67 virtual void activate() noexcept {}
68 virtual void deactivate() noexcept {}
69 virtual void trigger(ui::TabAction a) noexcept;
70 virtual slint::Image renderScene(float width, float height,
71 int scene) noexcept;
72 virtual bool processScenePointerEvent(
73 const QPointF& pos, slint::private_api::PointerEvent e) noexcept;
74 virtual bool processSceneScrolled(
75 const QPointF& pos, slint::private_api::PointerScrollEvent e) noexcept;
76 virtual bool processSceneKeyEvent(
77 const slint::private_api::KeyEvent& e) noexcept;
78
91 virtual bool requestClose() noexcept { return true; }
92
93 // Operator Overloadings
94 WindowTab& operator=(const WindowTab& rhs) = delete;
95
96signals:
97 void panelPageRequested(ui::PanelPage p);
100 void statusBarMessageChanged(const QString& message, int timeoutMs);
101 void cursorCoordinatesChanged(const Point& pos, const LengthUnit& unit);
102
103protected:
105};
106
107/*******************************************************************************
108 * End of File
109 ******************************************************************************/
110
111} // namespace editor
112} // namespace librepcb
113
114#endif
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition lengthunit.h:62
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Signal class is used to emit signals on non-QObject derived classes.
Definition signalslot.h:65
The GuiApplication class.
Definition guiapplication.h:61
The WindowTab class.
Definition windowtab.h:51
virtual slint::Image renderScene(float width, float height, int scene) noexcept
Definition windowtab.cpp:66
virtual void deactivate() noexcept
Definition windowtab.h:68
virtual void activate() noexcept
Definition windowtab.h:67
void cursorCoordinatesChanged(const Point &pos, const LengthUnit &unit)
virtual bool processSceneKeyEvent(const slint::private_api::KeyEvent &e) noexcept
Definition windowtab.cpp:88
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 bool processSceneScrolled(const QPointF &pos, slint::private_api::PointerScrollEvent e) noexcept
Definition windowtab.cpp:81
virtual ui::TabData getUiData() const noexcept=0
void panelPageRequested(ui::PanelPage p)
virtual bool requestClose() noexcept
Request to close the tab.
Definition windowtab.h:91
virtual void trigger(ui::TabAction a) noexcept
Definition windowtab.cpp:52
virtual bool processScenePointerEvent(const QPointF &pos, slint::private_api::PointerEvent e) noexcept
Definition windowtab.cpp:74
WindowTab & operator=(const WindowTab &rhs)=delete
Signal< WindowTab > onUiDataChanged
Definition windowtab.h:56
GuiApplication & mApp
Definition windowtab.h:104
Definition occmodel.cpp:77