KiCad PCB EDA Suite
Loading...
Searching...
No Matches
fp_tree_synchronizing_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 CERN
5 * @author Maciej Suminski <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef FP_TREE_SYNCHRONIZING_ADAPTER_H
22#define FP_TREE_SYNCHRONIZING_ADAPTER_H
23
25#include <set>
26
28
30{
31public:
32 static wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> Create( FOOTPRINT_EDIT_FRAME* aFrame,
34
35 bool IsContainer( const wxDataViewItem& aItem ) const override;
36
37 void Sync( FOOTPRINT_LIBRARY_ADAPTER* aLibs );
38
39 int GetLibrariesCount() const override;
40
42
43 wxDataViewItem GetCurrentDataViewItem() override;
44
45 bool HasPreview( const wxDataViewItem& aItem ) override;
46 void ShowPreview( wxWindow* aParent, const wxDataViewItem& aItem ) override;
47 void ShutdownPreview( wxWindow* aParent ) override;
48
49protected:
51
52 void updateLibrary( LIB_TREE_NODE_LIBRARY& aLibNode );
53
54 LIB_TREE_NODE::PTR_VECTOR::iterator deleteLibrary( LIB_TREE_NODE::PTR_VECTOR::iterator& aLibNodeIt );
55
56 void GetValue( wxVariant& aVariant, wxDataViewItem const& aItem,
57 unsigned int aCol ) const override;
58 bool GetAttr( wxDataViewItem const& aItem, unsigned int aCol,
59 wxDataViewItemAttr& aAttr ) const override;
60
61protected:
63 std::set<wxString> m_libMap; // Set to indicate libraries currently in tree
64};
65
66#endif /* FP_TREE_SYNCHRONIZING_ADAPTER_H */
An interface to the global shared library manager that is schematic-specific and linked to one projec...
FP_TREE_MODEL_ADAPTER(PCB_BASE_FRAME *aParent, FOOTPRINT_LIBRARY_ADAPTER *aLibs)
Constructor; takes a set of libraries to be included in the search.
FP_TREE_SYNCHRONIZING_ADAPTER(FOOTPRINT_EDIT_FRAME *aFrame, FOOTPRINT_LIBRARY_ADAPTER *aLibs)
bool HasPreview(const wxDataViewItem &aItem) override
void Sync(FOOTPRINT_LIBRARY_ADAPTER *aLibs)
bool GetAttr(wxDataViewItem const &aItem, unsigned int aCol, wxDataViewItemAttr &aAttr) const override
void updateLibrary(LIB_TREE_NODE_LIBRARY &aLibNode)
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(FOOTPRINT_EDIT_FRAME *aFrame, FOOTPRINT_LIBRARY_ADAPTER *aLibs)
int GetLibrariesCount() const override
Return the number of libraries loaded in the tree.
void ShutdownPreview(wxWindow *aParent) override
bool IsContainer(const wxDataViewItem &aItem) const override
LIB_TREE_NODE::PTR_VECTOR::iterator deleteLibrary(LIB_TREE_NODE::PTR_VECTOR::iterator &aLibNodeIt)
TOOL_INTERACTIVE * GetContextMenuTool() override
void ShowPreview(wxWindow *aParent, const wxDataViewItem &aItem) override
void GetValue(wxVariant &aVariant, wxDataViewItem const &aItem, unsigned int aCol) const override
Node type: library.