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 <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 SYMBOL_TREE_MODEL_ADAPTER_H
23 #define SYMBOL_TREE_MODEL_ADAPTER_H
24 
25 #include <lib_tree_model_adapter.h>
26 
27 class LIB_TABLE;
28 class SYMBOL_LIB_TABLE;
29 
31 {
32 public:
37 
43  static PTR Create( LIB_TABLE* aLibs );
44 
52  void AddLibraries( const std::vector<wxString>& aNicknames, wxWindow* aParent );
53 
54  void AddLibrary( wxString const& aLibNickname );
55 
56  wxString GenerateInfo( LIB_ID const& aLibId, int aUnit ) override;
57 
58 protected:
63 
64 private:
68  static bool m_show_progress;
69 
71 };
72 
73 #endif // SYMBOL_TREE_MODEL_ADAPTER_H
Adapter class in the component selector Model-View-Adapter (mediated MVC) architecture.
void AddLibrary(wxString const &aLibNickname)
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
SYMBOL_TREE_MODEL_ADAPTER(LIB_TABLE *aLibs)
Constructor; takes a set of libraries to be included in the search.
static PTR Create(LIB_TABLE *aLibs)
Factory function: create a model adapter in a reference-counting container.
static bool m_show_progress
Flag to only show the symbol library table load progress dialog the first time.
void AddLibraries(const std::vector< wxString > &aNicknames, wxWindow *aParent)
Add all the libraries in a SYMBOL_LIB_TABLE to the model.
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.