KiCad PCB EDA Suite
symbol_tree_model_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 (C) 2017 Chris Pavlina <[email protected]>
5 * Copyright (C) 2014 Henner Zeller <[email protected]>
6 * Copyright (C) 2014-2022 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef SYMBOL_TREE_MODEL_ADAPTER_H
23#define SYMBOL_TREE_MODEL_ADAPTER_H
24
26
27class LIB_TABLE;
29class SCH_BASE_FRAME;
30
32{
33public:
38
44 static wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> Create( EDA_BASE_FRAME* aParent,
45 LIB_TABLE* aLibs );
46
55 bool AddLibraries( const std::vector<wxString>& aNicknames, SCH_BASE_FRAME* aFrame );
56
57 void AddLibrary( wxString const& aLibNickname, bool pinned );
58
59 wxString GenerateInfo( LIB_ID const& aLibId, int aUnit ) override;
60
61protected:
66
67 bool isSymbolModel() override { return true; }
68
69private:
70 friend class SYMBOL_ASYNC_LOADER;
74 static bool m_show_progress;
75
77};
78
79#endif // SYMBOL_TREE_MODEL_ADAPTER_H
The base frame for deriving all KiCad main window classes.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
Manage LIB_TABLE_ROW records (rows), and can be searched based on library nickname.
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
wxString GenerateInfo(LIB_ID const &aLibId, int aUnit) override
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(EDA_BASE_FRAME *aParent, LIB_TABLE *aLibs)
Factory function: create a model adapter in a reference-counting container.
bool AddLibraries(const std::vector< wxString > &aNicknames, SCH_BASE_FRAME *aFrame)
Add all the libraries in a SYMBOL_LIB_TABLE to the model.
static bool m_show_progress
Flag to only show the symbol library table load progress dialog the first time.
void AddLibrary(wxString const &aLibNickname, bool pinned)
SYMBOL_TREE_MODEL_ADAPTER(EDA_BASE_FRAME *aParent, LIB_TABLE *aLibs)
Constructor; takes a set of libraries to be included in the search.