QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
terminalstripdrawer.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef TERMINALSTRIPDRAWER_H
19#define TERMINALSTRIPDRAWER_H
20
21#include <QPointer>
22
24
25class QPainter;
26class TerminalStrip;
27
28namespace TerminalStripDrawer
29{
31 {
32 public:
35 virtual QUuid uuid() const = 0;
36 };
37
39 {
40 public:
43 virtual QString label() const = 0;
44 virtual bool isBridged() const = 0;
45 virtual AbstractBridgeInterface* bridge() const = 0;
46 };
47
49 {
50 public:
53 virtual QVector<QSharedPointer<AbstractRealTerminalInterface>> realTerminals() const = 0;
54 };
55
57 {
58 public:
61 virtual QString installation() const = 0;
62 virtual QString location() const = 0;
63 virtual QString name() const = 0;
64 virtual QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> physicalTerminal() const = 0;
65 };
66
68 {
69 public:
70 TerminalStripDrawer(QSharedPointer<AbstractTerminalStripInterface> strip = QSharedPointer<AbstractTerminalStripInterface> { nullptr },
71 QSharedPointer<TerminalStripLayoutPattern> layout = QSharedPointer<TerminalStripLayoutPattern>());
72
73 void setStrip(QSharedPointer<AbstractTerminalStripInterface> strip);
74 void paint(QPainter *painter);
75 QRectF boundingRect() const;
76
77 void setLayout(QSharedPointer<TerminalStripLayoutPattern> layout);
78 bool haveLayout() const;
79
80 void setPreviewDraw(bool draw = true);
81
82 private:
83 int height() const;
84 int width() const;
85
86 private:
87 QSharedPointer <AbstractTerminalStripInterface> m_strip;
88 QSharedPointer<TerminalStripLayoutPattern> m_pattern;
89 bool m_preview_draw { false };
90 };
91}
92
93#endif // TERMINALSTRIPDRAWER_H
Definition terminalstripdrawer.h:31
AbstractBridgeInterface()
Definition terminalstripdrawer.h:33
virtual ~AbstractBridgeInterface()
Definition terminalstripdrawer.h:34
virtual QVector< QSharedPointer< AbstractRealTerminalInterface > > realTerminals() const =0
AbstractPhysicalTerminalInterface()
Definition terminalstripdrawer.h:51
virtual ~AbstractPhysicalTerminalInterface()
Definition terminalstripdrawer.h:52
Definition terminalstripdrawer.h:39
AbstractRealTerminalInterface()
Definition terminalstripdrawer.h:41
virtual AbstractBridgeInterface * bridge() const =0
virtual ~AbstractRealTerminalInterface()
Definition terminalstripdrawer.h:42
Definition terminalstripdrawer.h:57
virtual QVector< QSharedPointer< AbstractPhysicalTerminalInterface > > physicalTerminal() const =0
virtual ~AbstractTerminalStripInterface()
Definition terminalstripdrawer.h:60
AbstractTerminalStripInterface()
Definition terminalstripdrawer.h:59
QSharedPointer< AbstractTerminalStripInterface > m_strip
Definition terminalstripdrawer.h:87
QSharedPointer< TerminalStripLayoutPattern > m_pattern
Definition terminalstripdrawer.h:88
The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the...
Definition terminalstrip.h:45
Definition demoterminalstrip.cpp:21