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 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
22#ifndef SHEET_SYNCHRONIZATION_AGENT_H
23#define SHEET_SYNCHRONIZATION_AGENT_H
24
25#include <functional>
26#include <set>
27#include <sch_sheet_path.h>
28
29class EDA_ITEM;
30class SCH_HIERLABEL;
31class SCH_SHEET_PIN;
32class TOOL_MANAGER;
34class SCH_SHEET;
35class SCH_EDIT_FRAME;
36class SCH_SHEET_PATH;
37class SCH_ITEM;
39
44{
45public:
51
52 using DO_DELETE_ITEM = std::function<void( EDA_ITEM*, SCH_SHEET_PATH )>;
53
54 using MODIFICATION = std::function<void()>;
55
56 using DO_MODIFY_ITEM = std::function<void( EDA_ITEM*, SCH_SHEET_PATH, MODIFICATION const& )>;
57
60 std::set<EDA_ITEM*> const& )>;
61
62
64 DO_PLACE_ITEM aPlaceItem, TOOL_MANAGER* aToolManager,
65 SCH_EDIT_FRAME* a_frame );
67
68 void ModifyItem( SHEET_SYNCHRONIZATION_ITEM& aItem, std::function<void()> const& aDoModify,
69 const SCH_SHEET_PATH& aPath );
70
71 void ModifyItem( SCH_ITEM* aItem, std::function<void()> const& aDoModify,
73
75 SCH_SHEET_PATH const& aPath );
76
77 void PlaceSheetPin( SCH_SHEET* aSheet, SCH_SHEET_PATH const& aPath,
78 std::set<EDA_ITEM*> const& aLabels );
79
80 void PlaceHieraLable( SCH_SHEET* aSheet, SCH_SHEET_PATH const& aPath,
81 std::set<EDA_ITEM*> const& aPins );
82
83
84private:
88};
89
90#endif
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:162
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.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:44
void RemoveItem(SHEET_SYNCHRONIZATION_ITEM &aItem, SCH_SHEET *aSheet, SCH_SHEET_PATH const &aPath)
void PlaceHieraLable(SCH_SHEET *aSheet, SCH_SHEET_PATH const &aPath, std::set< EDA_ITEM * > const &aPins)
std::function< void(EDA_ITEM *, SCH_SHEET_PATH, MODIFICATION const &)> DO_MODIFY_ITEM
void PlaceSheetPin(SCH_SHEET *aSheet, SCH_SHEET_PATH const &aPath, std::set< EDA_ITEM * > const &aLabels)
std::function< void(SCH_SHEET *, SCH_SHEET_PATH, SHEET_SYNCHRONIZATION_PLACEMENT, std::set< EDA_ITEM * > const &)> 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
SHEET_SYNCHRONIZATION_AGENT(DO_MODIFY_ITEM aDoModify, DO_DELETE_ITEM aDoDelete, DO_PLACE_ITEM aPlaceItem, TOOL_MANAGER *aToolManager, SCH_EDIT_FRAME *a_frame)
Master controller class:
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
SHEET_SYNCHRONIZATION_ITEM_KIND