KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sheet_synchronization_agent.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 (C) 2023 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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25
26#ifndef SHEET_SYNCHRONIZATION_AGENT_H
27#define SHEET_SYNCHRONIZATION_AGENT_H
28
29#include <functional>
30#include <sch_sheet_path.h>
31
32class EDA_ITEM;
33class SCH_HIERLABEL;
34class SCH_SHEET_PIN;
35class TOOL_MANAGER;
37class SCH_SHEET;
38class SCH_EDIT_FRAME;
39class SCH_SHEET_PATH;
40class SCH_ITEM;
42
47{
48public:
50 {
53 };
54
55 using DO_DELETE_ITEM = std::function<void( EDA_ITEM*, SCH_SHEET_PATH )>;
56
57 using MODIFICATION = std::function<void()>;
58
59 using DO_MODIFY_ITEM = std::function<void( EDA_ITEM*, SCH_SHEET_PATH, MODIFICATION const& )>;
60
61 using DO_PLACE_ITEM = std::function<void( SCH_SHEET*, SCH_SHEET_PATH,
63
64
66 DO_PLACE_ITEM aPlaceItem, TOOL_MANAGER* aToolManager,
67 SCH_EDIT_FRAME* a_frame );
69
70 void ModifyItem( SHEET_SYNCHRONIZATION_ITEM& aItem, std::function<void()> const& aDoModify,
71 const SCH_SHEET_PATH& aPath );
72
73 void ModifyItem( SCH_ITEM* aItem, std::function<void()> const& aDoModify,
75
77 SCH_SHEET_PATH const& aPath );
78
79 void PlaceSheetPin( SCH_SHEET* aSheet, SCH_SHEET_PATH const& aPath, SCH_HIERLABEL* aLabel );
80
81 void PlaceHieraLable( SCH_SHEET* aSheet, SCH_SHEET_PATH const& aPath, SCH_SHEET_PIN* aPin );
82
83
84private:
90};
91
92#endif
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:166
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:66
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
Agent for all the modifications while syncing the sheet pin and hierarchical label.
void PlaceHieraLable(SCH_SHEET *aSheet, SCH_SHEET_PATH const &aPath, SCH_SHEET_PIN *aPin)
void RemoveItem(SHEET_SYNCHRONIZATION_ITEM &aItem, SCH_SHEET *aSheet, SCH_SHEET_PATH const &aPath)
std::function< void(EDA_ITEM *, SCH_SHEET_PATH, MODIFICATION const &)> DO_MODIFY_ITEM
std::function< void(SCH_SHEET *, SCH_SHEET_PATH, SHEET_SYNCHRONIZATION_PLACEMENT, EDA_ITEM *)> DO_PLACE_ITEM
void ModifyItem(SHEET_SYNCHRONIZATION_ITEM &aItem, std::function< void()> const &aDoModify, const SCH_SHEET_PATH &aPath)
std::function< void(EDA_ITEM *, SCH_SHEET_PATH)> DO_DELETE_ITEM
void PlaceSheetPin(SCH_SHEET *aSheet, SCH_SHEET_PATH const &aPath, SCH_HIERLABEL *aLabel)
Master controller class:
Definition: tool_manager.h:62
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
SHEET_SYNCHRONIZATION_ITEM_KIND