KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sheet_synchronization_item.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2023 Ethan Chien <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef SHEET_SYNCHRONIZATION_ITEM_H
22#define SHEET_SYNCHRONIZATION_ITEM_H
23
24#include <wx/bitmap.h>
25#include <wx/string.h>
26#include <functional>
27
28class EDA_ITEM;
29class SCH_HIERLABEL;
30class SCH_SHEET_PIN;
31class SCH_SHEET;
32class SCH_COMMIT;
33class SCH_ITEM;
34
41
42using SCREEN_UPDATER = std::function<void( EDA_ITEM* )>;
43
45{
46public:
47 virtual ~SHEET_SYNCHRONIZATION_ITEM() = default;
48
49 virtual wxString GetName() const = 0;
50
51 virtual int GetShape() const = 0;
52
53 virtual wxBitmap& GetBitmap() const = 0;
54
55 virtual SCH_ITEM* GetItem() const = 0;
56
58};
59
60
62{
63public:
65
66 SCH_HIERLABEL* GetLabel() const { return m_label; }
67
68 wxString GetName() const override;
69
70 int GetShape() const override;
71
72 wxBitmap& GetBitmap() const override;
73
74 SCH_ITEM* GetItem() const override;
75
77
78private:
80};
81
82
84{
85public:
87
88 SCH_SHEET_PIN* GetPin() const { return m_pin; }
89
90 wxString GetName() const override;
91
92 int GetShape() const override;
93
94 wxBitmap& GetBitmap() const override;
95
96 SCH_ITEM* GetItem() const override;
97
99
100private:
102};
103
104
106{
107public:
109
112
113 SCH_HIERLABEL* GetLabel() const { return m_label; }
114
115 SCH_SHEET_PIN* GetPin() const { return m_pin; }
116
117 wxString GetName() const override;
118
119 int GetShape() const override;
120
121 wxBitmap& GetBitmap() const override;
122
123 SCH_ITEM* GetItem() const override;
124
126
127private:
130};
131
132
133#endif
ASSOCIATED_SCH_LABEL_PIN(SCH_HIERLABEL *aLabel, SCH_SHEET_PIN *aPin)
SCH_ITEM * GetItem() const override
SHEET_SYNCHRONIZATION_ITEM_KIND GetKind() const override
wxBitmap & GetBitmap() const override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
SCH_HIERLABEL_SYNCHRONIZATION_ITEM(SCH_HIERLABEL *aLabel, SCH_SHEET *aSheet)
SHEET_SYNCHRONIZATION_ITEM_KIND GetKind() const override
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:162
SCH_SHEET_PIN_SYNCHRONIZATION_ITEM(SCH_SHEET_PIN *aPin, SCH_SHEET *aSheet)
SHEET_SYNCHRONIZATION_ITEM_KIND GetKind() const override
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:44
virtual int GetShape() const =0
virtual SCH_ITEM * GetItem() const =0
virtual wxBitmap & GetBitmap() const =0
virtual SHEET_SYNCHRONIZATION_ITEM_KIND GetKind() const =0
virtual wxString GetName() const =0
virtual ~SHEET_SYNCHRONIZATION_ITEM()=default
std::function< void(EDA_ITEM *)> SCREEN_UPDATER
SHEET_SYNCHRONIZATION_ITEM_KIND