KiCad PCB EDA Suite
fp_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 <pavlina.chris@gmail.com>
5  * Copyright (C) 2014 Henner Zeller <h.zeller@acm.org>
6  * Copyright (C) 2014-2017 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 FP_TREE_MODEL_ADAPTER_H
23 #define FP_TREE_MODEL_ADAPTER_H
24 
25 #include <lib_tree_model_adapter.h>
26 #include <footprint_info.h>
27 
28 class LIB_TABLE;
29 class FP_LIB_TABLE;
30 
32 {
33 public:
38 
44  static PTR Create( LIB_TABLE* aLibs );
45 
46  void AddLibraries();
47 
48  wxString GenerateInfo( LIB_ID const& aLibId, int aUnit ) override;
49 
50 protected:
55 
56  std::vector<LIB_TREE_ITEM*> getFootprints( const wxString& aLibName );
57 
59 };
60 
61 #endif // FP_TREE_MODEL_ADAPTER_H
Adapter class in the component selector Model-View-Adapter (mediated MVC) architecture.
FP_TREE_MODEL_ADAPTER(LIB_TABLE *aLibs)
Constructor; takes a set of libraries to be included in the search.
wxString GenerateInfo(LIB_ID const &aLibId, int aUnit) override
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
std::vector< LIB_TREE_ITEM * > getFootprints(const wxString &aLibName)
static PTR Create(LIB_TABLE *aLibs)
Factory function: create a model adapter in a reference-counting container.
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > PTR
Reference-counting container for a pointer to CMP_TREE_MODEL_ADAPTER_BASE.
Manage LIB_TABLE_ROW records (rows), and can be searched based on library nickname.