KiCad PCB EDA Suite
Loading...
Searching...
No Matches
design_block_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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef DESIGN_BLOCK_TREE_MODEL_ADAPTER_H
21#define DESIGN_BLOCK_TREE_MODEL_ADAPTER_H
22
24
25class LIB_TABLE;
27
29{
30public:
36 static wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> Create( EDA_BASE_FRAME* aParent,
37 LIB_TABLE* aLibs,
38 APP_SETTINGS_BASE::LIB_TREE& aSettings );
39
40 void AddLibraries( EDA_BASE_FRAME* aParent );
41 void ClearLibraries();
42
43 wxString GenerateInfo( LIB_ID const& aLibId, int aUnit ) override;
44
46
47 void SetLibTable( DESIGN_BLOCK_LIB_TABLE* aLibs ) { m_libs = aLibs; }
48
49protected:
54 APP_SETTINGS_BASE::LIB_TREE& aSettings );
55
56 std::vector<LIB_TREE_ITEM*> getDesignBlocks( EDA_BASE_FRAME* aParent,
57 const wxString& aLibName );
58
60
61protected:
64};
65
66#endif // DESIGN_BLOCK_TREE_MODEL_ADAPTER_H
std::vector< LIB_TREE_ITEM * > getDesignBlocks(EDA_BASE_FRAME *aParent, const wxString &aLibName)
wxString GenerateInfo(LIB_ID const &aLibId, int aUnit) override
TOOL_INTERACTIVE * GetContextMenuTool() override
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(EDA_BASE_FRAME *aParent, LIB_TABLE *aLibs, APP_SETTINGS_BASE::LIB_TREE &aSettings)
Factory function: create a model adapter in a reference-counting container.
void SetLibTable(DESIGN_BLOCK_LIB_TABLE *aLibs)
PROJECT::LIB_TYPE_T getLibType() override
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.
LIB_TYPE_T
Definition: project.h:189
@ DESIGN_BLOCK_LIB
Definition: project.h:192