KiCad PCB EDA Suite
class_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 <miguelangel@ajo.es>
5  * Copyright (C) 2013 KiCad Developers, see CHANGELOG.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 CLASS_FOOTPRINT_WIZARD_H
32 #define CLASS_FOOTPRINT_WIZARD_H
33 #include <vector>
34 #include <wxPcbStruct.h>
35 
36 // Allowable parameter types for PCB wizards
37 const wxString WIZARD_PARAM_UNITS_MM = "mm"; // Millimetres
38 const wxString WIZARD_PARAM_UNITS_MILS = "mils"; // Mils / thou
39 const wxString WIZARD_PARAM_UNITS_FLOAT = "float"; // Floating point (dimensionless)
40 const wxString WIZARD_PARAM_UNITS_INTEGER = "integer"; // Integer (dimensionless)
41 const wxString WIZARD_PARAM_UNITS_BOOL = "bool"; // Boolean option
42 const wxString WIZARD_PARAM_UNITS_RADIANS = "radians"; // Angle (radians)
43 const wxString WIZARD_PARAM_UNITS_DEGREES = "degrees"; // Angle (degrees)
44 const wxString WIZARD_PARAM_UNITS_PERCENT = "%"; // Percent (0% -> 100%)
45 const wxString WIZARD_PARAM_UNITS_STRING = "string"; // String
46 
52 {
53 public:
55  virtual ~FOOTPRINT_WIZARD();
56 
61  virtual wxString GetName() = 0;
62 
67  virtual wxString GetImage() = 0;
68 
73  virtual wxString GetDescription() = 0;
74 
79  virtual int GetNumParameterPages() = 0;
80 
86  virtual wxString GetParameterPageName( int aPage ) = 0;
87 
93  virtual wxArrayString GetParameterNames( int aPage ) = 0;
94 
101  virtual wxArrayString GetParameterTypes( int aPage ) = 0;
102 
103 
109  virtual wxArrayString GetParameterValues( int aPage ) = 0;
110 
116  virtual wxArrayString GetParameterErrors( int aPage ) = 0;
117 
123  virtual wxArrayString GetParameterHints( int aPage ) = 0;
124 
130  virtual wxArrayString GetParameterDesignators( int aPage ) = 0;
131 
138  virtual wxString SetParameterValues( int aPage, wxArrayString& aValues ) = 0;
139 
144  virtual void ResetParameters() = 0;
145 
153  virtual MODULE* GetFootprint( wxString* aMessage ) = 0;
154 
160  virtual void* GetObject() = 0;
161 
167  void register_wizard();
168 };
169 
170 
172 {
173 private:
177  static std::vector<FOOTPRINT_WIZARD*> m_FootprintWizards;
178 
179 public:
180 
190  static void register_wizard( FOOTPRINT_WIZARD* aWizard );
191 
200  static bool deregister_object( void* aObject );
201 
207  static FOOTPRINT_WIZARD* GetWizard( wxString aName );
208 
214  static FOOTPRINT_WIZARD* GetWizard( int aIndex );
215 
220  static int GetWizardsCount();
221 };
222 
223 #endif /* PCBNEW_FOOTPRINT_WIZARDS_H */
virtual wxArrayString GetParameterErrors(int aPage)=0
Function GetParameterErrors.
const wxString WIZARD_PARAM_UNITS_MILS
virtual wxString SetParameterValues(int aPage, wxArrayString &aValues)=0
Function SetParameterValues.
static FOOTPRINT_WIZARD * GetWizard(wxString aName)
Function GetWizard.
virtual wxString GetParameterPageName(int aPage)=0
Function GetParameterPageName.
virtual wxArrayString GetParameterTypes(int aPage)=0
Function GetParameterTypes.
virtual void * GetObject()=0
Function GetObject This method gets the pointer to the object from where this wizard constructs...
const wxString WIZARD_PARAM_UNITS_BOOL
void register_wizard()
Function register_wizard It's the standard method of a "FOOTPRINT_WIZARD" to register itself into the...
virtual wxArrayString GetParameterNames(int aPage)=0
Function GetParameterNames.
const wxString WIZARD_PARAM_UNITS_RADIANS
const wxString WIZARD_PARAM_UNITS_PERCENT
const wxString WIZARD_PARAM_UNITS_STRING
static void register_wizard(FOOTPRINT_WIZARD *aWizard)
Function register_wizard A footprint wizard calls this static method when it wants to register itself...
virtual wxArrayString GetParameterDesignators(int aPage)=0
Function GetParamaterDesignators.
virtual wxString GetDescription()=0
Function GetDescription.
const wxString WIZARD_PARAM_UNITS_INTEGER
static int GetWizardsCount()
Function GetWizardsCount.
virtual wxString GetImage()=0
Function GetImage.
virtual MODULE * GetFootprint(wxString *aMessage)=0
Function GetModule This method builds the module itself and returns it to the caller function...
virtual int GetNumParameterPages()=0
Function GetNumParameterPages.
const wxString WIZARD_PARAM_UNITS_DEGREES
static bool deregister_object(void *aObject)
Function deregister_object Anyone calls this method to deregister an object which builds a wizard...
virtual wxString GetName()=0
Function GetName.
const wxString WIZARD_PARAM_UNITS_FLOAT
const wxString WIZARD_PARAM_UNITS_MM
virtual wxArrayString GetParameterValues(int aPage)=0
Function GetParameterValues.
virtual void ResetParameters()=0
Function ResetParameters Reset all wizard parameters to default values.
virtual wxArrayString GetParameterHints(int aPage)=0
Function GetParameterHints.
Class FOOTPRINT_WIZARD This is the parent class from where any footprint wizard class must derive...
static std::vector< FOOTPRINT_WIZARD * > m_FootprintWizards
FOOTPRINT_WIZARD system wide static list.