KiCad PCB EDA Suite
footprint_wizard.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) 2013 NBEE Embedded Systems SL, Miguel Angel Ajo <[email protected]>
5 * Copyright (C) 2013-2021 KiCad Developers, see AUTHORS.txt for contributors.
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 2
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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25
31#ifndef FOOTPRINT_WIZARD_H
32#define FOOTPRINT_WIZARD_H
33
34#include <vector>
35#include <pcb_edit_frame.h>
36
37// Allowable parameter types for PCB wizards
38const wxString WIZARD_PARAM_UNITS_MM = wxT( "mm" ); // Millimetres
39const wxString WIZARD_PARAM_UNITS_MILS = wxT( "mils" ); // Mils / thou
40const wxString WIZARD_PARAM_UNITS_FLOAT = wxT( "float" ); // Floating point (dimensionless)
41const wxString WIZARD_PARAM_UNITS_INTEGER = wxT( "integer" ); // Integer (dimensionless)
42const wxString WIZARD_PARAM_UNITS_BOOL = wxT( "bool" ); // Boolean option
43const wxString WIZARD_PARAM_UNITS_RADIANS = wxT( "radians" ); // Angle (radians)
44const wxString WIZARD_PARAM_UNITS_DEGREES = wxT( "degrees" ); // Angle (degrees)
45const wxString WIZARD_PARAM_UNITS_PERCENT = wxT( "%" ); // Percent (0% -> 100%)
46const wxString WIZARD_PARAM_UNITS_STRING = wxT( "string" ); // String
47
52{
53public:
55 virtual ~FOOTPRINT_WIZARD();
56
60 virtual wxString GetName() = 0;
61
65 virtual wxString GetImage() = 0;
66
70 virtual wxString GetDescription() = 0;
71
75 virtual int GetNumParameterPages() = 0;
76
81 virtual wxString GetParameterPageName( int aPage ) = 0;
82
87 virtual wxArrayString GetParameterNames( int aPage ) = 0;
88
94 virtual wxArrayString GetParameterTypes( int aPage ) = 0;
95
96
101 virtual wxArrayString GetParameterValues( int aPage ) = 0;
102
107 virtual wxArrayString GetParameterErrors( int aPage ) = 0;
108
113 virtual wxArrayString GetParameterHints( int aPage ) = 0;
114
119 virtual wxArrayString GetParameterDesignators( int aPage ) = 0;
120
126 virtual wxString SetParameterValues( int aPage, wxArrayString& aValues ) = 0;
127
131 virtual void ResetParameters() = 0;
132
139 virtual FOOTPRINT* GetFootprint( wxString* aMessage ) = 0;
140
146 virtual void* GetObject() = 0;
147
152 void register_wizard();
153};
154
155
157{
158public:
159
169 static void register_wizard( FOOTPRINT_WIZARD* aWizard );
170
178 static bool deregister_object( void* aObject );
179
184 static FOOTPRINT_WIZARD* GetWizard( const wxString& aName );
185
190 static FOOTPRINT_WIZARD* GetWizard( int aIndex );
191
195 static int GetWizardsCount();
196
197private:
201 static std::vector<FOOTPRINT_WIZARD*> m_FootprintWizards;
202};
203
204#endif /* PCBNEW_FOOTPRINT_WIZARDS_H */
static void register_wizard(FOOTPRINT_WIZARD *aWizard)
A footprint wizard calls this static method when it wants to register itself into the system wizards.
static std::vector< FOOTPRINT_WIZARD * > m_FootprintWizards
FOOTPRINT_WIZARD system wide static list.
static bool deregister_object(void *aObject)
Unregister an object which builds a wizard.
static FOOTPRINT_WIZARD * GetWizard(const wxString &aName)
The parent class from where any footprint wizard class must derive.
virtual wxArrayString GetParameterHints(int aPage)=0
virtual ~FOOTPRINT_WIZARD()
virtual wxString SetParameterValues(int aPage, wxArrayString &aValues)=0
virtual void ResetParameters()=0
Reset all wizard parameters to default values.
virtual void * GetObject()=0
Get the object from where this wizard constructs.
virtual wxArrayString GetParameterNames(int aPage)=0
virtual wxArrayString GetParameterValues(int aPage)=0
virtual wxString GetParameterPageName(int aPage)=0
virtual wxArrayString GetParameterErrors(int aPage)=0
virtual wxString GetName()=0
void register_wizard()
The standard method of a "FOOTPRINT_WIZARD" to register itself into the FOOTPRINT_WIZARD_LIST singlet...
virtual wxArrayString GetParameterTypes(int aPage)=0
virtual int GetNumParameterPages()=0
virtual wxString GetDescription()=0
virtual FOOTPRINT * GetFootprint(wxString *aMessage)=0
Build the footprint itself and returns it to the caller function.
virtual wxArrayString GetParameterDesignators(int aPage)=0
virtual wxString GetImage()=0
const wxString WIZARD_PARAM_UNITS_PERCENT
const wxString WIZARD_PARAM_UNITS_RADIANS
const wxString WIZARD_PARAM_UNITS_MM
const wxString WIZARD_PARAM_UNITS_INTEGER
const wxString WIZARD_PARAM_UNITS_BOOL
const wxString WIZARD_PARAM_UNITS_FLOAT
const wxString WIZARD_PARAM_UNITS_STRING
const wxString WIZARD_PARAM_UNITS_MILS
const wxString WIZARD_PARAM_UNITS_DEGREES