KiCad PCB EDA Suite
Loading...
Searching...
No Matches
schematic_text_var_adapter.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 */
20
21#ifndef SCHEMATIC_TEXT_VAR_ADAPTER_H_
22#define SCHEMATIC_TEXT_VAR_ADAPTER_H_
23
24#include <schematic.h>
25#include <text_var_dependency.h>
26
27class SCH_ITEM;
28class SCH_SYMBOL;
29
30
44{
45public:
46 explicit SCHEMATIC_TEXT_VAR_ADAPTER( SCHEMATIC& aSchematic );
47 ~SCHEMATIC_TEXT_VAR_ADAPTER() override = default;
48
50 const TEXT_VAR_TRACKER& Tracker() const { return m_tracker; }
51
52 void OnSchItemsAdded( SCHEMATIC& aSch, std::vector<SCH_ITEM*>& aItems ) override;
53 void OnSchItemsRemoved( SCHEMATIC& aSch, std::vector<SCH_ITEM*>& aItems ) override;
54 void OnSchItemsChanged( SCHEMATIC& aSch, std::vector<SCH_ITEM*>& aItems ) override;
55
61 void RebuildIndex();
62
68 std::vector<TEXT_VAR_REF_KEY> ExtractSourceKeys( EDA_ITEM* aItem ) const;
69
70private:
71 void registerItem( SCH_ITEM* aItem );
72 void unregisterItem( SCH_ITEM* aItem );
73 void handleItemChanged( SCH_ITEM* aItem );
74
77};
78
79
80#endif // SCHEMATIC_TEXT_VAR_ADAPTER_H_
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:100
std::vector< TEXT_VAR_REF_KEY > ExtractSourceKeys(EDA_ITEM *aItem) const
Return the keys aItem could source as a cross-reference target.
void OnSchItemsChanged(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override
~SCHEMATIC_TEXT_VAR_ADAPTER() override=default
SCHEMATIC_TEXT_VAR_ADAPTER(SCHEMATIC &aSchematic)
void OnSchItemsRemoved(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override
const TEXT_VAR_TRACKER & Tracker() const
void RebuildIndex()
Walk every sheet in the hierarchy and register text-bearing items.
void OnSchItemsAdded(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override
Holds all the data relating to one schematic.
Definition schematic.h:89
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:168
Schematic symbol object.
Definition sch_symbol.h:76
Coordinates the dependency index with change notifications.