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
28
class
KIWAY
;
29
30
34
struct
FOOTPRINT_MATCH_QUERY
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
54
struct
FOOTPRINT_MATCH_RESULT
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
86
FOOTPRINT_MATCH_RESULT
QueryMatchingFootprints
(
KIWAY
& aKiway,
const
FOOTPRINT_MATCH_QUERY
& aQuery );
87
88
98
bool
StartFootprintLibrariesLoad
(
KIWAY
& aKiway );
99
100
110
float
GetFootprintLibrariesLoadProgress
(
KIWAY
& aKiway );
KIWAY
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition
kiway.h:348
GetFootprintLibrariesLoadProgress
float GetFootprintLibrariesLoadProgress(KIWAY &aKiway)
Return how far the background load of the footprint libraries has got.
Definition
footprint_library_query.cpp:172
StartFootprintLibrariesLoad
bool StartFootprintLibrariesLoad(KIWAY &aKiway)
Start loading the footprint libraries in the background.
Definition
footprint_library_query.cpp:144
QueryMatchingFootprints
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).
Definition
footprint_library_query.cpp:89
FOOTPRINT_MATCH_QUERY
All the information needed to query the footprint libraries for matching footprints.
Definition
footprint_library_query.h:35
FOOTPRINT_MATCH_QUERY::m_Patterns
std::vector< wxString > m_Patterns
Wildcard patterns matched against the footprint name, or against "library:footprint" when a pattern c...
Definition
footprint_library_query.h:38
FOOTPRINT_MATCH_QUERY::m_ZeroFilters
bool m_ZeroFilters
When true, a query with no patterns (and no pin count) matches nothing rather than everything.
Definition
footprint_library_query.h:48
FOOTPRINT_MATCH_QUERY::m_PinCount
std::optional< int > m_PinCount
When greater than zero, only footprints with this many pads are returned.
Definition
footprint_library_query.h:41
FOOTPRINT_MATCH_QUERY::m_MaxResults
int m_MaxResults
Limits the number of returned footprints; zero means no limit.
Definition
footprint_library_query.h:44
FOOTPRINT_MATCH_RESULT
The outcome of a footprint match query, and the JSON encoding used to move it across the Pcbnew kifac...
Definition
footprint_library_query.h:55
FOOTPRINT_MATCH_RESULT::m_MatchingNames
std::vector< wxString > m_MatchingNames
The matching "library:footprint" names.
Definition
footprint_library_query.h:60
FOOTPRINT_MATCH_RESULT::m_Success
bool m_Success
False if the query could not be performed, in which case MatchingNames is empty.
Definition
footprint_library_query.h:57
FOOTPRINT_MATCH_RESULT::m_IsLimited
bool m_IsLimited
True if the result set is limited by the maximum number of results.
Definition
footprint_library_query.h:63
FOOTPRINT_MATCH_RESULT::FromJsonStr
static FOOTPRINT_MATCH_RESULT FromJsonStr(const wxString &aJson)
Parse the JSON object written by ToJsonStr().
Definition
footprint_library_query.cpp:29
FOOTPRINT_MATCH_RESULT::ToJsonStr
wxString ToJsonStr() const
Serialise to the JSON object that carries a result over the Pcbnew kiface.
Definition
footprint_library_query.cpp:73
src
include
footprint_library_query.h
Generated on Wed Oct 7 2026 00:05:59 for KiCad PCB EDA Suite by
1.13.2