KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_library_query.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
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <optional>
23#include <vector>
24
25#include <wx/string.h>
26
27
28class KIWAY;
29
30
35{
38 std::vector<wxString> m_Patterns;
39
41 std::optional<int> m_PinCount;
42
44 int m_MaxResults = 400;
45
48 bool m_ZeroFilters = true;
49};
50
51
55{
57 bool m_Success = false;
58
60 std::vector<wxString> m_MatchingNames;
61
63 bool m_IsLimited = false;
64
66 wxString ToJsonStr() const;
67
70 static FOOTPRINT_MATCH_RESULT FromJsonStr( const wxString& aJson );
71};
72
73
87
88
99
100
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:348
float GetFootprintLibrariesLoadProgress(KIWAY &aKiway)
Return how far the background load of the footprint libraries has got.
bool StartFootprintLibrariesLoad(KIWAY &aKiway)
Start loading the footprint libraries in the background.
FOOTPRINT_MATCH_RESULT QueryMatchingFootprints(KIWAY &aKiway, const FOOTPRINT_MATCH_QUERY &aQuery)
Ask the footprint libraries, for the footprints matching a query (over the Pcbnew kiface).
All the information needed to query the footprint libraries for matching footprints.
std::vector< wxString > m_Patterns
Wildcard patterns matched against the footprint name, or against "library:footprint" when a pattern c...
bool m_ZeroFilters
When true, a query with no patterns (and no pin count) matches nothing rather than everything.
std::optional< int > m_PinCount
When greater than zero, only footprints with this many pads are returned.
int m_MaxResults
Limits the number of returned footprints; zero means no limit.
The outcome of a footprint match query, and the JSON encoding used to move it across the Pcbnew kifac...
std::vector< wxString > m_MatchingNames
The matching "library:footprint" names.
bool m_Success
False if the query could not be performed, in which case MatchingNames is empty.
bool m_IsLimited
True if the result set is limited by the maximum number of results.
static FOOTPRINT_MATCH_RESULT FromJsonStr(const wxString &aJson)
Parse the JSON object written by ToJsonStr().
wxString ToJsonStr() const
Serialise to the JSON object that carries a result over the Pcbnew kiface.