KiCad PCB EDA Suite
pcbnew_footprint_wizards.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) 2016-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
30#ifndef PCBNEW_FOOTPRINT_WIZARDS_H
31#define PCBNEW_FOOTPRINT_WIZARDS_H
32
33#undef HAVE_CLOCK_GETTIME // macro is defined in Python.h and causes redefine warning
34#include <Python.h>
35#undef HAVE_CLOCK_GETTIME
36
37#include <vector>
38#include <footprint_wizard.h>
39
40
42{
43public:
44 PYTHON_FOOTPRINT_WIZARD( PyObject* wizard );
46
47 wxString GetName() override;
48 wxString GetImage() override;
49 wxString GetDescription() override;
50 int GetNumParameterPages() override;
51 wxString GetParameterPageName( int aPage ) override;
52 wxArrayString GetParameterNames( int aPage ) override;
53 wxArrayString GetParameterTypes( int aPage ) override;
54 wxArrayString GetParameterValues( int aPage ) override;
55 wxArrayString GetParameterErrors( int aPage ) override;
56
57 // must return an empty string or an error description:
58 wxString SetParameterValues( int aPage, wxArrayString& aValues ) override;
59 FOOTPRINT* GetFootprint( wxString* aMessages ) override;
60 void* GetObject() override;
61 wxArrayString GetParameterHints( int aPage ) override;
62 wxArrayString GetParameterDesignators( int aPage = 0 ) override;
63
64 void ResetParameters() override;
65
66private:
67 PyObject* CallMethod( const char* aMethod, PyObject* aArglist = nullptr );
68 wxString CallRetStrMethod( const char* aMethod, PyObject* aArglist = nullptr );
69 wxArrayString CallRetArrayStrMethod( const char* aMethod, PyObject* aArglist = nullptr );
70
71 PyObject* m_PyWizard;
72};
73
74
76{
77public:
78 static void register_wizard( PyObject* aPyWizard );
79 static void deregister_wizard( PyObject* aPyWizard );
80};
81
82#endif /* PCBNEW_FOOTPRINT_WIZARDS_H */
The parent class from where any footprint wizard class must derive.
static void deregister_wizard(PyObject *aPyWizard)
static void register_wizard(PyObject *aPyWizard)
wxArrayString GetParameterTypes(int aPage) override
wxArrayString GetParameterErrors(int aPage) override
wxArrayString GetParameterDesignators(int aPage=0) override
wxString CallRetStrMethod(const char *aMethod, PyObject *aArglist=nullptr)
void ResetParameters() override
Reset all wizard parameters to default values.
wxString GetParameterPageName(int aPage) override
void * GetObject() override
Get the object from where this wizard constructs.
wxArrayString GetParameterValues(int aPage) override
FOOTPRINT * GetFootprint(wxString *aMessages) override
Build the footprint itself and returns it to the caller function.
PYTHON_FOOTPRINT_WIZARD(PyObject *wizard)
wxArrayString CallRetArrayStrMethod(const char *aMethod, PyObject *aArglist=nullptr)
wxArrayString GetParameterNames(int aPage) override
wxString SetParameterValues(int aPage, wxArrayString &aValues) override
wxArrayString GetParameterHints(int aPage) override
PyObject * CallMethod(const char *aMethod, PyObject *aArglist=nullptr)
Class FOOTPRINT_WIZARD and FOOTPRINT_WIZARDS.