KiCad PCB EDA Suite
Loading...
Searching...
No Matches
lib_tree_item.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) 2018-2023 KiCad Developers, see change_log.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24
25#ifndef LIB_TREE_ITEM_H
26#define LIB_TREE_ITEM_H
27
28#include <map>
29#include <lib_id.h>
30#include <import_export.h>
31#include <eda_pattern_match.h>
32
41{
42public:
44 {
45 }
46
47 virtual LIB_ID GetLibId() const = 0;
48
49 virtual wxString GetName() const = 0;
50 virtual wxString GetLibNickname() const = 0;
51 virtual wxString GetDescription() = 0;
52
57 virtual void GetChooserFields( std::map<wxString , wxString>& aColumnMap ) {}
58
59 virtual std::vector<SEARCH_TERM> GetSearchTerms() { return std::vector<SEARCH_TERM>(); }
60
64 virtual bool IsRoot() const { return true; }
65
69 virtual wxString GetFootprint() { return wxEmptyString; }
70
74 virtual int GetPinCount() { return 0; }
75
79 virtual int GetUnitCount() const { return 0; }
80
84 virtual wxString GetUnitReference( int aUnit ) { return wxEmptyString; }
85
89 virtual wxString GetUnitDisplayName( int aUnit ) { return wxEmptyString; }
90
94 virtual bool HasUnitDisplayName( int aUnit ) { return false; }
95};
96
97#endif //LIB_TREE_ITEM_H
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
A mix-in to provide polymorphism between items stored in libraries (symbols, aliases and footprints).
Definition: lib_tree_item.h:41
virtual wxString GetUnitReference(int aUnit)
For items with units, return an identifier for unit x.
Definition: lib_tree_item.h:84
virtual wxString GetLibNickname() const =0
virtual std::vector< SEARCH_TERM > GetSearchTerms()
Definition: lib_tree_item.h:59
virtual bool HasUnitDisplayName(int aUnit)
For items with units, return true if a display name is set for x.
Definition: lib_tree_item.h:94
virtual wxString GetFootprint()
For items with footprint fields.
Definition: lib_tree_item.h:69
virtual bool IsRoot() const
For items having aliases, IsRoot() indicates the principal item.
Definition: lib_tree_item.h:64
virtual wxString GetName() const =0
virtual wxString GetDescription()=0
virtual LIB_ID GetLibId() const =0
virtual int GetUnitCount() const
For items with units, return the number of units.
Definition: lib_tree_item.h:79
virtual ~LIB_TREE_ITEM()
Definition: lib_tree_item.h:43
virtual int GetPinCount()
The pin count for symbols or the unique pad count for footprints.
Definition: lib_tree_item.h:74
virtual wxString GetUnitDisplayName(int aUnit)
For items with units, return a display name for unit x.
Definition: lib_tree_item.h:89
virtual void GetChooserFields(std::map< wxString, wxString > &aColumnMap)
Retrieves a key/value map of the fields on this item that should be exposed to the library browser/ch...
Definition: lib_tree_item.h:57
Abstract pattern-matching tool and implementations.
#define APIEXPORT
Macros which export functions from a DLL/DSO.
Definition: import_export.h:42